diff options
author | Eric Anholt <[email protected]> | 2020-01-10 14:09:43 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2020-02-05 10:31:14 -0800 |
commit | 8d07d66180b1523d7e70681ca142955f896ebda9 (patch) | |
tree | 266be7d8ee1e804f87ab36698c8b4b90f422dece /src/compiler/nir/nir.h | |
parent | 5bea0cf77956d748ea929e12d12756692f04a33f (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.h')
-rw-r--r-- | src/compiler/nir/nir.h | 7 |
1 files changed, 4 insertions, 3 deletions
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) |