Module: Mesa Branch: master Commit: 43270e24b91ddd27f103328be365b37b1c02982e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=43270e24b91ddd27f103328be365b37b1c02982e
Author: Marek Olšák <[email protected]> Date: Sun Feb 14 07:21:31 2021 -0500 mesa: implement glGetActiveUniform for FP16 uniforms We must return the types before lowering to 16 bits. Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9050> --- src/mesa/main/shader_query.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp index bd782b22069..cb86fdd32c2 100644 --- a/src/mesa/main/shader_query.cpp +++ b/src/mesa/main/shader_query.cpp @@ -61,6 +61,41 @@ DECL_RESOURCE_FUNC(XFV, gl_transform_feedback_varying_info); DECL_RESOURCE_FUNC(XFB, gl_transform_feedback_buffer); DECL_RESOURCE_FUNC(SUB, gl_subroutine_function); +static GLenum +mediump_to_highp_type(GLenum type) +{ + switch (type) { + case GL_FLOAT16_NV: + return GL_FLOAT; + case GL_FLOAT16_VEC2_NV: + return GL_FLOAT_VEC2; + case GL_FLOAT16_VEC3_NV: + return GL_FLOAT_VEC3; + case GL_FLOAT16_VEC4_NV: + return GL_FLOAT_VEC4; + case GL_FLOAT16_MAT2_AMD: + return GL_FLOAT_MAT2; + case GL_FLOAT16_MAT3_AMD: + return GL_FLOAT_MAT3; + case GL_FLOAT16_MAT4_AMD: + return GL_FLOAT_MAT4; + case GL_FLOAT16_MAT2x3_AMD: + return GL_FLOAT_MAT2x3; + case GL_FLOAT16_MAT2x4_AMD: + return GL_FLOAT_MAT2x4; + case GL_FLOAT16_MAT3x2_AMD: + return GL_FLOAT_MAT3x2; + case GL_FLOAT16_MAT3x4_AMD: + return GL_FLOAT_MAT3x4; + case GL_FLOAT16_MAT4x2_AMD: + return GL_FLOAT_MAT4x2; + case GL_FLOAT16_MAT4x3_AMD: + return GL_FLOAT_MAT4x3; + default: + return type; + } +} + static void bind_attrib_location(struct gl_context *ctx, struct gl_shader_program *const shProg, GLuint index, @@ -1372,13 +1407,16 @@ _mesa_program_resource_prop(struct gl_shader_program *shProg, case GL_UNIFORM: case GL_BUFFER_VARIABLE: *val = RESOURCE_UNI(res)->type->gl_type; + *val = mediump_to_highp_type(*val); return 1; case GL_PROGRAM_INPUT: case GL_PROGRAM_OUTPUT: *val = RESOURCE_VAR(res)->type->gl_type; + *val = mediump_to_highp_type(*val); return 1; case GL_TRANSFORM_FEEDBACK_VARYING: *val = RESOURCE_XFV(res)->Type; + *val = mediump_to_highp_type(*val); return 1; default: goto invalid_operation; _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
