diff options
author | Samuel Pitoiset <[email protected]> | 2020-01-06 08:27:49 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2020-01-09 07:58:33 +0100 |
commit | 1b808d208f7ae6b7934ada37378c654991a5ca5a (patch) | |
tree | 033069ef6ba151e411a279e18550cc3bbdc28d56 /src/compiler/glsl/glsl_to_nir.cpp | |
parent | 37bfd854c71be8ace37080fbca36d0a1ef68fb8a (diff) |
spirv,nir: add new lod parameter to image_{load,store} intrinsics
SPV_AMD_shader_image_load_store_lod allows to use a lod parameter
with OpImageRead, OpImageWrite and OpImageSparseRead.
According to the specification, this parameter should be a 32-bit
integer. It is initialized to 0 when no lod parameter is found
during SPIR-V->NIR translation.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/compiler/glsl/glsl_to_nir.cpp')
-rw-r--r-- | src/compiler/glsl/glsl_to_nir.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index 494c0c2723a..479832b5ab0 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -1373,13 +1373,18 @@ nir_visitor::visit(ir_call *ir) instr->src[3] = nir_src_for_ssa(evaluate_rvalue((ir_dereference *)param)); param = param->get_next(); + } else if (op == nir_intrinsic_image_deref_load) { + instr->src[3] = nir_src_for_ssa(nir_imm_int(&b, 0)); /* LOD */ } if (!param->is_tail_sentinel()) { instr->src[4] = nir_src_for_ssa(evaluate_rvalue((ir_dereference *)param)); param = param->get_next(); + } else if (op == nir_intrinsic_image_deref_store) { + instr->src[4] = nir_src_for_ssa(nir_imm_int(&b, 0)); /* LOD */ } + nir_builder_instr_insert(&b, &instr->instr); break; } |