[Mesa-dev] [PATCH 11/17] mesa: Get GL_MAX_VARYING_FLOATS_ARB from VertexProgram.MaxOutputComponents

Ian Romanick idr at freedesktop.org
Wed Sep 11 16:28:30 PDT 2013


On 09/11/2013 04:05 PM, Paul Berry wrote:
> On 10 September 2013 12:10, Ian Romanick <idr at freedesktop.org
> <mailto:idr at freedesktop.org>> wrote:
> 
>     From: Ian Romanick <ian.d.romanick at intel.com
>     <mailto:ian.d.romanick at intel.com>>
> 
>     Signed-off-by: Ian Romanick <ian.d.romanick at intel.com
>     <mailto:ian.d.romanick at intel.com>>
>     ---
>      src/mesa/main/get.c              | 4 ----
>      src/mesa/main/get_hash_params.py | 2 +-
>      2 files changed, 1 insertion(+), 5 deletions(-)
> 
>     diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
>     index 34eb6be..ae45bf8 100644
>     --- a/src/mesa/main/get.c
>     +++ b/src/mesa/main/get.c
>     @@ -718,10 +718,6 @@ find_custom_value(struct gl_context *ctx, const
>     struct value_desc *d, union valu
>            ASSERT(v->value_int_n.n <= ARRAY_SIZE(v->value_int_n.ints));
>            break;
> 
>     -   case GL_MAX_VARYING_FLOATS_ARB:
>     -      v->value_int = ctx->Const.MaxVarying * 4;
>     -      break;
>     -
>         /* Various object names */
> 
>         case GL_TEXTURE_BINDING_1D:
>     diff --git a/src/mesa/main/get_hash_params.py
>     b/src/mesa/main/get_hash_params.py
>     index c0dbf45..3d47443 100644
>     --- a/src/mesa/main/get_hash_params.py
>     +++ b/src/mesa/main/get_hash_params.py
>     @@ -365,7 +365,7 @@ descriptor=[
> 
>      # GL_ARB_vertex_shader
>        [ "MAX_VERTEX_UNIFORM_COMPONENTS_ARB",
>     "CONTEXT_INT(Const.VertexProgram.MaxUniformComponents),
>     extra_ARB_vertex_shader" ],
>     -  [ "MAX_VARYING_FLOATS_ARB", "LOC_CUSTOM, TYPE_INT, 0,
>     extra_ARB_vertex_shader" ],
>     +  [ "MAX_VARYING_FLOATS_ARB",
>     "CONTEXT_INT(Const.VertexProgram.MaxOutputComponents),
>     extra_ARB_vertex_shader" ],
> 
>      # GL_EXT_framebuffer_blit
>      # NOTE: GL_DRAW_FRAMEBUFFER_BINDING_EXT == GL_FRAMEBUFFER_BINDING_EXT
>     --
>     1.8.1.4
> 
>     _______________________________________________
>     mesa-dev mailing list
>     mesa-dev at lists.freedesktop.org <mailto:mesa-dev at lists.freedesktop.org>
>     http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 
> Doesn't MAX_VARYING_FLOATS need to be MIN2(MAX_VERTEX_OUTPUT_COMPONENTS,
> MAX_FRAGMENT_INPUT_COMPONENTS)?  I can imagine an implementation where
> MAX_FRAGMENT_INPUT_COMPONENTS is the smaller constraint (in fact, ES3's
> minimum maximums constitute just such a case).

It's all so much more horrible than you think. :)

OpenGL 3.2 sets:

MAX_VARYING_COMPONENTS: 60
MAX_VERTEX_OUTPUT_COMPONENTS: 64
MAX_FRAGMENT_INPUT_COMPONENTS: 128

OpenGL ES 3.0 sets:

MAX_VARYING_COMPONENTS: 60
MAX_VARYING_VECTORS: 15
MAX_VERTEX_OUTPUT_VECTORS: 16
MAX_VERTEX_OUTPUT_COMPONENTS: 64
MAX_FRAGMENT_INPUT_VECTORS: 15
MAX_FRAGMENT_INPUT_COMPONENTS: 60

BUT the description of MAX_VARYING_COMPONENTS in GLES3 says:

    "Number of components for output variables."

So... OpenGL 3.2 makes no sense, and OpenGL ES 3.0 seems self
contradictory.  The core problem seems to be the way that each API (and
each driver) counts gl_Position and gl_FragCoord.  Some say it's
counted, some say it's not counted, and some say it might be counted.
Our existing infrastructure may not be sufficient to handle all
combinations of those cases.

In the end, I opted to use VertexProgram.MaxOutputComponents because
MAX_VARYING_FLOATS was added by GL_ARB_vertex_shader.

I guess I'm not sure what the "right" answer actually is now. :(


More information about the mesa-dev mailing list