Mesa (staging/20.1): glsl: reject size1x8 for image variable with floating-point data types
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jul 10 10:35:32 UTC 2020
Module: Mesa
Branch: staging/20.1
Commit: 1ad6d99778eaa477df1922edb69ecd1b3c142e89
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1ad6d99778eaa477df1922edb69ecd1b3c142e89
Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date: Fri Jun 19 18:29:19 2020 +0200
glsl: reject size1x8 for image variable with floating-point data types
Fixes: 8d07d66180b ("glsl,nir: Switch the enum representing shader image formats to PIPE_FORMAT.")
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5688>
(cherry picked from commit 0c8873d85db371dea9ec34fefc6fec531aa404b9)
---
.pick_status.json | 2 +-
src/compiler/glsl/ast_to_hir.cpp | 12 +++++++-----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index 636ca66f137..ae84460e908 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -373,7 +373,7 @@
"description": "glsl: reject size1x8 for image variable with floating-point data types",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "8d07d66180b1523d7e70681ca142955f896ebda9"
},
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 1201c11b778..5c1fae4d277 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -4981,12 +4981,14 @@ ast_declarator_list::hir(exec_list *instructions,
if (strncmp(this->type->specifier->type_name, "image", strlen("image")) == 0) {
switch (this->type->qualifier.image_format) {
case PIPE_FORMAT_R8_SINT:
- /* No valid qualifier in this case, driver will need to look at
- * the underlying image's format (just like no qualifier being
- * present).
+ /* The GL_EXT_shader_image_load_store spec says:
+ * A layout of "size1x8" is illegal for image variables associated
+ * with floating-point data types.
*/
- this->type->qualifier.image_format = PIPE_FORMAT_NONE;
- break;
+ _mesa_glsl_error(& loc, state,
+ "size1x8 is illegal for image variables "
+ "with floating-point data types.");
+ return NULL;
case PIPE_FORMAT_R16_SINT:
this->type->qualifier.image_format = PIPE_FORMAT_R16_FLOAT;
break;
More information about the mesa-commit
mailing list