<div dir="ltr"><div>I just sent out a back-portable patch that adds support for primitive id as a system value without breaking anything (I think). One option if you wanted to avoid squashing would be to do that, then switch to gather_info and then this.<br><br>I don't care much either way. I just need something that we can back-port so that I can put a Vulkan patch on top of it.<br></div>--Jason<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 26, 2016 at 7:00 PM, Timothy Arceri <span dir="ltr"><<a href="mailto:timothy.arceri@collabora.com" target="_blank">timothy.arceri@collabora.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">To be squashed with previous patch<br>
---<br>
src/mesa/drivers/dri/i965/brw_<wbr>shader.cpp | 3 +--<br>
src/mesa/drivers/dri/i965/brw_<wbr>vec4_gs_visitor.cpp | 8 ++------<br>
src/mesa/drivers/dri/i965/brw_<wbr>vec4_tcs.cpp | 5 +----<br>
3 files changed, 4 insertions(+), 12 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_shader.cpp b/src/mesa/drivers/dri/i965/<wbr>brw_shader.cpp<br>
index cd893b1..61bc868 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_shader.cpp<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_shader.cpp<br>
@@ -1355,8 +1355,7 @@ brw_compile_tes(const struct brw_compiler *compiler,<br>
nir->info->patch_inputs_read = key->patch_inputs_read;<br>
<br>
struct brw_vue_map input_vue_map;<br>
- brw_compute_tess_vue_map(&<wbr>input_vue_map,<br>
- nir->info->inputs_read & ~VARYING_BIT_PRIMITIVE_ID,<br>
+ brw_compute_tess_vue_map(&<wbr>input_vue_map, nir->info->inputs_read,<br>
nir->info->patch_inputs_read);<br>
<br>
nir = brw_nir_apply_sampler_key(nir, devinfo, &key->tex, is_scalar);<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_vec4_gs_visitor.cpp b/src/mesa/drivers/dri/i965/<wbr>brw_vec4_gs_visitor.cpp<br>
index 10be41b..892f9df 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_vec4_gs_visitor.cpp<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_vec4_gs_visitor.cpp<br>
@@ -609,12 +609,8 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,<br>
*<br>
* For SSO pipelines, we use a fixed VUE map layout based on variable<br>
* locations, so we can rely on rendezvous-by-location making this work.<br>
- *<br>
- * However, we need to ignore VARYING_SLOT_PRIMITIVE_ID, as it's not<br>
- * written by previous stages and shows up via payload magic.<br>
*/<br>
- GLbitfield64 inputs_read =<br>
- shader->info->inputs_read & ~VARYING_BIT_PRIMITIVE_ID;<br>
+ GLbitfield64 inputs_read = shader->info->inputs_read;<br>
brw_compute_vue_map(compiler-><wbr>devinfo,<br>
&c.input_vue_map, inputs_read,<br>
shader->info->separate_shader)<wbr>;<br>
@@ -626,7 +622,7 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,<br>
shader = brw_postprocess_nir(shader, compiler->devinfo, is_scalar);<br>
<br>
prog_data->include_primitive_<wbr>id =<br>
- (shader->info->inputs_read & VARYING_BIT_PRIMITIVE_ID) != 0;<br>
+ (shader->info->system_values_<wbr>read & 1 << SYSTEM_VALUE_PRIMITIVE_ID) != 0;<br>
<br>
prog_data->invocations = shader->info->gs.invocations;<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_vec4_tcs.cpp b/src/mesa/drivers/dri/i965/<wbr>brw_vec4_tcs.cpp<br>
index 124632c..55afe36 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_vec4_tcs.cpp<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_vec4_tcs.cpp<br>
@@ -460,10 +460,7 @@ brw_compile_tcs(const struct brw_compiler *compiler,<br>
nir->info->patch_outputs_<wbr>written = key->patch_outputs_written;<br>
<br>
struct brw_vue_map input_vue_map;<br>
- brw_compute_vue_map(devinfo, &input_vue_map,<br>
- nir->info->inputs_read & ~VARYING_BIT_PRIMITIVE_ID,<br>
- true);<br>
-<br>
+ brw_compute_vue_map(devinfo, &input_vue_map, nir->info->inputs_read, true);<br>
brw_compute_tess_vue_map(&vue_<wbr>prog_data->vue_map,<br>
nir->info->outputs_written,<br>
nir->info->patch_outputs_<wbr>written);<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.4<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>