[Mesa-dev] [PATCH 6/6] i965: update gl_PrimitiveIDIn to be a system variable
Jason Ekstrand
jason at jlekstrand.net
Fri Nov 11 06:48:39 UTC 2016
On Thu, Nov 10, 2016 at 10:43 PM, Jason Ekstrand <jason at jlekstrand.net>
wrote:
> 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.
>
Ken reviewed my patch on IRC and told me to just push it. It should be a
trivial rebase and then you won't have to squash.
--Jason
>
> 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.
> --Jason
>
> On Wed, Oct 26, 2016 at 7:00 PM, Timothy Arceri <
> timothy.arceri at collabora.com> wrote:
>
>> To be squashed with previous patch
>> ---
>> src/mesa/drivers/dri/i965/brw_shader.cpp | 3 +--
>> src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp | 8 ++------
>> src/mesa/drivers/dri/i965/brw_vec4_tcs.cpp | 5 +----
>> 3 files changed, 4 insertions(+), 12 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp
>> b/src/mesa/drivers/dri/i965/brw_shader.cpp
>> index cd893b1..61bc868 100644
>> --- a/src/mesa/drivers/dri/i965/brw_shader.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
>> @@ -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);
>> 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 10be41b..892f9df 100644
>> --- a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
>> @@ -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,7 +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) != 0;
>> + (shader->info->system_values_read & 1 <<
>> SYSTEM_VALUE_PRIMITIVE_ID) != 0;
>>
>> prog_data->invocations = shader->info->gs.invocations;
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_tcs.cpp
>> b/src/mesa/drivers/dri/i965/brw_vec4_tcs.cpp
>> index 124632c..55afe36 100644
>> --- a/src/mesa/drivers/dri/i965/brw_vec4_tcs.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_vec4_tcs.cpp
>> @@ -460,10 +460,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);
>> --
>> 2.7.4
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161110/cc4d400d/attachment.html>
More information about the mesa-dev
mailing list