[Mesa-dev] [PATCH 16/20] program_resource: add subroutine support (v2)

Ilia Mirkin imirkin at alum.mit.edu
Mon Jul 20 22:47:57 PDT 2015


On Tue, Jul 21, 2015 at 1:19 AM, Dave Airlie <airlied at gmail.com> wrote:
> @@ -366,18 +411,25 @@ _mesa_GetProgramResourceLocation(GLuint program, GLenum programInterface,
>     case GL_PROGRAM_OUTPUT:
>        break;
>
> +   case GL_VERTEX_SUBROUTINE_UNIFORM:
> +   case GL_FRAGMENT_SUBROUTINE_UNIFORM:
> +      if (ctx->Extensions.ARB_shader_subroutine)
> +         break;
> +
> +   case GL_GEOMETRY_SUBROUTINE_UNIFORM:
> +      if (_mesa_has_geometry_shaders(ctx) && ctx->Extensions.ARB_shader_subroutine)
> +         break;
> +   case GL_COMPUTE_SUBROUTINE_UNIFORM:
> +      if (_mesa_has_compute_shaders(ctx) && ctx->Extensions.ARB_shader_subroutine)
> +         break;
> +
>     /* For reference valid cases requiring additional extension support:
> -    * GL_ARB_shader_subroutine
>      * GL_ARB_tessellation_shader
> -    * GL_ARB_compute_shader
>      */
> -   case GL_VERTEX_SUBROUTINE_UNIFORM:
>     case GL_TESS_CONTROL_SUBROUTINE_UNIFORM:
>     case GL_TESS_EVALUATION_SUBROUTINE_UNIFORM:
> -   case GL_GEOMETRY_SUBROUTINE_UNIFORM:
> -   case GL_FRAGMENT_SUBROUTINE_UNIFORM:
> -   case GL_COMPUTE_SUBROUTINE_UNIFORM:
> -
> +      if (ctx->Extensions.ARB_tessellation_shader && ctx->Extensions.ARB_shader_subroutine)
> +         break;

So if you don't have compute shaders but you do have tessellation
shaders, then GL_COMPUTE_SUBROUTINE_UNIFORM is OK?

>     default:
>        _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramResourceLocation(%s %s)",
>                    _mesa_enum_to_string(programInterface), name);


More information about the mesa-dev mailing list