[Mesa-dev] [PATCH v4 01/38] mesa/st: translate SO info in glsl_to_nir() case

Timothy Arceri tarceri at itsqueeze.com
Thu Jan 18 04:38:18 UTC 2018


On 11/01/18 12:16, Marek Olšák wrote:
> On Wed, Jan 10, 2018 at 3:54 AM, Karol Herbst <kherbst at redhat.com> wrote:
>> From: Rob Clark <robdclark at gmail.com>
>>
>> This was handled for VS, but not for GS.
>>
>> Fixes for gallium drivers using nir:
>> spec at arb_gpu_shader5@arb_gpu_shader5-xfb-streams-without-invocations
>> spec at arb_gpu_shader5@arb_gpu_shader5-xfb-streams*
>> spec at arb_transform_feedback3@arb_transform_feedback3-ext_interleaved_two_bufs_gs*
>> spec at ext_transform_feedback@geometry-shaders-basic
>> spec at ext_transform_feedback@* use_gs
>> spec at glsl-1.50@execution at geometry@primitive-id*
>> spec at glsl-1.50@execution at geometry@tri-strip-ordering-with-prim-restart gl_triangle_strip *
>> spec at glsl-1.50@transform-feedback-builtins
>> spec at glsl-1.50@transform-feedback-type-and-size
>>
>> v2: we don't need this for TCP
>>
>> Signed-off-by: Rob Clark <robdclark at gmail.com>
>> Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
>> Tested-by: Karol Herbst <kherbst at redhat.com>
>> ---
>>   src/mesa/state_tracker/st_program.c | 57 ++++++++++++++++++++++++++++++++++---
>>   1 file changed, 53 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
>> index 05e6042f42..2a1a695948 100644
>> --- a/src/mesa/state_tracker/st_program.c
>> +++ b/src/mesa/state_tracker/st_program.c
>> @@ -1421,6 +1421,50 @@ st_translate_program_common(struct st_context *st,
>>      }
>>   }
>>
>> +/**
>> + * Update stream-output info for GS/TCS/TES.  Normally this is done in
>> + * st_translate_program_common() but that is not called for glsl_to_nir
>> + * case.
>> + */
>> +static void
>> +st_translate_program_stream_output(struct gl_program *prog,
>> +                                   struct pipe_stream_output_info *stream_output)
>> +{
>> +   if (!prog->sh.LinkedTransformFeedback)
>> +      return;
>> +
>> +   ubyte outputMapping[VARYING_SLOT_TESS_MAX];
>> +   GLuint attr;
>> +   uint num_outputs = 0;
>> +
>> +   memset(outputMapping, 0, sizeof(outputMapping));
>> +
>> +   /*
>> +    * Determine number of outputs, the (default) output register
>> +    * mapping and the semantic information for each output.
>> +    */
>> +   for (attr = 0; attr < VARYING_SLOT_MAX; attr++) {
>> +      if (prog->info.outputs_written & BITFIELD64_BIT(attr)) {
>> +         GLuint slot = num_outputs++;
>> +
>> +         outputMapping[attr] = slot;
>> +      }
>> +   }
>> +
>> +   /* Also add patch outputs. */
>> +   for (attr = 0; attr < 32; attr++) {
>> +      if (prog->info.patch_outputs_written & (1u << attr)) {
>> +         GLuint slot = num_outputs++;
>> +         GLuint patch_attr = VARYING_SLOT_PATCH0 + attr;
>> +
>> +         outputMapping[patch_attr] = slot;
>> +      }
>> +   }
> 
> There are no patch outputs in shader stages supporting transform feedback.

I've removed this loop over patch outputs and pushed this patch. Thanks 
guys.

> 
> Marek
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 


More information about the mesa-dev mailing list