diff options
author | Marek Olšák <[email protected]> | 2011-05-02 16:41:04 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-05-03 12:03:22 +0200 |
commit | 5ba2e7adf01aaa855e36a577a47de8f4ddace99c (patch) | |
tree | 74c3fe13b5fff0ff02d00911ce5f28b5e12591a3 /src/glsl/ir_variable.cpp | |
parent | 93754d8499934a4c38e9a934d0a934c1484b707c (diff) |
mesa: implement AMD_shader_stencil_export
It's just an alias of the ARB variant with some GLSL compiler changes.
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ir_variable.cpp')
-rw-r--r-- | src/glsl/ir_variable.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/glsl/ir_variable.cpp b/src/glsl/ir_variable.cpp index f3577175691..b8487694c51 100644 --- a/src/glsl/ir_variable.cpp +++ b/src/glsl/ir_variable.cpp @@ -767,6 +767,22 @@ generate_ARB_shader_stencil_export_variables(exec_list *instructions, } static void +generate_AMD_shader_stencil_export_variables(exec_list *instructions, + struct _mesa_glsl_parse_state *state, + bool warn) +{ + /* gl_FragStencilRefAMD is only available in the fragment shader. + */ + ir_variable *const fd = + add_variable(instructions, state->symbols, + "gl_FragStencilRefAMD", glsl_type::int_type, + ir_var_out, FRAG_RESULT_STENCIL); + + if (warn) + fd->warn_extension = "GL_AMD_shader_stencil_export"; +} + +static void generate_120_fs_variables(exec_list *instructions, struct _mesa_glsl_parse_state *state) { @@ -818,6 +834,10 @@ initialize_fs_variables(exec_list *instructions, if (state->ARB_shader_stencil_export_enable) generate_ARB_shader_stencil_export_variables(instructions, state, state->ARB_shader_stencil_export_warn); + + if (state->AMD_shader_stencil_export_enable) + generate_AMD_shader_stencil_export_variables(instructions, state, + state->AMD_shader_stencil_export_warn); } void |