From 8d07d66180b1523d7e70681ca142955f896ebda9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 10 Jan 2020 14:09:43 -0800 Subject: glsl,nir: Switch the enum representing shader image formats to PIPE_FORMAT. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Iago Toral Quiroga (v3d) Tested-by: Marge Bot Part-of: --- src/compiler/nir/nir_print.c | 47 +------------------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) (limited to 'src/compiler/nir/nir_print.c') 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), -- cgit v1.2.3