blob: 385ca972809a86de43f951be835bca50b4b228aa [file] [log] [blame]
Eric Anholta3a07d42015-03-25 12:58:51 -07001/*
2 * Mesa 3-D graphics library
3 *
4 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
5 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */
25
Kenneth Graunkefeafe702015-04-07 15:16:51 -070026#ifndef SHADER_ENUMS_H
27#define SHADER_ENUMS_H
Eric Anholta3a07d42015-03-25 12:58:51 -070028
29/**
Kenneth Graunke4b273912015-04-07 15:18:43 -070030 * Shader stages. Note that these will become 5 with tessellation.
31 *
32 * The order must match how shaders are ordered in the pipeline.
33 * The GLSL linker assumes that if i<j, then the j-th shader is
34 * executed later than the i-th shader.
35 */
36typedef enum
37{
38 MESA_SHADER_VERTEX = 0,
Fabian Bielera2af9562014-03-07 10:19:09 +010039 MESA_SHADER_TESS_CTRL = 1,
40 MESA_SHADER_TESS_EVAL = 2,
41 MESA_SHADER_GEOMETRY = 3,
42 MESA_SHADER_FRAGMENT = 4,
43 MESA_SHADER_COMPUTE = 5,
Kenneth Graunke4b273912015-04-07 15:18:43 -070044} gl_shader_stage;
45
Rob Clarkf2533f22015-09-11 12:48:05 -040046const char * gl_shader_stage_name(gl_shader_stage stage);
47
Kenneth Graunke4b273912015-04-07 15:18:43 -070048#define MESA_SHADER_STAGES (MESA_SHADER_COMPUTE + 1)
49
Jason Ekstrand47b4efc2015-08-31 14:55:49 -070050
51/**
52 * Indexes for vertex program attributes.
53 * GL_NV_vertex_program aliases generic attributes over the conventional
54 * attributes. In GL_ARB_vertex_program shader the aliasing is optional.
55 * In GL_ARB_vertex_shader / OpenGL 2.0 the aliasing is disallowed (the
56 * generic attributes are distinct/separate).
57 */
58typedef enum
59{
60 VERT_ATTRIB_POS = 0,
61 VERT_ATTRIB_WEIGHT = 1,
62 VERT_ATTRIB_NORMAL = 2,
63 VERT_ATTRIB_COLOR0 = 3,
64 VERT_ATTRIB_COLOR1 = 4,
65 VERT_ATTRIB_FOG = 5,
66 VERT_ATTRIB_COLOR_INDEX = 6,
67 VERT_ATTRIB_EDGEFLAG = 7,
68 VERT_ATTRIB_TEX0 = 8,
69 VERT_ATTRIB_TEX1 = 9,
70 VERT_ATTRIB_TEX2 = 10,
71 VERT_ATTRIB_TEX3 = 11,
72 VERT_ATTRIB_TEX4 = 12,
73 VERT_ATTRIB_TEX5 = 13,
74 VERT_ATTRIB_TEX6 = 14,
75 VERT_ATTRIB_TEX7 = 15,
76 VERT_ATTRIB_POINT_SIZE = 16,
77 VERT_ATTRIB_GENERIC0 = 17,
78 VERT_ATTRIB_GENERIC1 = 18,
79 VERT_ATTRIB_GENERIC2 = 19,
80 VERT_ATTRIB_GENERIC3 = 20,
81 VERT_ATTRIB_GENERIC4 = 21,
82 VERT_ATTRIB_GENERIC5 = 22,
83 VERT_ATTRIB_GENERIC6 = 23,
84 VERT_ATTRIB_GENERIC7 = 24,
85 VERT_ATTRIB_GENERIC8 = 25,
86 VERT_ATTRIB_GENERIC9 = 26,
87 VERT_ATTRIB_GENERIC10 = 27,
88 VERT_ATTRIB_GENERIC11 = 28,
89 VERT_ATTRIB_GENERIC12 = 29,
90 VERT_ATTRIB_GENERIC13 = 30,
91 VERT_ATTRIB_GENERIC14 = 31,
92 VERT_ATTRIB_GENERIC15 = 32,
93 VERT_ATTRIB_MAX = 33
94} gl_vert_attrib;
95
Rob Clarkf2533f22015-09-11 12:48:05 -040096const char * gl_vert_attrib_name(gl_vert_attrib attrib);
97
Jason Ekstrand47b4efc2015-08-31 14:55:49 -070098/**
99 * Symbolic constats to help iterating over
100 * specific blocks of vertex attributes.
101 *
102 * VERT_ATTRIB_FF
103 * includes all fixed function attributes as well as
104 * the aliased GL_NV_vertex_program shader attributes.
105 * VERT_ATTRIB_TEX
106 * include the classic texture coordinate attributes.
107 * Is a subset of VERT_ATTRIB_FF.
108 * VERT_ATTRIB_GENERIC
109 * include the OpenGL 2.0+ GLSL generic shader attributes.
110 * These alias the generic GL_ARB_vertex_shader attributes.
111 */
112#define VERT_ATTRIB_FF(i) (VERT_ATTRIB_POS + (i))
113#define VERT_ATTRIB_FF_MAX VERT_ATTRIB_GENERIC0
114
115#define VERT_ATTRIB_TEX(i) (VERT_ATTRIB_TEX0 + (i))
116#define VERT_ATTRIB_TEX_MAX MAX_TEXTURE_COORD_UNITS
117
118#define VERT_ATTRIB_GENERIC(i) (VERT_ATTRIB_GENERIC0 + (i))
119#define VERT_ATTRIB_GENERIC_MAX MAX_VERTEX_GENERIC_ATTRIBS
120
121/**
122 * Bitflags for vertex attributes.
123 * These are used in bitfields in many places.
124 */
125/*@{*/
126#define VERT_BIT_POS BITFIELD64_BIT(VERT_ATTRIB_POS)
127#define VERT_BIT_WEIGHT BITFIELD64_BIT(VERT_ATTRIB_WEIGHT)
128#define VERT_BIT_NORMAL BITFIELD64_BIT(VERT_ATTRIB_NORMAL)
129#define VERT_BIT_COLOR0 BITFIELD64_BIT(VERT_ATTRIB_COLOR0)
130#define VERT_BIT_COLOR1 BITFIELD64_BIT(VERT_ATTRIB_COLOR1)
131#define VERT_BIT_FOG BITFIELD64_BIT(VERT_ATTRIB_FOG)
132#define VERT_BIT_COLOR_INDEX BITFIELD64_BIT(VERT_ATTRIB_COLOR_INDEX)
133#define VERT_BIT_EDGEFLAG BITFIELD64_BIT(VERT_ATTRIB_EDGEFLAG)
134#define VERT_BIT_TEX0 BITFIELD64_BIT(VERT_ATTRIB_TEX0)
135#define VERT_BIT_TEX1 BITFIELD64_BIT(VERT_ATTRIB_TEX1)
136#define VERT_BIT_TEX2 BITFIELD64_BIT(VERT_ATTRIB_TEX2)
137#define VERT_BIT_TEX3 BITFIELD64_BIT(VERT_ATTRIB_TEX3)
138#define VERT_BIT_TEX4 BITFIELD64_BIT(VERT_ATTRIB_TEX4)
139#define VERT_BIT_TEX5 BITFIELD64_BIT(VERT_ATTRIB_TEX5)
140#define VERT_BIT_TEX6 BITFIELD64_BIT(VERT_ATTRIB_TEX6)
141#define VERT_BIT_TEX7 BITFIELD64_BIT(VERT_ATTRIB_TEX7)
142#define VERT_BIT_POINT_SIZE BITFIELD64_BIT(VERT_ATTRIB_POINT_SIZE)
143#define VERT_BIT_GENERIC0 BITFIELD64_BIT(VERT_ATTRIB_GENERIC0)
144
145#define VERT_BIT(i) BITFIELD64_BIT(i)
146#define VERT_BIT_ALL BITFIELD64_RANGE(0, VERT_ATTRIB_MAX)
147
148#define VERT_BIT_FF(i) VERT_BIT(i)
149#define VERT_BIT_FF_ALL BITFIELD64_RANGE(0, VERT_ATTRIB_FF_MAX)
150#define VERT_BIT_TEX(i) VERT_BIT(VERT_ATTRIB_TEX(i))
151#define VERT_BIT_TEX_ALL \
152 BITFIELD64_RANGE(VERT_ATTRIB_TEX(0), VERT_ATTRIB_TEX_MAX)
153
154#define VERT_BIT_GENERIC(i) VERT_BIT(VERT_ATTRIB_GENERIC(i))
155#define VERT_BIT_GENERIC_ALL \
156 BITFIELD64_RANGE(VERT_ATTRIB_GENERIC(0), VERT_ATTRIB_GENERIC_MAX)
157/*@}*/
158
159
Kenneth Graunke4b273912015-04-07 15:18:43 -0700160/**
Eric Anholt6ff33412015-08-04 10:43:58 -0700161 * Indexes for vertex shader outputs, geometry shader inputs/outputs, and
162 * fragment shader inputs.
163 *
164 * Note that some of these values are not available to all pipeline stages.
165 *
166 * When this enum is updated, the following code must be updated too:
167 * - vertResults (in prog_print.c's arb_output_attrib_string())
168 * - fragAttribs (in prog_print.c's arb_input_attrib_string())
169 * - _mesa_varying_slot_in_fs()
170 */
171typedef enum
172{
173 VARYING_SLOT_POS,
174 VARYING_SLOT_COL0, /* COL0 and COL1 must be contiguous */
175 VARYING_SLOT_COL1,
176 VARYING_SLOT_FOGC,
177 VARYING_SLOT_TEX0, /* TEX0-TEX7 must be contiguous */
178 VARYING_SLOT_TEX1,
179 VARYING_SLOT_TEX2,
180 VARYING_SLOT_TEX3,
181 VARYING_SLOT_TEX4,
182 VARYING_SLOT_TEX5,
183 VARYING_SLOT_TEX6,
184 VARYING_SLOT_TEX7,
185 VARYING_SLOT_PSIZ, /* Does not appear in FS */
186 VARYING_SLOT_BFC0, /* Does not appear in FS */
187 VARYING_SLOT_BFC1, /* Does not appear in FS */
188 VARYING_SLOT_EDGE, /* Does not appear in FS */
189 VARYING_SLOT_CLIP_VERTEX, /* Does not appear in FS */
190 VARYING_SLOT_CLIP_DIST0,
191 VARYING_SLOT_CLIP_DIST1,
192 VARYING_SLOT_PRIMITIVE_ID, /* Does not appear in VS */
193 VARYING_SLOT_LAYER, /* Appears as VS or GS output */
194 VARYING_SLOT_VIEWPORT, /* Appears as VS or GS output */
195 VARYING_SLOT_FACE, /* FS only */
196 VARYING_SLOT_PNTC, /* FS only */
197 VARYING_SLOT_TESS_LEVEL_OUTER, /* Only appears as TCS output. */
198 VARYING_SLOT_TESS_LEVEL_INNER, /* Only appears as TCS output. */
199 VARYING_SLOT_VAR0, /* First generic varying slot */
Rob Clarkf2533f22015-09-11 12:48:05 -0400200 /* the remaining are simply for the benefit of gl_varying_slot_name()
201 * and not to be construed as an upper bound:
202 */
203 VARYING_SLOT_VAR1,
204 VARYING_SLOT_VAR2,
205 VARYING_SLOT_VAR3,
206 VARYING_SLOT_VAR4,
207 VARYING_SLOT_VAR5,
208 VARYING_SLOT_VAR6,
209 VARYING_SLOT_VAR7,
210 VARYING_SLOT_VAR8,
211 VARYING_SLOT_VAR9,
212 VARYING_SLOT_VAR10,
213 VARYING_SLOT_VAR11,
214 VARYING_SLOT_VAR12,
215 VARYING_SLOT_VAR13,
216 VARYING_SLOT_VAR14,
217 VARYING_SLOT_VAR15,
218 VARYING_SLOT_VAR16,
219 VARYING_SLOT_VAR17,
220 VARYING_SLOT_VAR18,
221 VARYING_SLOT_VAR19,
222 VARYING_SLOT_VAR20,
223 VARYING_SLOT_VAR21,
224 VARYING_SLOT_VAR22,
225 VARYING_SLOT_VAR23,
226 VARYING_SLOT_VAR24,
227 VARYING_SLOT_VAR25,
228 VARYING_SLOT_VAR26,
229 VARYING_SLOT_VAR27,
230 VARYING_SLOT_VAR28,
231 VARYING_SLOT_VAR29,
232 VARYING_SLOT_VAR30,
233 VARYING_SLOT_VAR31,
Eric Anholt6ff33412015-08-04 10:43:58 -0700234} gl_varying_slot;
235
Rob Clarkf2533f22015-09-11 12:48:05 -0400236const char * gl_varying_slot_name(gl_varying_slot slot);
Eric Anholt6ff33412015-08-04 10:43:58 -0700237
238/**
239 * Bitflags for varying slots.
240 */
241/*@{*/
242#define VARYING_BIT_POS BITFIELD64_BIT(VARYING_SLOT_POS)
243#define VARYING_BIT_COL0 BITFIELD64_BIT(VARYING_SLOT_COL0)
244#define VARYING_BIT_COL1 BITFIELD64_BIT(VARYING_SLOT_COL1)
245#define VARYING_BIT_FOGC BITFIELD64_BIT(VARYING_SLOT_FOGC)
246#define VARYING_BIT_TEX0 BITFIELD64_BIT(VARYING_SLOT_TEX0)
247#define VARYING_BIT_TEX1 BITFIELD64_BIT(VARYING_SLOT_TEX1)
248#define VARYING_BIT_TEX2 BITFIELD64_BIT(VARYING_SLOT_TEX2)
249#define VARYING_BIT_TEX3 BITFIELD64_BIT(VARYING_SLOT_TEX3)
250#define VARYING_BIT_TEX4 BITFIELD64_BIT(VARYING_SLOT_TEX4)
251#define VARYING_BIT_TEX5 BITFIELD64_BIT(VARYING_SLOT_TEX5)
252#define VARYING_BIT_TEX6 BITFIELD64_BIT(VARYING_SLOT_TEX6)
253#define VARYING_BIT_TEX7 BITFIELD64_BIT(VARYING_SLOT_TEX7)
254#define VARYING_BIT_TEX(U) BITFIELD64_BIT(VARYING_SLOT_TEX0 + (U))
255#define VARYING_BITS_TEX_ANY BITFIELD64_RANGE(VARYING_SLOT_TEX0, \
256 MAX_TEXTURE_COORD_UNITS)
257#define VARYING_BIT_PSIZ BITFIELD64_BIT(VARYING_SLOT_PSIZ)
258#define VARYING_BIT_BFC0 BITFIELD64_BIT(VARYING_SLOT_BFC0)
259#define VARYING_BIT_BFC1 BITFIELD64_BIT(VARYING_SLOT_BFC1)
260#define VARYING_BIT_EDGE BITFIELD64_BIT(VARYING_SLOT_EDGE)
261#define VARYING_BIT_CLIP_VERTEX BITFIELD64_BIT(VARYING_SLOT_CLIP_VERTEX)
262#define VARYING_BIT_CLIP_DIST0 BITFIELD64_BIT(VARYING_SLOT_CLIP_DIST0)
263#define VARYING_BIT_CLIP_DIST1 BITFIELD64_BIT(VARYING_SLOT_CLIP_DIST1)
264#define VARYING_BIT_PRIMITIVE_ID BITFIELD64_BIT(VARYING_SLOT_PRIMITIVE_ID)
265#define VARYING_BIT_LAYER BITFIELD64_BIT(VARYING_SLOT_LAYER)
266#define VARYING_BIT_VIEWPORT BITFIELD64_BIT(VARYING_SLOT_VIEWPORT)
267#define VARYING_BIT_FACE BITFIELD64_BIT(VARYING_SLOT_FACE)
268#define VARYING_BIT_PNTC BITFIELD64_BIT(VARYING_SLOT_PNTC)
269#define VARYING_BIT_TESS_LEVEL_OUTER BITFIELD64_BIT(VARYING_SLOT_TESS_LEVEL_OUTER)
270#define VARYING_BIT_TESS_LEVEL_INNER BITFIELD64_BIT(VARYING_SLOT_TESS_LEVEL_INNER)
271#define VARYING_BIT_VAR(V) BITFIELD64_BIT(VARYING_SLOT_VAR0 + (V))
272/*@}*/
273
274/**
Eric Anholta3a07d42015-03-25 12:58:51 -0700275 * Bitflags for system values.
276 */
277#define SYSTEM_BIT_SAMPLE_ID ((uint64_t)1 << SYSTEM_VALUE_SAMPLE_ID)
278#define SYSTEM_BIT_SAMPLE_POS ((uint64_t)1 << SYSTEM_VALUE_SAMPLE_POS)
279#define SYSTEM_BIT_SAMPLE_MASK_IN ((uint64_t)1 << SYSTEM_VALUE_SAMPLE_MASK_IN)
Jordan Justenbf8d6e52014-10-10 08:28:24 -0700280#define SYSTEM_BIT_LOCAL_INVOCATION_ID ((uint64_t)1 << SYSTEM_VALUE_LOCAL_INVOCATION_ID)
281
Eric Anholta3a07d42015-03-25 12:58:51 -0700282/**
283 * If the gl_register_file is PROGRAM_SYSTEM_VALUE, the register index will be
284 * one of these values. If a NIR variable's mode is nir_var_system_value, it
285 * will be one of these values.
286 */
287typedef enum
288{
289 /**
290 * \name Vertex shader system values
291 */
292 /*@{*/
293 /**
294 * OpenGL-style vertex ID.
295 *
296 * Section 2.11.7 (Shader Execution), subsection Shader Inputs, of the
297 * OpenGL 3.3 core profile spec says:
298 *
299 * "gl_VertexID holds the integer index i implicitly passed by
300 * DrawArrays or one of the other drawing commands defined in section
301 * 2.8.3."
302 *
303 * Section 2.8.3 (Drawing Commands) of the same spec says:
304 *
305 * "The commands....are equivalent to the commands with the same base
306 * name (without the BaseVertex suffix), except that the ith element
307 * transferred by the corresponding draw call will be taken from
308 * element indices[i] + basevertex of each enabled array."
309 *
310 * Additionally, the overview in the GL_ARB_shader_draw_parameters spec
311 * says:
312 *
313 * "In unextended GL, vertex shaders have inputs named gl_VertexID and
314 * gl_InstanceID, which contain, respectively the index of the vertex
315 * and instance. The value of gl_VertexID is the implicitly passed
316 * index of the vertex being processed, which includes the value of
317 * baseVertex, for those commands that accept it."
318 *
319 * gl_VertexID gets basevertex added in. This differs from DirectX where
320 * SV_VertexID does \b not get basevertex added in.
321 *
322 * \note
323 * If all system values are available, \c SYSTEM_VALUE_VERTEX_ID will be
324 * equal to \c SYSTEM_VALUE_VERTEX_ID_ZERO_BASE plus
325 * \c SYSTEM_VALUE_BASE_VERTEX.
326 *
327 * \sa SYSTEM_VALUE_VERTEX_ID_ZERO_BASE, SYSTEM_VALUE_BASE_VERTEX
328 */
329 SYSTEM_VALUE_VERTEX_ID,
330
331 /**
332 * Instanced ID as supplied to gl_InstanceID
333 *
334 * Values assigned to gl_InstanceID always begin with zero, regardless of
335 * the value of baseinstance.
336 *
337 * Section 11.1.3.9 (Shader Inputs) of the OpenGL 4.4 core profile spec
338 * says:
339 *
340 * "gl_InstanceID holds the integer instance number of the current
341 * primitive in an instanced draw call (see section 10.5)."
342 *
343 * Through a big chain of pseudocode, section 10.5 describes that
344 * baseinstance is not counted by gl_InstanceID. In that section, notice
345 *
346 * "If an enabled vertex attribute array is instanced (it has a
347 * non-zero divisor as specified by VertexAttribDivisor), the element
348 * index that is transferred to the GL, for all vertices, is given by
349 *
350 * floor(instance/divisor) + baseinstance
351 *
352 * If an array corresponding to an attribute required by a vertex
353 * shader is not enabled, then the corresponding element is taken from
354 * the current attribute state (see section 10.2)."
355 *
356 * Note that baseinstance is \b not included in the value of instance.
357 */
358 SYSTEM_VALUE_INSTANCE_ID,
359
360 /**
361 * DirectX-style vertex ID.
362 *
363 * Unlike \c SYSTEM_VALUE_VERTEX_ID, this system value does \b not include
364 * the value of basevertex.
365 *
366 * \sa SYSTEM_VALUE_VERTEX_ID, SYSTEM_VALUE_BASE_VERTEX
367 */
368 SYSTEM_VALUE_VERTEX_ID_ZERO_BASE,
369
370 /**
371 * Value of \c basevertex passed to \c glDrawElementsBaseVertex and similar
372 * functions.
373 *
374 * \sa SYSTEM_VALUE_VERTEX_ID, SYSTEM_VALUE_VERTEX_ID_ZERO_BASE
375 */
376 SYSTEM_VALUE_BASE_VERTEX,
377 /*@}*/
378
379 /**
380 * \name Geometry shader system values
381 */
382 /*@{*/
Fabian Bieler1036b022014-03-20 22:41:40 +0100383 SYSTEM_VALUE_INVOCATION_ID, /**< (Also in Tessellation Control shader) */
Eric Anholta3a07d42015-03-25 12:58:51 -0700384 /*@}*/
385
386 /**
387 * \name Fragment shader system values
388 */
389 /*@{*/
390 SYSTEM_VALUE_FRONT_FACE, /**< (not done yet) */
391 SYSTEM_VALUE_SAMPLE_ID,
392 SYSTEM_VALUE_SAMPLE_POS,
393 SYSTEM_VALUE_SAMPLE_MASK_IN,
394 /*@}*/
395
Fabian Bieler1036b022014-03-20 22:41:40 +0100396 /**
397 * \name Tessellation Evaluation shader system values
398 */
399 /*@{*/
400 SYSTEM_VALUE_TESS_COORD,
401 SYSTEM_VALUE_VERTICES_IN, /**< Tessellation vertices in input patch */
402 SYSTEM_VALUE_PRIMITIVE_ID, /**< (currently not used by GS) */
403 SYSTEM_VALUE_TESS_LEVEL_OUTER, /**< TES input */
404 SYSTEM_VALUE_TESS_LEVEL_INNER, /**< TES input */
405 /*@}*/
406
Jordan Justenbf8d6e52014-10-10 08:28:24 -0700407 /**
408 * \name Compute shader system values
409 */
410 /*@{*/
411 SYSTEM_VALUE_LOCAL_INVOCATION_ID,
Jordan Justenf5bb5a12014-10-10 08:28:24 -0700412 SYSTEM_VALUE_WORK_GROUP_ID,
Jordan Justenbf8d6e52014-10-10 08:28:24 -0700413 /*@}*/
414
Eric Anholta3a07d42015-03-25 12:58:51 -0700415 SYSTEM_VALUE_MAX /**< Number of values */
416} gl_system_value;
417
Rob Clarkf2533f22015-09-11 12:48:05 -0400418const char * gl_system_value_name(gl_system_value sysval);
Eric Anholta3a07d42015-03-25 12:58:51 -0700419
420/**
421 * The possible interpolation qualifiers that can be applied to a fragment
422 * shader input in GLSL.
423 *
424 * Note: INTERP_QUALIFIER_NONE must be 0 so that memsetting the
425 * gl_fragment_program data structure to 0 causes the default behavior.
426 */
427enum glsl_interp_qualifier
428{
429 INTERP_QUALIFIER_NONE = 0,
430 INTERP_QUALIFIER_SMOOTH,
431 INTERP_QUALIFIER_FLAT,
432 INTERP_QUALIFIER_NOPERSPECTIVE,
433 INTERP_QUALIFIER_COUNT /**< Number of interpolation qualifiers */
434};
435
Rob Clarkf2533f22015-09-11 12:48:05 -0400436const char * glsl_interp_qualifier_name(enum glsl_interp_qualifier qual);
437
Eric Anholt6ff33412015-08-04 10:43:58 -0700438/**
439 * Fragment program results
440 */
441typedef enum
442{
443 FRAG_RESULT_DEPTH = 0,
444 FRAG_RESULT_STENCIL = 1,
445 /* If a single color should be written to all render targets, this
446 * register is written. No FRAG_RESULT_DATAn will be written.
447 */
448 FRAG_RESULT_COLOR = 2,
449 FRAG_RESULT_SAMPLE_MASK = 3,
450
451 /* FRAG_RESULT_DATAn are the per-render-target (GLSL gl_FragData[n]
452 * or ARB_fragment_program fragment.color[n]) color results. If
453 * any are written, FRAG_RESULT_COLOR will not be written.
Rob Clarkf2533f22015-09-11 12:48:05 -0400454 * FRAG_RESULT_DATA1 and up are simply for the benefit of
455 * gl_frag_result_name() and not to be construed as an upper bound
Eric Anholt6ff33412015-08-04 10:43:58 -0700456 */
457 FRAG_RESULT_DATA0 = 4,
Rob Clarkf2533f22015-09-11 12:48:05 -0400458 FRAG_RESULT_DATA1,
459 FRAG_RESULT_DATA2,
460 FRAG_RESULT_DATA3,
461 FRAG_RESULT_DATA4,
462 FRAG_RESULT_DATA5,
463 FRAG_RESULT_DATA6,
464 FRAG_RESULT_DATA7,
Eric Anholt6ff33412015-08-04 10:43:58 -0700465} gl_frag_result;
Eric Anholta3a07d42015-03-25 12:58:51 -0700466
Rob Clarkf2533f22015-09-11 12:48:05 -0400467const char * gl_frag_result_name(gl_frag_result result);
468
Kenneth Graunkefeafe702015-04-07 15:16:51 -0700469#endif /* SHADER_ENUMS_H */