[Mesa-dev] [PATCH 06/11] glsl: add SYSTEM_VALUE_VERTEX_CNT
Ilia Mirkin
imirkin at alum.mit.edu
Wed Sep 16 16:34:40 PDT 2015
On Wed, Sep 16, 2015 at 7:30 PM, Rob Clark <robdclark at gmail.com> wrote:
> On Sun, Sep 13, 2015 at 11:51 AM, Rob Clark <robdclark at gmail.com> wrote:
>> From: Rob Clark <robclark at freedesktop.org>
>>
>> Used internally in freedreno/ir3 to calc stream-out position. Seems
>> like a generic enough way to implement stream-out (using str instrs),
>> plus it avoids compiler warnings by sneaking in a non-enum value in
>> switch statements.
>>
>> Signed-off-by: Rob Clark <robclark at freedesktop.org>
>
> Anyone got any strong opinions about this? At least a Meh'd-by? I'd
> like to push the freedreno/ir3 conversion to
> varying_slot_/frag_result_/etc, but need a way to handle my internal
> vtxcnt sysval, but don't want to step on any toes..
>
> I could alternatively do something like SYSTEM_VALUE_DRIVERn which
> gets re-#defined in freedreno/ir3?
It's definitely a bit weird to define these driver-specific things
that generic things know nothing about. I think it made a lot more
sense when it was completely driver-private with a TGSI semantic. Any
reason you can't just do that here? Start defining private ones
starting at SYSTEM_VALUE_MAX?
>
> BR,
> -R
>
>> ---
>> src/glsl/shader_enums.h | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/src/glsl/shader_enums.h b/src/glsl/shader_enums.h
>> index d054b87..fb4bcd0 100644
>> --- a/src/glsl/shader_enums.h
>> +++ b/src/glsl/shader_enums.h
>> @@ -402,6 +402,12 @@ typedef enum
>> SYSTEM_VALUE_TESS_LEVEL_INNER, /**< TES input */
>> /*@}*/
>>
>> + /**
>> + * Driver internal vertex-count, used (for example) for drivers to
>> + * calculate stride for stream-out outputs. Not externally visible.
>> + */
>> + SYSTEM_VALUE_VERTEX_CNT,
>> +
>> SYSTEM_VALUE_MAX /**< Number of values */
>> } gl_system_value;
>>
>> --
>> 2.4.3
>>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list