+ break;
+ }
+
+ case NIR_INTRINSIC_IMAGE_DIM: {
+ static const char *dim_name[] = {
+ [GLSL_SAMPLER_DIM_1D] = "1D",
+ [GLSL_SAMPLER_DIM_2D] = "2D",
+ [GLSL_SAMPLER_DIM_3D] = "3D",
+ [GLSL_SAMPLER_DIM_CUBE] = "Cube",
+ [GLSL_SAMPLER_DIM_RECT] = "Rect",
+ [GLSL_SAMPLER_DIM_BUF] = "Buf",
+ [GLSL_SAMPLER_DIM_MS] = "2D-MSAA",
+ [GLSL_SAMPLER_DIM_SUBPASS] = "Subpass",
+ [GLSL_SAMPLER_DIM_SUBPASS_MS] = "Subpass-MSAA",
+ };
+ enum glsl_sampler_dim dim = nir_intrinsic_image_dim(instr);
+ assert(dim < ARRAY_SIZE(dim_name) && dim_name[dim]);
+ fprintf(fp, " image_dim=%s", dim_name[dim]);
+ break;
+ }
+
+ case NIR_INTRINSIC_IMAGE_ARRAY: {
+ bool array = nir_intrinsic_image_array(instr);
+ fprintf(fp, " image_array=%s", array ? "true" : "false");
+ break;
+ }
+
+ case NIR_INTRINSIC_DESC_TYPE: {
+ VkDescriptorType desc_type = nir_intrinsic_desc_type(instr);
+ fprintf(fp, " desc_type=%s", vulkan_descriptor_type_name(desc_type));
+ break;
+ }
+
+ case NIR_INTRINSIC_TYPE: {
+ fprintf(fp, " type=");
+ print_alu_type(nir_intrinsic_type(instr), state);
+ break;
+ }
+
+ case NIR_INTRINSIC_SWIZZLE_MASK: {
+ fprintf(fp, " swizzle_mask=");
+ unsigned mask = nir_intrinsic_swizzle_mask(instr);
+ if (instr->intrinsic == nir_intrinsic_quad_swizzle_amd) {
+ for (unsigned i = 0; i < 4; i++)
+ fprintf(fp, "%d", (mask >> (i * 2) & 3));
+ } else if (instr->intrinsic == nir_intrinsic_masked_swizzle_amd) {
+ fprintf(fp, "((id & %d) | %d) ^ %d", mask & 0x1F,
+ (mask >> 5) & 0x1F,
+ (mask >> 10) & 0x1F);
+ } else {
+ fprintf(fp, "%d", mask);
+ }
+ break;
+ }
+
+ case NIR_INTRINSIC_MEMORY_SEMANTICS: {
+ nir_memory_semantics semantics = nir_intrinsic_memory_semantics(instr);
+ fprintf(fp, " mem_semantics=");
+ switch (semantics & (NIR_MEMORY_ACQUIRE | NIR_MEMORY_RELEASE)) {
+ case 0: fprintf(fp, "NONE"); break;
+ case NIR_MEMORY_ACQUIRE: fprintf(fp, "ACQ"); break;
+ case NIR_MEMORY_RELEASE: fprintf(fp, "REL"); break;
+ default: fprintf(fp, "ACQ|REL"); break;
+ }
+ if (semantics & (NIR_MEMORY_MAKE_AVAILABLE)) fprintf(fp, "|AVAILABLE");
+ if (semantics & (NIR_MEMORY_MAKE_VISIBLE)) fprintf(fp, "|VISIBLE");
+ break;
+ }
+
+ case NIR_INTRINSIC_MEMORY_MODES: {
+ fprintf(fp, " mem_modes=");
+ unsigned int modes = nir_intrinsic_memory_modes(instr);
+ while (modes) {
+ nir_variable_mode m = u_bit_scan(&modes);
+ fprintf(fp, "%s%s", get_variable_mode_str(1 << m, true), modes ? "|" : "");
+ }
+ break;
+ }
+
+ case NIR_INTRINSIC_EXECUTION_SCOPE:
+ case NIR_INTRINSIC_MEMORY_SCOPE: {
+ fprintf(fp, " %s=", index_name[idx]);
+ nir_scope scope =
+ idx == NIR_INTRINSIC_MEMORY_SCOPE ? nir_intrinsic_memory_scope(instr)
+ : nir_intrinsic_execution_scope(instr);
+ switch (scope) {
+ case NIR_SCOPE_NONE: fprintf(fp, "NONE"); break;
+ case NIR_SCOPE_DEVICE: fprintf(fp, "DEVICE"); break;
+ case NIR_SCOPE_QUEUE_FAMILY: fprintf(fp, "QUEUE_FAMILY"); break;
+ case NIR_SCOPE_WORKGROUP: fprintf(fp, "WORKGROUP"); break;
+ case NIR_SCOPE_SUBGROUP: fprintf(fp, "SUBGROUP"); break;
+ case NIR_SCOPE_INVOCATION: fprintf(fp, "INVOCATION"); break;
+ }
+ break;
+ }
+
+ default: {