nir/vtn: Add type constant to image intrinsics

Since OpenCL supports untyped images, backends might need type info
to be able to support the load/store ops.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5242>
This commit is contained in:
Jesse Natalie
2020-04-13 07:50:37 -07:00
committed by Marge Bot
parent 865a2ad086
commit ce6f66242a
4 changed files with 21 additions and 8 deletions

View File

@@ -1334,6 +1334,8 @@ nir_visitor::visit(ir_call *ir)
} else if (op == nir_intrinsic_image_deref_load ||
op == nir_intrinsic_image_deref_store) {
instr->num_components = 4;
nir_intrinsic_set_type(instr,
nir_get_nir_type_for_glsl_base_type(type->sampled_type));
}
if (op == nir_intrinsic_image_deref_size ||