glsl: relax precision matching on unused uniforms ES
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

0886be09 ("glsl: Allow precision mismatch on dead data with GLSL ES 1.00")
allowed precision mismatches on uniforms, however if you lower precision on
16-bit consts, then this error triggers instead.

So here we relax the type matching and just make sure we match int vs
float.

Fixes: 0886be09 ("glsl: Allow precision mismatch on dead data with GLSL ES 1.00")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5337
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40107>
This commit is contained in:
Timothy Arceri 2026-02-26 10:56:20 +11:00 committed by Marge Bot
parent 78e323c755
commit 73bc604128
10 changed files with 21 additions and 17 deletions

View file

@ -401,7 +401,6 @@ spec@egl 1.4@eglterminate then unbind context,Fail
spec@egl_khr_surfaceless_context@viewport,Fail
spec@egl_mesa_configless_context@basic,Fail
spec@ext_external_objects@vk-ping-pong-single-sem,Crash
spec@glsl-es-1.00@linker@glsl-mismatched-uniform-precision-unused,Fail
spec@glsl-es-3.00@execution@built-in-functions@fs-packhalf2x16,Fail
spec@glsl-es-3.00@execution@built-in-functions@vs-packhalf2x16,Fail
spec@khr_texture_compression_astc@miptree-gles srgb-fp,Fail

View file

@ -71,5 +71,4 @@ program@run kernel with max work item sizes,Fail
# uprev Piglit in Mesa
spec@ext_external_objects@vk-semaphores,Crash
spec@ext_external_objects@vk-semaphores-2,Crash
spec@glsl-es-1.00@linker@glsl-mismatched-uniform-precision-unused,Fail

View file

@ -121,7 +121,6 @@ spec@ext_texture_srgb@texwrap formats-s3tc bordercolor-swizzled@GL_COMPRESSED_SR
spec@ext_texture_srgb@texwrap formats-s3tc bordercolor-swizzled@GL_COMPRESSED_SRGB_S3TC_DXT1_EXT- swizzled- border color only,Fail
spec@glsl-1.50@execution@geometry@tri-strip-ordering-with-prim-restart gl_triangle_strip_adjacency ffs,Fail
spec@glsl-1.50@execution@geometry@tri-strip-ordering-with-prim-restart gl_triangle_strip_adjacency other,Fail
spec@glsl-es-1.00@linker@glsl-mismatched-uniform-precision-unused,Fail
spec@glsl-es-3.00@execution@built-in-functions@fs-packhalf2x16,Fail
spec@glsl-es-3.00@execution@built-in-functions@vs-packhalf2x16,Fail
spec@khr_texture_compression_astc@miptree-gl srgb-fp,Fail

View file

@ -14,7 +14,6 @@ spec@egl_khr_surfaceless_context@viewport,Fail
spec@ext_external_objects@vk-image-display,Crash
spec@ext_external_objects@vk-semaphores,Crash
spec@ext_external_objects@vk-semaphores-2,Crash
spec@glsl-es-1.00@linker@glsl-mismatched-uniform-precision-unused,Fail
spec@glsl-es-3.00@execution@built-in-functions@fs-packhalf2x16,Fail
spec@glsl-es-3.00@execution@built-in-functions@vs-packhalf2x16,Fail
spec@khr_texture_compression_astc@miptree-gles srgb-fp,Fail

View file

