[Mesa-dev] [PATCH 1/4] gallium: Add support for multiple viewports

Brian Paul brianp at vmware.com
Fri May 24 08:18:22 PDT 2013


On 05/23/2013 03:02 PM, Roland Scheidegger wrote:
> Am 23.05.2013 22:33, schrieb Zack Rusin:
>> Gallium supported only a single viewport/scissor combination. This
>> commit changes the interface to allow us to add support for multiple
>> viewports/scissors.
>>
>> Signed-off-by: Zack Rusin <zackr at vmware.com>
>> ---
>> diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
>> index d1130bc..eaaa043 100644
>> --- a/src/gallium/include/pipe/p_context.h
>> +++ b/src/gallium/include/pipe/p_context.h
>> @@ -211,11 +211,13 @@ struct pipe_context {
>>      void (*set_polygon_stipple)( struct pipe_context *,
>>   				const struct pipe_poly_stipple * );
>>
>> -   void (*set_scissor_state)( struct pipe_context *,
>> -                              const struct pipe_scissor_state * );
>> +   void (*set_scissor_states)( struct pipe_context *,
>> +                               unsigned num_scissors,
>> +                               const struct pipe_scissor_state * );
>>
>> -   void (*set_viewport_state)( struct pipe_context *,
>> -                               const struct pipe_viewport_state * );
>> +   void (*set_viewport_states)( struct pipe_context *,
>> +                                unsigned num_viewports,
>> +                                const struct pipe_viewport_state *);
>>
>>      void (*set_fragment_sampler_views)(struct pipe_context *,
>>                                         unsigned num_views,
>> diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
>> index bb86968..00f0a37 100644
>> --- a/src/gallium/include/pipe/p_defines.h
>> +++ b/src/gallium/include/pipe/p_defines.h
>> @@ -507,7 +507,8 @@ enum pipe_cap {
>>      PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER = 80,
>>      PIPE_CAP_QUERY_PIPELINE_STATISTICS = 81,
>>      PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK = 82,
>> -   PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE = 83
>> +   PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE = 83,
>> +   PIPE_CAP_MULTIPLE_VIEWPORTS = 84
> Would it be better if this were PIPE_CAP_MAX_VIEWPORTS instead? Though I
> guess there's no real need right now to support anything but 16 (as
> that's needed by d3d10/11, and is the minimum supported value for GL,
> though GL would allow for more), so I don't have a strong opinion on that.

I second this suggestion.

-Brian




More information about the mesa-dev mailing list