[Mesa-dev] [PATCH] glsl: define some GLES3 constants in GLSL 4.1
Ilia Mirkin
imirkin at alum.mit.edu
Wed Jun 1 06:38:36 UTC 2016
On Wed, Jun 1, 2016 at 2:18 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> The GLSL 4.1 spec adds:
> gl_MaxVertexUniformVectors
> gl_MaxFragmentUniformVectors
> gl_MaxVaryingVectors
>
> This fixes:
> GL45-CTS.gtf31.GL3Tests.uniform_buffer_object.uniform_buffer_object_build_in_constants
>
> Cc: "12.0 11.2" <mesa-stable at lists.freedesktop.org>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
> src/compiler/glsl/builtin_variables.cpp | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp
> index d8b6f6e..b635847 100644
> --- a/src/compiler/glsl/builtin_variables.cpp
> +++ b/src/compiler/glsl/builtin_variables.cpp
> @@ -622,7 +622,7 @@ builtin_variable_generator::generate_constants()
> /* Max uniforms/varyings: GLSL ES counts these in units of vectors; desktop
> * GL counts them in units of "components" or "floats".
> */
> - if (state->es_shader) {
> + if (state->es_shader || state->is_version(410, 0)) {
This could be expressed as just
if (state->is_version(410, 100))
Your call. Either way,
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
> add_const("gl_MaxVertexUniformVectors",
> state->Const.MaxVertexUniformComponents / 4);
> add_const("gl_MaxFragmentUniformVectors",
> --
> 2.5.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list