@ -1684,12 +1684,27 @@ cross_validate_globals(void *mem_ctx, const struct gl_constants *consts,
existing->data.mode == nir_var_mem_ssbo &&
existing->data.from_ssbo_unsized_array &&
glsl_get_gl_type(var->type) == glsl_get_gl_type(existing->type))) {
linker_error(prog, "%s `%s' declared as type "
"`%s' and type `%s'\n",
gl_nir_mode_string(var),
var->name, glsl_get_type_name(var->type),
glsl_get_type_name(existing->type));
return;
/* Relax precision matching on unused uniforms for early ES shaders */
if (prog->IsES && !var->interface_type &&
!(existing->data.used && var->data.used) &&
glsl_base_type_is_integer(glsl_get_gl_type(var->type)) == glsl_base_type_is_integer(glsl_get_gl_type(existing->type)) &&
glsl_base_type_is_float(glsl_get_gl_type(var->type)) == glsl_base_type_is_float(glsl_get_gl_type(existing->type)) &&
prog->GLSL_Version < 300) {
linker_warning(prog, "%s `%s' declared as type "
"`%s' and type `%s'\n",
gl_nir_mode_string(var),
var->name, glsl_get_type_name(var->type),
glsl_get_type_name(existing->type));
} else {
linker_error(prog, "%s `%s' declared as type "
"`%s' and type `%s'\n",
gl_nir_mode_string(var),
var->name, glsl_get_type_name(var->type),
glsl_get_type_name(existing->type));
return;
}
}
}
}

View file

@ -24,8 +24,6 @@ spec@khr_texture_compression_astc@sliced-3d-miptree-gles srgb-fp@sRGB decode ful
spec@!opengl 1.0@rasterpos,Fail
spec@!opengl 1.0@rasterpos@glsl_vs_gs_linked,Fail
spec@!opengl 1.0@rasterpos@glsl_vs_tes_linked,Fail
# This is caused by lowering mediump before linking:
spec@glsl-es-1.00@linker@glsl-mismatched-uniform-precision-unused,Fail
# See Khronos issue 5587: the test expects one-dimensional (array) texture to work while
# it's explicitely marked as non-supported by EXT_sparse_texture2.

1 # LLVM 20-dev (da439d3af47b)
24 spec@!opengl 1.0@rasterpos@glsl_vs_gs_linked,Fail
25 spec@!opengl 1.0@rasterpos@glsl_vs_tes_linked,Fail
26 # This is caused by lowering mediump before linking: # See Khronos issue 5587: the test expects one-dimensional (array) texture to work while
spec@glsl-es-1.00@linker@glsl-mismatched-uniform-precision-unused,Fail
# See Khronos issue 5587: the test expects one-dimensional (array) texture to work while
27 # it's explicitely marked as non-supported by EXT_sparse_texture2.
28 KHR-GL46.sparse_texture2_tests.StandardPageSizesTestCase_texture_1d_array_r11f_g11f_b10f,Fail
29 KHR-GL46.sparse_texture2_tests.StandardPageSizesTestCase_texture_1d_array_r16,Fail

View file

@ -22,8 +22,6 @@ spec@oes_shader_io_blocks@compiler@layout-location-aliasing.vert,Fail
spec@!opengl 1.0@rasterpos,Fail
spec@!opengl 1.0@rasterpos@glsl_vs_gs_linked,Fail
spec@!opengl 1.0@rasterpos@glsl_vs_tes_linked,Fail
# This is caused by lowering mediump before linking:
spec@glsl-es-1.00@linker@glsl-mismatched-uniform-precision-unused,Fail
# glcts failures
## Test issue - https://github.com/KhronosGroup/VK-GL-CTS/issues/251

1 # piglit failures
22 spec@!opengl 1.0@rasterpos,Fail
23 spec@!opengl 1.0@rasterpos@glsl_vs_gs_linked,Fail
24 spec@!opengl 1.0@rasterpos@glsl_vs_tes_linked,Fail
# This is caused by lowering mediump before linking:
spec@glsl-es-1.00@linker@glsl-mismatched-uniform-precision-unused,Fail
25 # glcts failures
26 ## Test issue - https://github.com/KhronosGroup/VK-GL-CTS/issues/251
27 ## Fail because GFX10+ removed MS texture support (see si_get_sparse_texture_virtual_page_size)

View file

