aboutsummaryrefslogtreecommitdiff
path: root/mesalib/docs/specs/EXT_shader_integer_mix.spec
blob: 92cec64dccfec317ee040c421959f096c0adab20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
Name

    EXT_shader_integer_mix

Name Strings

    GL_EXT_shader_integer_mix

Contact

    Matt Turner (matt.turner 'at' intel.com)

Contributors

    Matt Turner, Intel
    Ian Romanick, Intel

Status

    Shipping

Version

    Last Modified Date:         09/12/2013
    Author Revision:            6

Number

    TBD

Dependencies

    OpenGL 3.0 or OpenGL ES 3.0 is required. This extension interacts with
    GL_ARB_ES3_compatibility.

    This extension is written against the OpenGL 4.4 (core) specification
    and the GLSL 4.40 specification.

Overview

    GLSL 1.30 (and GLSL ES 3.00) expanded the mix() built-in function to
    operate on a boolean third argument that does not interpolate but
    selects. This extension extends mix() to select between int, uint,
    and bool components.

New Procedures and Functions

    None.

New Tokens

    None.

Additions to Chapter 8 of the GLSL 4.40 Specification (Built-in Functions)

    Modify Section 8.3, Common Functions

    Additions to the table listing common built-in functions:

      Syntax                       Description
      ---------------------------  --------------------------------------------------
      genIType mix(genIType x,     Selects which vector each returned component comes
                   genIType y,     from. For a component of a that is false, the
                   genBType a)     corresponding component of x is returned. For a
      genUType mix(genUType x,     component of a that is true, the corresponding
                   genUType y,     component of y is returned.
                   genBType a)
      genBType mix(genBType x,
                   genBType y,
                   genBType a)

Additions to the AGL/GLX/WGL Specifications

    None.

Modifications to The OpenGL Shading Language Specification, Version 4.40

    Including the following line in a shader can be used to control the
    language features described in this extension:

      #extension GL_EXT_shader_integer_mix : <behavior>

    where <behavior> is as specified in section 3.3.

    New preprocessor #defines are added to the OpenGL Shading Language:

      #define GL_EXT_shader_integer_mix        1

Interactions with ARB_ES3_compatibility

    On desktop implementations that support ARB_ES3_compatibility,
    GL_EXT_shader_integer_mix can be enabled (and the new functions
    used) in shaders declared with '#version 300 es'.

GLX Protocol

    None.

Errors

    None.

New State

    None.

New Implementation Dependent State

    None.

Issues

    1) Should we allow linear interpolation of integers via a non-boolean
       third component?

    RESOLVED: No.

    2) Should we allow mix() to select between boolean components?

    RESOLVED: Yes. Implementing the same functionality using casts would be
    possible but ugly.

Revision History

    Rev.    Date      Author    Changes
    ----  --------    --------  ---------------------------------------------
      6   09/12/2013  idr       After discussions in Khronos, change vendor
                                prefix to EXT.

      5   09/09/2013  idr       Add ARB_ES3_compatibility interaction.

      4   09/06/2013  mattst88  Allow extension on OpenGL ES 3.0.

      3   08/28/2013  mattst88  Add #extension/#define changes.

      2   08/26/2013  mattst88  Change vendor prefix to MESA. Add mix() that
                                selects between boolean components.
      1   08/26/2013  mattst88  Initial revision