summaryrefslogtreecommitdiff
path: root/src/glsl/ir_variable.cpp
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-10-06 09:36:02 +1000
committerDave Airlie <airlied@redhat.com>2010-10-13 09:30:05 +1000
commitd9671863eaae41ba28b6fe82e3e7d1dac12f514c (patch)
treea6a7a78b1beb0c5b9132433797f34f680ab17d44 /src/glsl/ir_variable.cpp
parent39d1feb51e9dac794751e72f48faf26409a84b1c (diff)
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.
Diffstat (limited to 'src/glsl/ir_variable.cpp')
-rw-r--r--src/glsl/ir_variable.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/glsl/ir_variable.cpp b/src/glsl/ir_variable.cpp
index ddc3bb0b9f..f2c900f718 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