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/mesa/state_tracker/st_glsl_to_tgsi.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/mesa') 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) -- cgit v1.2.3