From 14c1a2a94c3d7c0ba375d2b0953b025112b21392 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 15 Aug 2014 15:59:59 -0700 Subject: [PATCH] i965: Guard access to gl_Layer by extension #ifdef MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Only assign gl_Layer if we have GL_AMD_vertex_shader_layer. Gen6 doesn't (currently) have that extension, but it also doesn't support layered rendering. Signed-off-by: Kristian Høgsberg Reviewed-by: Kenneth Graunke Reviewed-by: Jordan Justen Tested-by: Jordan Justen --- src/mesa/drivers/dri/i965/brw_meta_fast_clear.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c b/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c index c6540f20a07..5f3817bd978 100644 --- a/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c +++ b/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c @@ -97,7 +97,9 @@ brw_bind_rep_write_shader(struct brw_context *brw, float *color) "uniform int layer;\n" "void main()\n" "{\n" + "#ifdef GL_AMD_vertex_shader_layer\n" " gl_Layer = gl_InstanceID;\n" + "#endif\n" " gl_Position = position;\n" "}\n"; const char *fs_source = -- 2.30.2