glsl: add support for shader stencil export
This adds proper support for the GL_ARB_shader_stencil_export extension to the GLSL compiler. Thanks to Ian for pointing out where I need to add things.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user