@ -124,7 +124,6 @@ spec@ext_texture_srgb@texwrap formats-s3tc bordercolor-swizzled@GL_COMPRESSED_SR
spec@ext_texture_srgb@texwrap formats-s3tc bordercolor-swizzled@GL_COMPRESSED_SRGB_S3TC_DXT1_EXT- swizzled- border color only,Fail
spec@glsl-1.50@execution@geometry@tri-strip-ordering-with-prim-restart gl_triangle_strip_adjacency ffs,Fail
spec@glsl-1.50@execution@geometry@tri-strip-ordering-with-prim-restart gl_triangle_strip_adjacency other,Fail
spec@glsl-es-1.00@linker@glsl-mismatched-uniform-precision-unused,Fail
spec@glsl-es-3.00@execution@built-in-functions@fs-packhalf2x16,Fail
spec@glsl-es-3.00@execution@built-in-functions@vs-packhalf2x16,Fail
spec@khr_texture_compression_astc@miptree-gl srgb-fp,Fail

1 # piglit failures
124 spec@ext_texture_srgb@texwrap formats-s3tc bordercolor-swizzled@GL_COMPRESSED_SRGB_S3TC_DXT1_EXT- swizzled- border color only,Fail
125 spec@glsl-1.50@execution@geometry@tri-strip-ordering-with-prim-restart gl_triangle_strip_adjacency ffs,Fail
126 spec@glsl-1.50@execution@geometry@tri-strip-ordering-with-prim-restart gl_triangle_strip_adjacency other,Fail
spec@glsl-es-1.00@linker@glsl-mismatched-uniform-precision-unused,Fail
127 spec@glsl-es-3.00@execution@built-in-functions@fs-packhalf2x16,Fail
128 spec@glsl-es-3.00@execution@built-in-functions@vs-packhalf2x16,Fail
129 spec@khr_texture_compression_astc@miptree-gl srgb-fp,Fail

View file

@ -35,7 +35,6 @@ spec@glsl-4.00@compiler@built-in-functions@texturequerylod-sampler2darrayshadow.
spec@glsl-4.00@compiler@built-in-functions@texturequerylod-sampler2dshadow.frag,Crash
spec@glsl-4.00@compiler@built-in-functions@texturequerylod-samplercubearrayshadow.frag,Crash
spec@glsl-4.00@compiler@built-in-functions@texturequerylod-samplercubeshadow.frag,Crash
spec@glsl-es-1.00@linker@glsl-mismatched-uniform-precision-unused,Fail
spec@glsl-1.50@execution@geometry@tri-strip-ordering-with-prim-restart gl_triangle_strip_adjacency ffs,Fail
spec@glsl-1.50@execution@geometry@tri-strip-ordering-with-prim-restart gl_triangle_strip_adjacency other,Fail
spec@glsl-es-3.00@execution@built-in-functions@fs-packhalf2x16,Fail

1 # piglit failures
35 spec@glsl-4.00@compiler@built-in-functions@texturequerylod-sampler2dshadow.frag,Crash
36 spec@glsl-4.00@compiler@built-in-functions@texturequerylod-samplercubearrayshadow.frag,Crash
37 spec@glsl-4.00@compiler@built-in-functions@texturequerylod-samplercubeshadow.frag,Crash
spec@glsl-es-1.00@linker@glsl-mismatched-uniform-precision-unused,Fail
38 spec@glsl-1.50@execution@geometry@tri-strip-ordering-with-prim-restart gl_triangle_strip_adjacency ffs,Fail
39 spec@glsl-1.50@execution@geometry@tri-strip-ordering-with-prim-restart gl_triangle_strip_adjacency other,Fail
40 spec@glsl-es-3.00@execution@built-in-functions@fs-packhalf2x16,Fail

View file

@ -257,7 +257,6 @@ spec@glsl-1.30@execution@tex-miplevel-selection textureprojgradoffset 2d,Fail
spec@glsl-1.30@execution@tex-miplevel-selection textureprojgradoffset 2d_projvec4,Fail
spec@glsl-1.30@execution@tex-miplevel-selection textureprojgradoffset 2dshadow,Fail
spec@glsl-1.30@execution@tex-miplevel-selection textureprojgradoffset 3d,Fail
spec@glsl-es-1.00@linker@glsl-mismatched-uniform-precision-unused,Fail
spec@intel_blackhole_render@intel_blackhole-draw_gles2,Crash
spec@intel_blackhole_render@intel_blackhole-draw_gles3,Crash
spec@khr_texture_compression_astc@miptree-gles srgb-fp,Fail