return dxil_module_get_struct_type(m, class_name, &vec_type, 1);
}
+ case DXIL_RESOURCE_KIND_RAW_BUFFER:
+ {
+ const struct dxil_type *component_type = dxil_module_get_int_type(m, 32);
+ char class_name[64] = { 0 };
+ snprintf(class_name, 64, "struct.%sByteAddressBuffer", readwrite ? "RW" : "");
+ return dxil_module_get_struct_type(m, class_name, &component_type, 1);
+ }
+
default:
unreachable("resource type not supported");
}
if (!size)
return true;
- const struct dxil_type *type = dxil_module_get_int_type(&ctx->mod, 32);
- if (!type)
- return false;
-
- const struct dxil_type *struct_type =
- dxil_module_get_struct_type(&ctx->mod, NULL, &type, 1);
+ const struct dxil_type *struct_type = dxil_module_get_res_type(&ctx->mod,
+ DXIL_RESOURCE_KIND_RAW_BUFFER, DXIL_COMP_TYPE_INVALID, true /* readwrite */);
if (!struct_type)
return false;