i965: update gl_PrimitiveIDIn to be a system variable
authorTimothy Arceri <timothy.arceri@collabora.com>
Tue, 25 Oct 2016 10:55:17 +0000 (21:55 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Fri, 11 Nov 2016 09:39:09 +0000 (20:39 +1100)
Now that we have switched to using nir_shader_gather_info() we
can remove the hacks and just use the system variable.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_shader.cpp
src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
src/mesa/drivers/dri/i965/brw_vec4_tcs.cpp

index cd893b1641977f56091e5fc1f38d1da51a541a74..61bc868db9e0f84558bf40a4651488fb958b6013 100644 (file)
@@ -1355,8 +1355,7 @@ brw_compile_tes(const struct brw_compiler *compiler,
    nir->info->patch_inputs_read = key->patch_inputs_read;
 
    struct brw_vue_map input_vue_map;
-   brw_compute_tess_vue_map(&input_vue_map,
-                            nir->info->inputs_read & ~VARYING_BIT_PRIMITIVE_ID,
+   brw_compute_tess_vue_map(&input_vue_map, nir->info->inputs_read,
                             nir->info->patch_inputs_read);
 
    nir = brw_nir_apply_sampler_key(nir, devinfo, &key->tex, is_scalar);
index 2f4306ab581d5d7cc1bcbbca2a5b80dbec4ce585..b2add0378d1a25e0448652e5a8a2d6bc2795c6d2 100644 (file)
@@ -609,12 +609,8 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,
     *
     * For SSO pipelines, we use a fixed VUE map layout based on variable
     * locations, so we can rely on rendezvous-by-location making this work.
-    *
-    * However, we need to ignore VARYING_SLOT_PRIMITIVE_ID, as it's not
-    * written by previous stages and shows up via payload magic.
     */
-   GLbitfield64 inputs_read =
-      shader->info->inputs_read & ~VARYING_BIT_PRIMITIVE_ID;
+   GLbitfield64 inputs_read = shader->info->inputs_read;
    brw_compute_vue_map(compiler->devinfo,
                        &c.input_vue_map, inputs_read,
                        shader->info->separate_shader);
@@ -626,8 +622,7 @@ 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) ||
-      (shader->info->system_values_read & (1 << SYSTEM_VALUE_PRIMITIVE_ID));
+      (shader->info->system_values_read & (1 << SYSTEM_VALUE_PRIMITIVE_ID)) != 0;
 
    prog_data->invocations = shader->info->gs.invocations;
 
index c6a6b5e151695963f36c740d389f49f06e8ed3a4..da2559c933023731c7b137dec270f391a396e5d2 100644 (file)
@@ -461,10 +461,7 @@ brw_compile_tcs(const struct brw_compiler *compiler,
    nir->info->patch_outputs_written = key->patch_outputs_written;
 
    struct brw_vue_map input_vue_map;
-   brw_compute_vue_map(devinfo, &input_vue_map,
-                       nir->info->inputs_read & ~VARYING_BIT_PRIMITIVE_ID,
-                       true);
-
+   brw_compute_vue_map(devinfo, &input_vue_map, nir->info->inputs_read, true);
    brw_compute_tess_vue_map(&vue_prog_data->vue_map,
                             nir->info->outputs_written,
                             nir->info->patch_outputs_written);