[Mesa-dev] RFC: Increase gallium PIPE_MAX_SHADER_INPUTS/OUTPUTS
Corbin Simpson
mostawesomedude at gmail.com
Thu Jul 8 11:51:16 PDT 2010
On Thu, Jul 8, 2010 at 8:50 AM, Zack Rusin <zackr at vmware.com> wrote:
> On Thursday 08 July 2010 11:40:56 Keith Whitwell wrote:
>> On Thu, 2010-07-08 at 08:36 -0700, Brian Paul wrote:
>> > PIPE_MAX_SHADER_INPUTS/OUTPUTS are currently set to 16 in p_state.h
>> >
>> > That's actually not enough to accomodate OpenGL's needs. For example,
>> > a Mesa vertex shader has these inputs:
>> >
>> > typedef enum
>> > {
>> >
>> > VERT_ATTRIB_POS = 0,
>> > VERT_ATTRIB_WEIGHT = 1,
>> > VERT_ATTRIB_NORMAL = 2,
>> > VERT_ATTRIB_COLOR0 = 3,
>> > VERT_ATTRIB_COLOR1 = 4,
>> > VERT_ATTRIB_FOG = 5,
>> > VERT_ATTRIB_COLOR_INDEX = 6,
>> > VERT_ATTRIB_POINT_SIZE = 6, /*alias*/
>> > VERT_ATTRIB_EDGEFLAG = 7,
>> > VERT_ATTRIB_TEX0 = 8,
>> > VERT_ATTRIB_TEX1 = 9,
>> > VERT_ATTRIB_TEX2 = 10,
>> > VERT_ATTRIB_TEX3 = 11,
>> > VERT_ATTRIB_TEX4 = 12,
>> > VERT_ATTRIB_TEX5 = 13,
>> > VERT_ATTRIB_TEX6 = 14,
>> > VERT_ATTRIB_TEX7 = 15,
>> > VERT_ATTRIB_GENERIC0 = 16,
>> > VERT_ATTRIB_GENERIC1 = 17,
>> > VERT_ATTRIB_GENERIC2 = 18,
>> > VERT_ATTRIB_GENERIC3 = 19,
>> > VERT_ATTRIB_GENERIC4 = 20,
>> > VERT_ATTRIB_GENERIC5 = 21,
>> > VERT_ATTRIB_GENERIC6 = 22,
>> > VERT_ATTRIB_GENERIC7 = 23,
>> > VERT_ATTRIB_GENERIC8 = 24,
>> > VERT_ATTRIB_GENERIC9 = 25,
>> > VERT_ATTRIB_GENERIC10 = 26,
>> > VERT_ATTRIB_GENERIC11 = 27,
>> > VERT_ATTRIB_GENERIC12 = 28,
>> > VERT_ATTRIB_GENERIC13 = 29,
>> > VERT_ATTRIB_GENERIC14 = 30,
>> > VERT_ATTRIB_GENERIC15 = 31,
>> > VERT_ATTRIB_MAX = 32
>> >
>> > } gl_vert_attrib;
>> >
>> > With PIPE_MAX_SHADER_INPUTS=16 there's potentially little or no space
>> > left for any user-defined inputs if most of the conventional
>> > attributes are used.
>> >
>> > I propose bumping these limits to 32 each. Any concerns?
>>
>> Sounds good. There's also the confusingly almost related value
>> "PIPE_MAX_ATTRIBS" which is already 32.
>
> I think the first actually responds to GL_MAX_VARYING_FLOATS * 4, the other to
> GL_MAX_VERTEX_ATTRIBS. They're both actually safe minimums, GL says that the
> first one needs to be at least 8, the other needs to be at least 16. So our
> values just double the minimum. We probably should have hardware queries for
> both. Also increasing PIPE_MAX_SHADER_INPUTS to 32 sounds good.
Sounds fine. We probably do need caps.
~ C.
--
When the facts change, I change my mind. What do you do, sir? ~ Keynes
Corbin Simpson
<MostAwesomeDude at gmail.com>
More information about the mesa-dev
mailing list