[Mesa-dev] [PATCH 4/5] util/indices: implement provoking vertex conversion for adjacency primitives

Roland Scheidegger sroland at vmware.com
Thu May 26 15:45:35 UTC 2016


Am 26.05.2016 um 17:39 schrieb Brian Paul:
> On 05/26/2016 09:35 AM, Roland Scheidegger wrote:
>> Am 26.05.2016 um 16:06 schrieb Brian Paul:
>>> Tested with new piglit gl-3.2-adj-prims test.
>>> ---
>>>   src/gallium/auxiliary/indices/u_indices.c      | 52 ++++++++++++++++
>>>   src/gallium/auxiliary/indices/u_indices_gen.py | 83
>>> +++++++++++++++++++++++++-
>>>   src/gallium/auxiliary/indices/u_indices_priv.h |  2 +-
>>>   3 files changed, 134 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/src/gallium/auxiliary/indices/u_indices.c
>>> b/src/gallium/auxiliary/indices/u_indices.c
>>> index 436f8f0..2b2d10c 100644
>>> --- a/src/gallium/auxiliary/indices/u_indices.c
>>> +++ b/src/gallium/auxiliary/indices/u_indices.c
>>> @@ -55,6 +55,8 @@ static void translate_memcpy_uint( const void *in,
>>>    * - Translate from first provoking vertex to last provoking vertex
>>> and
>>>    *   vice versa.
>>>    *
>>> + * Note that this function is used for indexed primitives.
>>> + *
>>>    * \param hw_mask  mask of (1 << PIPE_PRIM_x) flags indicating
>>> which types
>>>    *                 of primitives are supported by the hardware.
>>>    * \param prim  incoming PIPE_PRIM_x
>>> @@ -172,6 +174,30 @@ u_index_translator(unsigned hw_mask,
>>>            *out_nr = (nr - 2) * 3;
>>>            break;
>>>
>>> +      case PIPE_PRIM_LINES_ADJACENCY:
>>> +         *out_translate =
>>> translate[in_idx][out_idx][in_pv][out_pv][prim_restart][prim];
>> Can't you get that line out of the switch? (Not that this is really
>> new...)
> 
> I didn't even notice that.  I'll do that in a later patch.
> 

Actually I guess the default case was meant to have a different line,
like it does in u_index_generator (hardwiring prim), making this
slightly less silly. (But could still keep the line out of the switch,
noone cares if the error case has another assignment...)

Roland



More information about the mesa-dev mailing list