diff options
Diffstat (limited to 'src/glsl/ir_variable.cpp')
-rw-r--r-- | src/glsl/ir_variable.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/glsl/ir_variable.cpp b/src/glsl/ir_variable.cpp index ddc3bb0b9f3..f2c900f718f 100644 --- a/src/glsl/ir_variable.cpp +++ b/src/glsl/ir_variable.cpp @@ -422,6 +422,20 @@ generate_ARB_draw_buffers_variables(exec_list *instructions, } } +static void +generate_ARB_shader_stencil_export_variables(exec_list *instructions, + struct _mesa_glsl_parse_state *state, + bool warn) +{ + /* gl_FragStencilRefARB is only available in the fragment shader. + */ + ir_variable *const fd = + add_variable("gl_FragStencilRefARB", ir_var_out, FRAG_RESULT_STENCIL, + glsl_type::int_type, instructions, state->symbols); + + if (warn) + fd->warn_extension = "GL_ARB_shader_stencil_export"; +} static void generate_120_fs_variables(exec_list *instructions, @@ -471,6 +485,10 @@ initialize_fs_variables(exec_list *instructions, generate_130_fs_variables(instructions, state); break; } + + if (state->ARB_shader_stencil_export_enable) + generate_ARB_shader_stencil_export_variables(instructions, state, + state->ARB_shader_stencil_export_warn); } void |