summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-11-10 22:36:39 -0800
committerEmil Velikov <emil.l.velikov@gmail.com>2016-11-24 16:34:39 +0000
commit9d5c3fc12b05d944508ef4e3b1f2ddc4f23c0a82 (patch)
treed4864e91a67e5e5944c9f6576dd01663a2bd20d4 /src
parentcf8b11fc6ce5618117bb48aca108ea448438a926 (diff)
downloadexternal_mesa3d-9d5c3fc12b05d944508ef4e3b1f2ddc4f23c0a82.zip
external_mesa3d-9d5c3fc12b05d944508ef4e3b1f2ddc4f23c0a82.tar.gz
external_mesa3d-9d5c3fc12b05d944508ef4e3b1f2ddc4f23c0a82.tar.bz2
i965/gs: Allow primitive id to be a system value
This allows for gl_PrimitiveId to come in as a system value rather than as an input. This is the way it will come in from SPIR-V. We keeps the input path working for now so we don't break GL. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit a5e88e66e633aaeb587b274d80e21cd46c8ee2cb) [Emil Velikov: nir_shader::info is not a pointer in branch] Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Conflicts: src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
index 59c7d21..b0ee289 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
@@ -626,7 +626,8 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,
shader = brw_postprocess_nir(shader, compiler->devinfo, is_scalar);
prog_data->include_primitive_id =
- (shader->info.inputs_read & VARYING_BIT_PRIMITIVE_ID) != 0;
+ (shader->info.inputs_read & VARYING_BIT_PRIMITIVE_ID) ||
+ (shader->info.system_values_read & (1 << SYSTEM_VALUE_PRIMITIVE_ID));
prog_data->invocations = shader->info.gs.invocations;