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/mesa | |
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/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index f23d27c09ad..7d63aac716b 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -3768,7 +3768,7 @@ static void get_image_qualifiers(ir_dereference *ir, const glsl_type **type, bool *memory_coherent, bool *memory_volatile, bool *memory_restrict, bool *memory_read_only, - unsigned *image_format) + enum pipe_format *image_format) { switch (ir->ir_type) { @@ -3826,7 +3826,7 @@ glsl_to_tgsi_visitor::visit_image_intrinsic(ir_call *ir) unsigned sampler_array_size = 1, sampler_base = 0; bool memory_coherent = false, memory_volatile = false, memory_restrict = false, memory_read_only = false; - unsigned image_format = 0; + enum pipe_format image_format = PIPE_FORMAT_NONE; const glsl_type *type = NULL; get_image_qualifiers(img, &type, &memory_coherent, &memory_volatile, @@ -3982,8 +3982,7 @@ glsl_to_tgsi_visitor::visit_image_intrinsic(ir_call *ir) } inst->tex_target = type->sampler_index(); - inst->image_format = st_mesa_format_to_pipe_format(st_context(ctx), - _mesa_get_shader_image_format(image_format)); + inst->image_format = image_format; inst->read_only = memory_read_only; if (memory_coherent) |