glsl: skip conversion of half float back to float for GL queries
This is only needed for GLES where floats have been lowered to half floats internally. We don't do that in desktop GL and we need to skip it to return the correct enums for the AMD_gpu_shader_half_float extension. Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18540>
This commit is contained in:

committed by
Marge Bot

parent
66633dbbd0
commit
9dc651a13f
@@ -64,8 +64,11 @@ DECL_RESOURCE_FUNC(XFB, gl_transform_feedback_buffer);
|
||||
DECL_RESOURCE_FUNC(SUB, gl_subroutine_function);
|
||||
|
||||
static GLenum
|
||||
mediump_to_highp_type(GLenum type)
|
||||
mediump_to_highp_type(struct gl_shader_program *shProg, GLenum type)
|
||||
{
|
||||
if (!shProg->IsES)
|
||||
return type;
|
||||
|
||||
switch (type) {
|
||||
case GL_FLOAT16_NV:
|
||||
return GL_FLOAT;
|
||||
@@ -1466,16 +1469,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);
|
||||
*val = mediump_to_highp_type(shProg, *val);
|
||||
return 1;
|
||||
case GL_PROGRAM_INPUT:
|
||||
case GL_PROGRAM_OUTPUT:
|
||||
*val = RESOURCE_VAR(res)->type->gl_type;
|
||||
*val = mediump_to_highp_type(*val);
|
||||
*val = mediump_to_highp_type(shProg, *val);
|
||||
return 1;
|
||||
case GL_TRANSFORM_FEEDBACK_VARYING:
|
||||
*val = RESOURCE_XFV(res)->Type;
|
||||
*val = mediump_to_highp_type(*val);
|
||||
*val = mediump_to_highp_type(shProg, *val);
|
||||
return 1;
|
||||
default:
|
||||
goto invalid_operation;
|
||||
|
Reference in New Issue
Block a user