freedreno: Fix YUV sampler regression.

We have to keep sampler uniforms around for later YUV lowering, and we
only need to remove uniforms that take up storage space.  Code comes from
radeonsi.

Closes: #4644.
Fixes: de17b4aab5 ("freedreno: Remove uniform variables after finalizing NIR.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10246>
This commit is contained in:
Eric Anholt 2021-04-14 15:09:18 -07:00 committed by Marge Bot
parent 1bccefb3fc
commit 7d234da6ee
3 changed files with 10 additions and 10 deletions

View File

@ -337,7 +337,17 @@ ir3_finalize_nir(struct ir3_compiler *compiler, nir_shader *s)
debug_printf("----------------------\n");
}
/* st_program.c's parameter list optimization requires that future nir
* variants don't reallocate the uniform storage, so we have to remove
* uniforms that occupy storage. But we don't want to remove samplers,
* because they're needed for YUV variant lowering.
*/
nir_foreach_uniform_variable_safe(var, s) {
if (var->data.mode == nir_var_uniform &&
(glsl_type_get_image_count(var->type) ||
glsl_type_get_sampler_count(var->type)))
continue;
exec_node_remove(&var->node);
}
nir_validate_shader(s, "after uniform var removal");

View File

@ -225,15 +225,12 @@ spec@ext_framebuffer_object@getteximage-formats init-by-clear-and-render,Fail
spec@ext_framebuffer_object@getteximage-formats init-by-rendering,Fail
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-export,Fail
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_ayuv,Fail
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_nv12,Crash
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_p010,Fail
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_p012,Fail
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_p016,Fail
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_uyvy,Fail
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_xyuv,Fail
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_yuv420,Crash
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_yuyv,Fail
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_yvu420,Crash
spec@ext_packed_depth_stencil@fbo-clear-formats,Fail
spec@ext_packed_depth_stencil@fbo-clear-formats stencil,Fail
spec@ext_packed_depth_stencil@fbo-depth-gl_depth24_stencil8-blit,Fail

View File

@ -273,14 +273,7 @@ spec@ext_framebuffer_object@getteximage-formats init-by-clear-and-render,Fail
spec@ext_framebuffer_object@getteximage-formats init-by-rendering,Fail
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-export,Fail
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_ayuv,Fail
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_p010,Crash
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_p012,Crash
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_p016,Crash
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_uyvy,Crash
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_xyuv,Fail
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_yuv420,Crash
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_yuyv,Crash
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_yvu420,Crash
spec@ext_packed_depth_stencil@texwrap formats bordercolor,Fail
spec@ext_packed_depth_stencil@texwrap formats bordercolor-swizzled,Fail
spec@ext_packed_float@query-rgba-signed-components,Fail