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.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/compiler/nir/nir.h') diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 8c0a0f03b7a..c9edcadaaef 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -37,6 +37,7 @@ #include "util/bitscan.h" #include "util/bitset.h" #include "util/macros.h" +#include "util/format/u_format.h" #include "compiler/nir_types.h" #include "compiler/shader_enums.h" #include "compiler/shader_info.h" @@ -525,8 +526,8 @@ typedef struct nir_variable { union { struct { - /** Image internal format if specified explicitly, otherwise GL_NONE. */ - uint16_t format; /* GLenum */ + /** Image internal format if specified explicitly, otherwise PIPE_FORMAT_NONE. */ + enum pipe_format format; } image; struct { @@ -1719,7 +1720,7 @@ INTRINSIC_IDX_ACCESSORS(image_array, IMAGE_ARRAY, bool) INTRINSIC_IDX_ACCESSORS(access, ACCESS, enum gl_access_qualifier) INTRINSIC_IDX_ACCESSORS(src_access, SRC_ACCESS, enum gl_access_qualifier) INTRINSIC_IDX_ACCESSORS(dst_access, DST_ACCESS, enum gl_access_qualifier) -INTRINSIC_IDX_ACCESSORS(format, FORMAT, unsigned) +INTRINSIC_IDX_ACCESSORS(format, FORMAT, enum pipe_format) INTRINSIC_IDX_ACCESSORS(align_mul, ALIGN_MUL, unsigned) INTRINSIC_IDX_ACCESSORS(align_offset, ALIGN_OFFSET, unsigned) INTRINSIC_IDX_ACCESSORS(desc_type, DESC_TYPE, unsigned) -- cgit v1.2.3