diff options
Diffstat (limited to 'mesalib/src/glsl')
-rw-r--r-- | mesalib/src/glsl/builtin_variables.cpp | 46 | ||||
-rw-r--r-- | mesalib/src/glsl/ir.cpp | 2 | ||||
-rw-r--r-- | mesalib/src/glsl/ir.h | 4 | ||||
-rw-r--r-- | mesalib/src/glsl/link_varyings.cpp | 15 | ||||
-rw-r--r-- | mesalib/src/glsl/linker.cpp | 4 | ||||
-rw-r--r-- | mesalib/src/glsl/lower_packed_varyings.cpp | 2 |
6 files changed, 36 insertions, 37 deletions
diff --git a/mesalib/src/glsl/builtin_variables.cpp b/mesalib/src/glsl/builtin_variables.cpp index 53c4c51cd..b0c7a2035 100644 --- a/mesalib/src/glsl/builtin_variables.cpp +++ b/mesalib/src/glsl/builtin_variables.cpp @@ -47,18 +47,18 @@ struct builtin_variable { }; static const builtin_variable builtin_core_vs_variables[] = { - { ir_var_shader_out, VERT_RESULT_HPOS, "vec4", "gl_Position" }, - { ir_var_shader_out, VERT_RESULT_PSIZ, "float", "gl_PointSize" }, + { ir_var_shader_out, VARYING_SLOT_POS, "vec4", "gl_Position" }, + { ir_var_shader_out, VARYING_SLOT_PSIZ, "float", "gl_PointSize" }, }; static const builtin_variable builtin_core_fs_variables[] = { - { ir_var_shader_in, FRAG_ATTRIB_WPOS, "vec4", "gl_FragCoord" }, - { ir_var_shader_in, FRAG_ATTRIB_FACE, "bool", "gl_FrontFacing" }, + { ir_var_shader_in, VARYING_SLOT_POS, "vec4", "gl_FragCoord" }, + { ir_var_shader_in, VARYING_SLOT_FACE, "bool", "gl_FrontFacing" }, { ir_var_shader_out, FRAG_RESULT_COLOR, "vec4", "gl_FragColor" }, }; static const builtin_variable builtin_100ES_fs_variables[] = { - { ir_var_shader_in, FRAG_ATTRIB_PNTC, "vec2", "gl_PointCoord" }, + { ir_var_shader_in, VARYING_SLOT_PNTC, "vec2", "gl_PointCoord" }, }; static const builtin_variable builtin_300ES_vs_variables[] = { @@ -66,10 +66,10 @@ static const builtin_variable builtin_300ES_vs_variables[] = { }; static const builtin_variable builtin_300ES_fs_variables[] = { - { ir_var_shader_in, FRAG_ATTRIB_WPOS, "vec4", "gl_FragCoord" }, - { ir_var_shader_in, FRAG_ATTRIB_FACE, "bool", "gl_FrontFacing" }, + { ir_var_shader_in, VARYING_SLOT_POS, "vec4", "gl_FragCoord" }, + { ir_var_shader_in, VARYING_SLOT_FACE, "bool", "gl_FrontFacing" }, { ir_var_shader_out, FRAG_RESULT_DEPTH, "float", "gl_FragDepth" }, - { ir_var_shader_in, FRAG_ATTRIB_PNTC, "vec2", "gl_PointCoord" }, + { ir_var_shader_in, VARYING_SLOT_PNTC, "vec2", "gl_PointCoord" }, }; static const builtin_variable builtin_110_fs_variables[] = { @@ -77,9 +77,9 @@ static const builtin_variable builtin_110_fs_variables[] = { }; static const builtin_variable builtin_110_deprecated_fs_variables[] = { - { ir_var_shader_in, FRAG_ATTRIB_COL0, "vec4", "gl_Color" }, - { ir_var_shader_in, FRAG_ATTRIB_COL1, "vec4", "gl_SecondaryColor" }, - { ir_var_shader_in, FRAG_ATTRIB_FOGC, "float", "gl_FogFragCoord" }, + { ir_var_shader_in, VARYING_SLOT_COL0, "vec4", "gl_Color" }, + { ir_var_shader_in, VARYING_SLOT_COL1, "vec4", "gl_SecondaryColor" }, + { ir_var_shader_in, VARYING_SLOT_FOGC, "float", "gl_FogFragCoord" }, }; static const builtin_variable builtin_110_deprecated_vs_variables[] = { @@ -96,16 +96,16 @@ static const builtin_variable builtin_110_deprecated_vs_variables[] = { { ir_var_shader_in, VERT_ATTRIB_TEX6, "vec4", "gl_MultiTexCoord6" }, { ir_var_shader_in, VERT_ATTRIB_TEX7, "vec4", "gl_MultiTexCoord7" }, { ir_var_shader_in, VERT_ATTRIB_FOG, "float", "gl_FogCoord" }, - { ir_var_shader_out, VERT_RESULT_CLIP_VERTEX, "vec4", "gl_ClipVertex" }, - { ir_var_shader_out, VERT_RESULT_COL0, "vec4", "gl_FrontColor" }, - { ir_var_shader_out, VERT_RESULT_BFC0, "vec4", "gl_BackColor" }, - { ir_var_shader_out, VERT_RESULT_COL1, "vec4", "gl_FrontSecondaryColor" }, - { ir_var_shader_out, VERT_RESULT_BFC1, "vec4", "gl_BackSecondaryColor" }, - { ir_var_shader_out, VERT_RESULT_FOGC, "float", "gl_FogFragCoord" }, + { ir_var_shader_out, VARYING_SLOT_CLIP_VERTEX, "vec4", "gl_ClipVertex" }, + { ir_var_shader_out, VARYING_SLOT_COL0, "vec4", "gl_FrontColor" }, + { ir_var_shader_out, VARYING_SLOT_BFC0, "vec4", "gl_BackColor" }, + { ir_var_shader_out, VARYING_SLOT_COL1, "vec4", "gl_FrontSecondaryColor" }, + { ir_var_shader_out, VARYING_SLOT_BFC1, "vec4", "gl_BackSecondaryColor" }, + { ir_var_shader_out, VARYING_SLOT_FOGC, "float", "gl_FogFragCoord" }, }; static const builtin_variable builtin_120_fs_variables[] = { - { ir_var_shader_in, FRAG_ATTRIB_PNTC, "vec2", "gl_PointCoord" }, + { ir_var_shader_in, VARYING_SLOT_PNTC, "vec2", "gl_PointCoord" }, }; static const builtin_variable builtin_130_vs_variables[] = { @@ -681,7 +681,7 @@ generate_110_uniforms(exec_list *instructions, glsl_type::get_array_instance(glsl_type::vec4_type, VERT_ATTRIB_MAX); add_uniform(instructions, symtab, "gl_CurrentAttribVertMESA", vert_attribs); const glsl_type *const frag_attribs = - glsl_type::get_array_instance(glsl_type::vec4_type, FRAG_ATTRIB_MAX); + glsl_type::get_array_instance(glsl_type::vec4_type, VARYING_SLOT_MAX); add_uniform(instructions, symtab, "gl_CurrentAttribFragMESA", frag_attribs); } @@ -755,7 +755,7 @@ generate_110_vs_variables(exec_list *instructions, add_variable(instructions, state->symbols, "gl_TexCoord", vec4_array_type, ir_var_shader_out, - VERT_RESULT_TEX0); + VARYING_SLOT_TEX0); generate_ARB_draw_buffers_variables(instructions, state, false, vertex_shader); @@ -816,7 +816,7 @@ generate_130_vs_variables(exec_list *instructions, add_variable(instructions, state->symbols, "gl_ClipDistance", clip_distance_array_type, ir_var_shader_out, - VERT_RESULT_CLIP_DIST0); + VARYING_SLOT_CLIP_DIST0); } @@ -942,7 +942,7 @@ generate_110_fs_variables(exec_list *instructions, add_variable(instructions, state->symbols, "gl_TexCoord", vec4_array_type, ir_var_shader_in, - FRAG_ATTRIB_TEX0); + VARYING_SLOT_TEX0); generate_ARB_draw_buffers_variables(instructions, state, false, fragment_shader); @@ -1089,7 +1089,7 @@ generate_fs_clipdistance(exec_list *instructions, add_variable(instructions, state->symbols, "gl_ClipDistance", clip_distance_array_type, ir_var_shader_in, - FRAG_ATTRIB_CLIP_DIST0); + VARYING_SLOT_CLIP_DIST0); } static void diff --git a/mesalib/src/glsl/ir.cpp b/mesalib/src/glsl/ir.cpp index 2eb3af695..60ef8b95a 100644 --- a/mesalib/src/glsl/ir.cpp +++ b/mesalib/src/glsl/ir.cpp @@ -1553,7 +1553,7 @@ ir_variable::determine_interpolation_mode(bool flat_shade) return (glsl_interp_qualifier) this->interpolation; int location = this->location; bool is_gl_Color = - location == FRAG_ATTRIB_COL0 || location == FRAG_ATTRIB_COL1; + location == VARYING_SLOT_COL0 || location == VARYING_SLOT_COL1; if (flat_shade && is_gl_Color) return INTERP_QUALIFIER_FLAT; else diff --git a/mesalib/src/glsl/ir.h b/mesalib/src/glsl/ir.h index 393b48673..bbfec695f 100644 --- a/mesalib/src/glsl/ir.h +++ b/mesalib/src/glsl/ir.h @@ -505,8 +505,8 @@ public: * The precise meaning of this field depends on the nature of the variable. * * - Vertex shader input: one of the values from \c gl_vert_attrib. - * - Vertex shader output: one of the values from \c gl_vert_result. - * - Fragment shader input: one of the values from \c gl_frag_attrib. + * - Vertex shader output: one of the values from \c gl_varying_slot. + * - Fragment shader input: one of the values from \c gl_varying_slot. * - Fragment shader output: one of the values from \c gl_frag_result. * - Uniforms: Per-stage uniform slot number for default uniform block. * - Uniforms: Index within the uniform block definition for UBO members. diff --git a/mesalib/src/glsl/link_varyings.cpp b/mesalib/src/glsl/link_varyings.cpp index 616933dfd..04c9fdd7c 100644 --- a/mesalib/src/glsl/link_varyings.cpp +++ b/mesalib/src/glsl/link_varyings.cpp @@ -604,8 +604,8 @@ private: /** * The location which has been assigned for this varying. This is * expressed in multiples of a float, with the first generic varying - * (i.e. the one referred to by VERT_RESULT_VAR0 or FRAG_ATTRIB_VAR0) - * represented by the value 0. + * (i.e. the one referred to by VARYING_SLOT_VAR0) represented by the + * value 0. */ unsigned generic_location; } *matches; @@ -842,9 +842,9 @@ is_varying_var(GLenum shaderType, const ir_variable *var) if (shaderType == GL_FRAGMENT_SHADER && var->mode == ir_var_shader_in) { switch (var->location) { - case FRAG_ATTRIB_WPOS: - case FRAG_ATTRIB_FACE: - case FRAG_ATTRIB_PNTC: + case VARYING_SLOT_POS: + case VARYING_SLOT_FACE: + case VARYING_SLOT_PNTC: return false; default: return true; @@ -958,9 +958,8 @@ assign_varying_locations(struct gl_context *ctx, unsigned num_tfeedback_decls, tfeedback_decl *tfeedback_decls) { - /* FINISHME: Set dynamically when geometry shader support is added. */ - const unsigned producer_base = VERT_RESULT_VAR0; - const unsigned consumer_base = FRAG_ATTRIB_VAR0; + const unsigned producer_base = VARYING_SLOT_VAR0; + const unsigned consumer_base = VARYING_SLOT_VAR0; varying_matches matches(ctx->Const.DisableVaryingPacking); hash_table *tfeedback_candidates = hash_table_ctor(0, hash_table_string_hash, hash_table_string_compare); diff --git a/mesalib/src/glsl/linker.cpp b/mesalib/src/glsl/linker.cpp index 57e7a9ad3..29856b080 100644 --- a/mesalib/src/glsl/linker.cpp +++ b/mesalib/src/glsl/linker.cpp @@ -1777,13 +1777,13 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) if (prog->_LinkedShaders[MESA_SHADER_VERTEX] != NULL) { link_invalidate_variable_locations( prog->_LinkedShaders[MESA_SHADER_VERTEX], - VERT_ATTRIB_GENERIC0, VERT_RESULT_VAR0); + VERT_ATTRIB_GENERIC0, VARYING_SLOT_VAR0); } /* FINISHME: Geometry shaders not implemented yet */ if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] != NULL) { link_invalidate_variable_locations( prog->_LinkedShaders[MESA_SHADER_FRAGMENT], - FRAG_ATTRIB_VAR0, FRAG_RESULT_DATA0); + VARYING_SLOT_VAR0, FRAG_RESULT_DATA0); } /* FINISHME: The value of the max_attribute_index parameter is diff --git a/mesalib/src/glsl/lower_packed_varyings.cpp b/mesalib/src/glsl/lower_packed_varyings.cpp index 8a40f5e72..b4cc5cd0d 100644 --- a/mesalib/src/glsl/lower_packed_varyings.cpp +++ b/mesalib/src/glsl/lower_packed_varyings.cpp @@ -117,7 +117,7 @@ private: /** * Location representing the first generic varying slot for this shader - * stage (e.g. VERT_RESULT_VAR0 if we are packing vertex shader outputs). + * stage (e.g. VARYING_SLOT_VAR0 if we are packing vertex shader outputs). * Varyings whose location is less than this value are assumed to * correspond to special fixed function hardware, so they are not lowered. */ |