mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
microsoft/compiler: Add struct and function defs for SM6.6 handle funcs
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18022>
This commit is contained in:
parent
d4b964b546
commit
e9489beb76
5 changed files with 36 additions and 0 deletions
|
|
@ -88,6 +88,8 @@ static struct predefined_func_descr predefined_funcs[] = {
|
|||
{"dx.op.storePatchConstant", "v", "iiicO", DXIL_ATTR_KIND_NO_UNWIND},
|
||||
{"dx.op.loadPatchConstant", "O", "iiic", DXIL_ATTR_KIND_READ_NONE},
|
||||
{"dx.op.loadOutputControlPoint", "O", "iiici", DXIL_ATTR_KIND_READ_NONE},
|
||||
{"dx.op.createHandleFromBinding", "@", "i#ib", DXIL_ATTR_KIND_READ_NONE},
|
||||
{"dx.op.annotateHandle", "@", "i@P", DXIL_ATTR_KIND_READ_NONE},
|
||||
};
|
||||
|
||||
struct func_descr {
|
||||
|
|
@ -192,6 +194,8 @@ get_type_from_string(struct dxil_module *mod, const char *param_descr,
|
|||
case DXIL_FUNC_PARAM_SAMPLE_POS: return dxil_module_get_samplepos_type(mod);
|
||||
case DXIL_FUNC_PARAM_CBUF_RET: return dxil_module_get_cbuf_ret_type(mod, overload);
|
||||
case DXIL_FUNC_PARAM_SPLIT_DOUBLE: return dxil_module_get_split_double_ret_type(mod);
|
||||
case DXIL_FUNC_PARAM_RES_BIND: return dxil_module_get_res_bind_type(mod);
|
||||
case DXIL_FUNC_PARAM_RES_PROPS: return dxil_module_get_res_props_type(mod);
|
||||
case DXIL_FUNC_PARAM_POINTER: {
|
||||
const struct dxil_type *target = get_type_from_string(mod, param_descr, overload, idx);
|
||||
return dxil_module_get_pointer_type(mod, target);
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@
|
|||
#define DXIL_FUNC_PARAM_DIM 'D'
|
||||
#define DXIL_FUNC_PARAM_SPLIT_DOUBLE 'G'
|
||||
#define DXIL_FUNC_PARAM_SAMPLE_POS 'S'
|
||||
#define DXIL_FUNC_PARAM_RES_BIND '#'
|
||||
#define DXIL_FUNC_PARAM_RES_PROPS 'P'
|
||||
|
||||
#include "dxil_module.h"
|
||||
#include "util/rb_tree.h"
|
||||
|
|
|
|||
|
|
@ -887,6 +887,27 @@ dxil_module_get_samplepos_type(struct dxil_module *m)
|
|||
return dxil_module_get_struct_type(m, "dx.types.SamplePos", samplepos, 2);
|
||||
}
|
||||
|
||||
const struct dxil_type *
|
||||
dxil_module_get_res_bind_type(struct dxil_module *mod)
|
||||
{
|
||||
/* %dx.types.ResBind = type { i32, i32, i32, i8 } */
|
||||
const struct dxil_type *int32_type = dxil_module_get_int_type(mod, 32);
|
||||
const struct dxil_type *int8_type = dxil_module_get_int_type(mod, 8);
|
||||
const struct dxil_type *fields[4] = { int32_type, int32_type, int32_type, int8_type };
|
||||
|
||||
return dxil_module_get_struct_type(mod, "dx.types.ResBind", fields, 4);
|
||||
}
|
||||
|
||||
const struct dxil_type *
|
||||
dxil_module_get_res_props_type(struct dxil_module *mod)
|
||||
{
|
||||
/* %dx.types.ResourceProperties = type { i32, i32 } */
|
||||
const struct dxil_type *int32_type = dxil_module_get_int_type(mod, 32);
|
||||
const struct dxil_type *fields[2] = { int32_type, int32_type };
|
||||
|
||||
return dxil_module_get_struct_type(mod, "dx.types.ResourceProperties", fields, 2);
|
||||
}
|
||||
|
||||
const struct dxil_type *
|
||||
dxil_module_add_function_type(struct dxil_module *m,
|
||||
const struct dxil_type *ret_type,
|
||||
|
|
|
|||
|
|
@ -308,6 +308,12 @@ dxil_module_get_dimret_type(struct dxil_module *m);
|
|||
const struct dxil_type *
|
||||
dxil_module_get_samplepos_type(struct dxil_module *m);
|
||||
|
||||
const struct dxil_type *
|
||||
dxil_module_get_res_bind_type(struct dxil_module *m);
|
||||
|
||||
const struct dxil_type *
|
||||
dxil_module_get_res_props_type(struct dxil_module *m);
|
||||
|
||||
const struct dxil_type *
|
||||
dxil_module_get_struct_type(struct dxil_module *m,
|
||||
const char *name,
|
||||
|
|
|
|||
|
|
@ -327,6 +327,9 @@ enum dxil_intr {
|
|||
DXIL_INTR_LEGACY_F16TOF32 = 131,
|
||||
|
||||
DXIL_INTR_ATTRIBUTE_AT_VERTEX = 137,
|
||||
|
||||
DXIL_INTR_ANNOTATE_HANDLE = 216,
|
||||
DXIL_INTR_CREATE_HANDLE_FROM_BINDING = 217,
|
||||
};
|
||||
|
||||
enum dxil_atomic_op {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue