aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_print.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2020-01-10 14:09:43 -0800
committerEric Anholt <[email protected]>2020-02-05 10:31:14 -0800
commit8d07d66180b1523d7e70681ca142955f896ebda9 (patch)
tree266be7d8ee1e804f87ab36698c8b4b90f422dece /src/compiler/nir/nir_print.c
parent5bea0cf77956d748ea929e12d12756692f04a33f (diff)
glsl,nir: Switch the enum representing shader image formats to PIPE_FORMAT.
This means you can directly use format utils on it without having to have your own GL enum to number-of-components switch statement (or whatever) in your vulkan backend. Thanks to imirkin for fixing up the nouveau driver (and a couple of core details). This fixes the computed qualifiers for EXT_shader_image_load_store's non-integer sizeNxM qualifiers, which we don't have tests for. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> (v3d) Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3355> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3355>
Diffstat (limited to 'src/compiler/nir/nir_print.c')
-rw-r--r--src/compiler/nir/nir_print.c47
1 files changed, 1 insertions, 46 deletions
diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c
index eaf902b4cd4..cdab71430a7 100644
--- a/src/compiler/nir/nir_print.c
+++ b/src/compiler/nir/nir_print.c
@@ -475,52 +475,7 @@ print_var_decl(nir_variable *var, print_state *state)
fprintf(fp, "%s%s%s%s%s%s", coher, volat, restr, ronly, wonly, reorder);
if (glsl_get_base_type(glsl_without_array(var->type)) == GLSL_TYPE_IMAGE) {
-#define FORMAT_CASE(x) case x: fprintf(fp, #x " "); break
- switch (var->data.image.format) {
- FORMAT_CASE(GL_RGBA32F);
- FORMAT_CASE(GL_RGBA32UI);
- FORMAT_CASE(GL_RGBA32I);
- FORMAT_CASE(GL_R32F);
- FORMAT_CASE(GL_R32UI);
- FORMAT_CASE(GL_R32I);
- FORMAT_CASE(GL_RG32F);
- FORMAT_CASE(GL_RG32UI);
- FORMAT_CASE(GL_RG32I);
- FORMAT_CASE(GL_R8);
- FORMAT_CASE(GL_RG8);
- FORMAT_CASE(GL_RGBA8);
- FORMAT_CASE(GL_R8_SNORM);
- FORMAT_CASE(GL_RG8_SNORM);
- FORMAT_CASE(GL_RGBA8_SNORM);
- FORMAT_CASE(GL_R16);
- FORMAT_CASE(GL_RG16);
- FORMAT_CASE(GL_RGBA16);
- FORMAT_CASE(GL_R16_SNORM);
- FORMAT_CASE(GL_RG16_SNORM);
- FORMAT_CASE(GL_RGBA16_SNORM);
- FORMAT_CASE(GL_R16F);
- FORMAT_CASE(GL_RG16F);
- FORMAT_CASE(GL_RGBA16F);
- FORMAT_CASE(GL_R8UI);
- FORMAT_CASE(GL_R8I);
- FORMAT_CASE(GL_RG8UI);
- FORMAT_CASE(GL_RG8I);
- FORMAT_CASE(GL_RGBA8UI);
- FORMAT_CASE(GL_RGBA8I);
- FORMAT_CASE(GL_R16UI);
- FORMAT_CASE(GL_R16I);
- FORMAT_CASE(GL_RG16UI);
- FORMAT_CASE(GL_RG16I);
- FORMAT_CASE(GL_RGBA16UI);
- FORMAT_CASE(GL_RGBA16I);
- FORMAT_CASE(GL_R11F_G11F_B10F);
- FORMAT_CASE(GL_RGB9_E5);
- FORMAT_CASE(GL_RGB10_A2);
- FORMAT_CASE(GL_RGB10_A2UI);
- default: /* Including the normal GL_NONE */
- break;
- }
-#undef FORMAT_CASE
+ fprintf(fp, "%s ", util_format_short_name(var->data.image.format));
}
fprintf(fp, "%s %s", glsl_get_type_name(var->type),