28#define SM4_MAX_SRC_COUNT 6
29#define SM4_MAX_DST_COUNT 2
33#define VKD3D_SM4_PS 0x0000u
34#define VKD3D_SM4_VS 0x0001u
35#define VKD3D_SM4_GS 0x0002u
36#define VKD3D_SM5_HS 0x0003u
37#define VKD3D_SM5_DS 0x0004u
38#define VKD3D_SM5_CS 0x0005u
39#define VKD3D_SM4_LIB 0xfff0u
41#define VKD3D_SM4_INSTRUCTION_MODIFIER (0x1u << 31)
43#define VKD3D_SM4_MODIFIER_MASK 0x3fu
45#define VKD3D_SM5_MODIFIER_DATA_TYPE_SHIFT 6
46#define VKD3D_SM5_MODIFIER_DATA_TYPE_MASK (0xffffu << VKD3D_SM5_MODIFIER_DATA_TYPE_SHIFT)
48#define VKD3D_SM5_MODIFIER_RESOURCE_TYPE_SHIFT 6
49#define VKD3D_SM5_MODIFIER_RESOURCE_TYPE_MASK (0xfu << VKD3D_SM5_MODIFIER_RESOURCE_TYPE_SHIFT)
51#define VKD3D_SM5_MODIFIER_RESOURCE_STRIDE_SHIFT 11
52#define VKD3D_SM5_MODIFIER_RESOURCE_STRIDE_MASK (0xfffu << VKD3D_SM5_MODIFIER_RESOURCE_STRIDE_SHIFT)
54#define VKD3D_SM4_AOFFIMMI_U_SHIFT 9
55#define VKD3D_SM4_AOFFIMMI_U_MASK (0xfu << VKD3D_SM4_AOFFIMMI_U_SHIFT)
56#define VKD3D_SM4_AOFFIMMI_V_SHIFT 13
57#define VKD3D_SM4_AOFFIMMI_V_MASK (0xfu << VKD3D_SM4_AOFFIMMI_V_SHIFT)
58#define VKD3D_SM4_AOFFIMMI_W_SHIFT 17
59#define VKD3D_SM4_AOFFIMMI_W_MASK (0xfu << VKD3D_SM4_AOFFIMMI_W_SHIFT)
61#define VKD3D_SM4_INSTRUCTION_LENGTH_SHIFT 24
62#define VKD3D_SM4_INSTRUCTION_LENGTH_MASK (0x1fu << VKD3D_SM4_INSTRUCTION_LENGTH_SHIFT)
64#define VKD3D_SM4_INSTRUCTION_FLAGS_SHIFT 11
65#define VKD3D_SM4_INSTRUCTION_FLAGS_MASK (0x7u << VKD3D_SM4_INSTRUCTION_FLAGS_SHIFT)
67#define VKD3D_SM4_RESOURCE_TYPE_SHIFT 11
68#define VKD3D_SM4_RESOURCE_TYPE_MASK (0xfu << VKD3D_SM4_RESOURCE_TYPE_SHIFT)
70#define VKD3D_SM4_RESOURCE_SAMPLE_COUNT_SHIFT 16
71#define VKD3D_SM4_RESOURCE_SAMPLE_COUNT_MASK (0xfu << VKD3D_SM4_RESOURCE_SAMPLE_COUNT_SHIFT)
73#define VKD3D_SM4_PRIMITIVE_TYPE_SHIFT 11
74#define VKD3D_SM4_PRIMITIVE_TYPE_MASK (0x3fu << VKD3D_SM4_PRIMITIVE_TYPE_SHIFT)
76#define VKD3D_SM4_INDEX_TYPE_SHIFT 11
77#define VKD3D_SM4_INDEX_TYPE_MASK (0x1u << VKD3D_SM4_INDEX_TYPE_SHIFT)
79#define VKD3D_SM4_SAMPLER_MODE_SHIFT 11
80#define VKD3D_SM4_SAMPLER_MODE_MASK (0xfu << VKD3D_SM4_SAMPLER_MODE_SHIFT)
82#define VKD3D_SM4_SHADER_DATA_TYPE_SHIFT 11
83#define VKD3D_SM4_SHADER_DATA_TYPE_MASK (0xfu << VKD3D_SM4_SHADER_DATA_TYPE_SHIFT)
85#define VKD3D_SM4_INTERPOLATION_MODE_SHIFT 11
86#define VKD3D_SM4_INTERPOLATION_MODE_MASK (0xfu << VKD3D_SM4_INTERPOLATION_MODE_SHIFT)
88#define VKD3D_SM4_GLOBAL_FLAGS_SHIFT 11
89#define VKD3D_SM4_GLOBAL_FLAGS_MASK (0xffu << VKD3D_SM4_GLOBAL_FLAGS_SHIFT)
91#define VKD3D_SM5_PRECISE_SHIFT 19
92#define VKD3D_SM5_PRECISE_MASK (0xfu << VKD3D_SM5_PRECISE_SHIFT)
94#define VKD3D_SM5_CONTROL_POINT_COUNT_SHIFT 11
95#define VKD3D_SM5_CONTROL_POINT_COUNT_MASK (0xffu << VKD3D_SM5_CONTROL_POINT_COUNT_SHIFT)
97#define VKD3D_SM5_FP_ARRAY_SIZE_SHIFT 16
98#define VKD3D_SM5_FP_TABLE_COUNT_MASK 0xffffu
100#define VKD3D_SM5_UAV_FLAGS_SHIFT 15
101#define VKD3D_SM5_UAV_FLAGS_MASK (0x1ffu << VKD3D_SM5_UAV_FLAGS_SHIFT)
103#define VKD3D_SM5_SYNC_FLAGS_SHIFT 11
104#define VKD3D_SM5_SYNC_FLAGS_MASK (0xffu << VKD3D_SM5_SYNC_FLAGS_SHIFT)
106#define VKD3D_SM5_TESSELLATOR_SHIFT 11
107#define VKD3D_SM5_TESSELLATOR_MASK (0xfu << VKD3D_SM5_TESSELLATOR_SHIFT)
109#define VKD3D_SM4_OPCODE_MASK 0xff
111#define VKD3D_SM4_EXTENDED_OPERAND (0x1u << 31)
113#define VKD3D_SM4_EXTENDED_OPERAND_TYPE_MASK 0x3fu
115#define VKD3D_SM4_REGISTER_MODIFIER_SHIFT 6
116#define VKD3D_SM4_REGISTER_MODIFIER_MASK (0xffu << VKD3D_SM4_REGISTER_MODIFIER_SHIFT)
118#define VKD3D_SM4_REGISTER_PRECISION_SHIFT 14
119#define VKD3D_SM4_REGISTER_PRECISION_MASK (0x7u << VKD3D_SM4_REGISTER_PRECISION_SHIFT)
121#define VKD3D_SM4_REGISTER_NON_UNIFORM_SHIFT 17
122#define VKD3D_SM4_REGISTER_NON_UNIFORM_MASK (0x1u << VKD3D_SM4_REGISTER_NON_UNIFORM_SHIFT)
124#define VKD3D_SM4_ADDRESSING_SHIFT2 28
125#define VKD3D_SM4_ADDRESSING_MASK2 (0x3u << VKD3D_SM4_ADDRESSING_SHIFT2)
127#define VKD3D_SM4_ADDRESSING_SHIFT1 25
128#define VKD3D_SM4_ADDRESSING_MASK1 (0x3u << VKD3D_SM4_ADDRESSING_SHIFT1)
130#define VKD3D_SM4_ADDRESSING_SHIFT0 22
131#define VKD3D_SM4_ADDRESSING_MASK0 (0x3u << VKD3D_SM4_ADDRESSING_SHIFT0)
133#define VKD3D_SM4_REGISTER_ORDER_SHIFT 20
134#define VKD3D_SM4_REGISTER_ORDER_MASK (0x3u << VKD3D_SM4_REGISTER_ORDER_SHIFT)
136#define VKD3D_SM4_REGISTER_TYPE_SHIFT 12
137#define VKD3D_SM4_REGISTER_TYPE_MASK (0xffu << VKD3D_SM4_REGISTER_TYPE_SHIFT)
139#define VKD3D_SM4_SWIZZLE_TYPE_SHIFT 2
140#define VKD3D_SM4_SWIZZLE_TYPE_MASK (0x3u << VKD3D_SM4_SWIZZLE_TYPE_SHIFT)
142#define VKD3D_SM4_DIMENSION_SHIFT 0
143#define VKD3D_SM4_DIMENSION_MASK (0x3u << VKD3D_SM4_DIMENSION_SHIFT)
145#define VKD3D_SM4_WRITEMASK_SHIFT 4
146#define VKD3D_SM4_WRITEMASK_MASK (0xfu << VKD3D_SM4_WRITEMASK_SHIFT)
148#define VKD3D_SM4_SWIZZLE_SHIFT 4
149#define VKD3D_SM4_SWIZZLE_MASK (0xffu << VKD3D_SM4_SWIZZLE_SHIFT)
151#define VKD3D_SM4_SCALAR_DIM_SHIFT 4
152#define VKD3D_SM4_SCALAR_DIM_MASK (0x3u << VKD3D_SM4_SCALAR_DIM_SHIFT)
154#define VKD3D_SM4_VERSION_MAJOR(version) (((version) >> 4) & 0xf)
155#define VKD3D_SM4_VERSION_MINOR(version) (((version) >> 0) & 0xf)
157#define VKD3D_SM4_ADDRESSING_RELATIVE 0x2
158#define VKD3D_SM4_ADDRESSING_OFFSET 0x1
160#define VKD3D_SM4_INSTRUCTION_FLAG_SATURATE 0x4
162#define VKD3D_SM4_CONDITIONAL_NZ (0x1u << 18)
164#define VKD3D_SM4_TYPE_COMPONENT(com, i) (((com) >> (4 * (i))) & 0xfu)
167#define VKD3D_SM4_SIF_TEXTURE_COMPONENTS_SHIFT 2
169#define VKD3D_SM4_REQUIRES_DOUBLES 0x00000001
170#define VKD3D_SM4_REQUIRES_EARLY_DEPTH_STENCIL 0x00000002
171#define VKD3D_SM4_REQUIRES_UAVS_AT_EVERY_STAGE 0x00000004
172#define VKD3D_SM4_REQUIRES_64_UAVS 0x00000008
173#define VKD3D_SM4_REQUIRES_MINIMUM_PRECISION 0x00000010
174#define VKD3D_SM4_REQUIRES_11_1_DOUBLE_EXTENSIONS 0x00000020
175#define VKD3D_SM4_REQUIRES_11_1_SHADER_EXTENSIONS 0x00000040
176#define VKD3D_SM4_REQUIRES_LEVEL_9_COMPARISON_FILTERING 0x00000080
177#define VKD3D_SM4_REQUIRES_TILED_RESOURCES 0x00000100
178#define VKD3D_SM4_REQUIRES_STENCIL_REF 0x00000200
179#define VKD3D_SM4_REQUIRES_INNER_COVERAGE 0x00000400
180#define VKD3D_SM4_REQUIRES_TYPED_UAV_LOAD_ADDITIONAL_FORMATS 0x00000800
181#define VKD3D_SM4_REQUIRES_ROVS 0x00001000
182#define VKD3D_SM4_REQUIRES_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x00002000
558 FIXME(
"Unknown SM4 dimension %#x.\n", dim);
789 WARN(
"Invalid ptr %p >= end %p.\n", *
ptr,
end);
793 *register_space = *(*ptr)++;
811 FIXME(
"Switch case value is not a 32-bit constant.\n");
813 "Switch case value is not a 32-bit immediate constant register.");
822 unsigned int icb_size;
827 FIXME(
"Ignoring shader data type %#x.\n",
type);
833 icb_size = token_count - 1;
836 FIXME(
"Unexpected immediate constant buffer size %u.\n", icb_size);
843 ERR(
"Failed to allocate immediate constant buffer, size %u.\n", icb_size);
853 memcpy(icb->
data, tokens,
sizeof(*tokens) * icb_size);
867 "Last register %u must not be less than first register %u in range.",
range->last,
range->first);
943 FIXME(
"Invalid ptr %p >= end %p.\n", tokens,
end);
961 FIXME(
"Unhandled sampler mode %#x.\n", ins->
flags);
977 unsigned int i, register_idx, register_count;
981 unsigned int *io_masks;
988 register_idx = index_range->
dst.reg.idx[index_range->
dst.reg.idx_count - 1].offset;
990 write_mask = index_range->
dst.write_mask;
992 switch ((
type = index_range->
dst.reg.type))
1027 WARN(
"Unhandled register type %#x.\n",
type);
1029 "Invalid register type %#x for index range base %u, count %u, mask %#x.",
1030 type, register_idx, register_count, write_mask);
1038 if (!(
r.mask & write_mask))
1041 if (register_idx ==
r.index)
1044 if ((
r.index <= register_idx && register_idx -
r.index <
r.count)
1045 || (register_idx <
r.index &&
r.index - register_idx < register_count))
1047 WARN(
"Detected index range collision for base %u, count %u, mask %#x.\n",
1048 register_idx, register_count, write_mask);
1050 "Register index range base %u, count %u, mask %#x collides with a previous declaration.",
1051 register_idx, register_count, write_mask);
1055 ranges->
ranges[ranges->
count].index = register_idx;
1056 ranges->
ranges[ranges->
count].count = register_count;
1057 ranges->
ranges[ranges->
count++].mask = write_mask;
1059 for (
i = 0;
i < register_count; ++
i)
1067 WARN(
"Sysval %u included in an index range declaration.\n",
e->sysval_semantic);
1069 "Index range base %u, count %u, mask %#x contains sysval %u.",
1073 if ((io_masks[register_idx +
i] & write_mask) != write_mask)
1075 WARN(
"No matching declaration for index range base %u, count %u, mask %#x.\n",
1078 "Input/output registers matching index range base %u, count %u, mask %#x were not declared.",
1097 FIXME(
"Unhandled output primitive type %#x.\n", primitive_type);
1124 FIXME(
"Unhandled input primitive type %#x.\n", primitive_type);
1160 &priv->
p.program->input_signature,
dst->reg.idx[
dst->reg.idx_count - 1].offset,
dst->write_mask);
1164 WARN(
"No matching signature element for input register %u with mask %#x.\n",
1165 dst->reg.idx[
dst->reg.idx_count - 1].offset,
dst->write_mask);
1167 "No matching signature element for input register %u with mask %#x.\n",
1168 dst->reg.idx[
dst->reg.idx_count - 1].offset,
dst->write_mask);
1172 e->interpolation_mode = ins->
flags;
1186 &priv->
p.program->input_signature,
dst->reg.idx[
dst->reg.idx_count - 1].offset,
dst->write_mask);
1190 WARN(
"No matching signature element for input register %u with mask %#x.\n",
1191 dst->reg.idx[
dst->reg.idx_count - 1].offset,
dst->write_mask);
1193 "No matching signature element for input register %u with mask %#x.\n",
1194 dst->reg.idx[
dst->reg.idx_count - 1].offset,
dst->write_mask);
1198 e->interpolation_mode = ins->
flags;
1225 ins->
src[0].reg.u.fp_body_idx = *tokens++;
1239 FIXME(
"Ignoring set of function bodies (count %u).\n", *tokens);
1249 FIXME(
"Ignoring set of function tables (count %u).\n", ins->
declaration.
fp.table_count);
1327 FIXME(
"Byte stride %u is not multiple of 4.\n",
resource->byte_stride);
1363 FIXME(
"Byte stride %u is not multiple of 4.\n",
resource->byte_stride);
1941 return lookup->opcode_info_from_vsir[vsir_opcode];
1987 return field_info->
field;
2007 ERR(
"Invalid data type '%c'.\n",
t);
2019 if (!(reg_idx->
rel_addr = rel_addr))
2021 ERR(
"Failed to get src param for relative addressing.\n");
2026 reg_idx->
offset = *(*ptr)++;
2034 reg_idx->
offset = *(*ptr)++;
2054 WARN(
"Invalid ptr %p >= end %p.\n", *
ptr,
end);
2061 if (!register_type_info)
2063 FIXME(
"Unhandled register type %#x.\n", register_type);
2068 vsir_register_type = register_type_info->
vkd3d_type;
2075 param->non_uniform =
false;
2082 WARN(
"Invalid ptr %p >= end %p.\n", *
ptr,
end);
2085 extended = *(*ptr)++;
2089 FIXME(
"Skipping second-order extended operand.\n");
2115 FIXME(
"Unhandled register modifier %#x.\n",
m);
2132 param->non_uniform =
true;
2138 FIXME(
"Skipping unhandled extended operand bits 0x%08x.\n", extended);
2142 FIXME(
"Skipping unhandled extended operand token 0x%08x (type %#x).\n", extended,
type);
2151 ERR(
"Failed to read register index.\n");
2161 ERR(
"Failed to read register index.\n");
2171 ERR(
"Failed to read register index.\n");
2187 unsigned int u32_count;
2189 switch (
param->dimension)
2193 if (
end - *
ptr < u32_count)
2195 WARN(
"Invalid ptr %p, end %p.\n", *
ptr,
end);
2205 WARN(
"Invalid ptr %p, end %p.\n", *
ptr,
end);
2213 FIXME(
"Unhandled dimension %#x.\n",
param->dimension);
2219 if (
param->idx_count != 1)
2221 WARN(
"Unexpected idx count %u.\n",
param->idx_count);
2223 "Invalid index count %u for immediate const buffer register; expected count 1.",
param->idx_count);
2310 const unsigned int *
masks;
2311 unsigned int register_idx;
2313 if (
reg->idx_count != idx_count)
2316 "Invalid index count %u for register type %#x; expected count %u.",
2317 reg->idx_count,
reg->type, idx_count);
2343 register_idx =
reg->idx[
reg->idx_count - 1].offset;
2347 WARN(
"Failed to find signature element for register type %#x, index %u and mask %#x.\n",
2348 reg->type, register_idx,
mask);
2350 "Could not find signature element matching register type %#x, index %u and mask %#x.",
2351 reg->type, register_idx,
mask);
2361 unsigned int dimension,
mask;
2366 WARN(
"Invalid ptr %p >= end %p.\n", *
ptr,
end);
2373 ERR(
"Failed to read parameter.\n");
2389 switch (swizzle_type)
2398 FIXME(
"Source mask %#x is not for a constant.\n",
mask);
2400 "Unhandled mask %#x for a non-constant source register.",
mask);
2406 "Unhandled source register mask %#x.",
mask);
2421 FIXME(
"Unhandled swizzle type %#x.\n", swizzle_type);
2423 "Source register swizzle type %#x is invalid.", swizzle_type);
2430 FIXME(
"Unhandled dimension %#x.\n", dimension);
2432 "Source register dimension %#x is invalid.", dimension);
2451 unsigned int dimension,
swizzle;
2456 WARN(
"Invalid ptr %p >= end %p.\n", *
ptr,
end);
2463 ERR(
"Failed to read parameter.\n");
2469 ERR(
"Invalid source modifier %#x on destination register.\n", modifier);
2485 switch (swizzle_type)
2497 "Unhandled destination register swizzle %#x.",
swizzle);
2503 FIXME(
"Unhandled swizzle type %#x.\n", swizzle_type);
2505 "Destination register swizzle type %#x is invalid.", swizzle_type);
2511 FIXME(
"Unhandled dimension %#x.\n", dimension);
2513 "Destination register dimension %#x is invalid.", dimension);
2523 dst_param->
shift = 0;
2536 switch (modifier_type)
2554 if (modifier & ~recognized_bits)
2555 FIXME(
"Unhandled instruction modifier %#x.\n", modifier);
2602 FIXME(
"Unhandled resource type %#x.\n", resource_type);
2612 FIXME(
"Unhandled instruction modifier %#x.\n", modifier);
2620 uint32_t opcode_token, opcode, previous_token;
2624 unsigned int i,
len;
2631 WARN(
"End of byte-code, failed to read opcode.\n");
2634 remaining = sm4->
end - *
ptr;
2636 ++sm4->
p.location.line;
2638 opcode_token = *(*ptr)++;
2646 WARN(
"End of byte-code, failed to read length token.\n");
2651 if (!
len || remaining <
len)
2653 WARN(
"Read invalid length %u (remaining %zu).\n",
len, remaining);
2660 FIXME(
"Unrecognized opcode %#x, opcode_token 0x%08x.\n", opcode, opcode_token);
2681 ERR(
"Failed to allocate src parameters.\n");
2707 previous_token = opcode_token;
2714 ins->
flags &= ~VKD3D_SM4_INSTRUCTION_FLAG_SATURATE;
2723 ERR(
"Failed to allocate dst parameters.\n");
2736 dst_params[
i].
modifiers |= instruction_dst_modifier;
2763 uint32_t version_token, token_count;
2765 if (byte_code_size /
sizeof(*byte_code) < 2)
2767 WARN(
"Invalid byte code size %lu.\n", (
long)byte_code_size);
2771 version_token = byte_code[0];
2772 TRACE(
"Version: 0x%08x.\n", version_token);
2773 token_count = byte_code[1];
2774 TRACE(
"Token count: %u.\n", token_count);
2776 if (token_count < 2 || byte_code_size /
sizeof(*byte_code) < token_count)
2778 WARN(
"Invalid token count %u.\n", token_count);
2782 sm4->
start = &byte_code[2];
2783 sm4->
end = &byte_code[token_count];
2785 switch (version_token >> 16)
2812 FIXME(
"Unrecognised shader type %#x.\n", version_token >> 16);
2831 for (
unsigned int i = 0;
i <
signature->element_count; ++
i)
2835 e->used_mask =
e->mask & ~e->used_mask;
2846 register_idx =
signature->elements[
i].register_index;
2850 WARN(
"%s signature element %u unhandled register index %u, count %u.\n",
2853 "%s signature element %u register index %u, count %u exceeds maximum index of %u.",
name,
2860 WARN(
"%s signature element %u mask %#x is not contiguous.\n",
name,
i,
mask);
2862 "%s signature element %u mask %#x is not contiguous.",
name,
i,
mask);
2865 if (register_idx != ~0
u)
2894 WARN(
"Default phase index ranges are not identical.\n");
2896 "Default control point phase input and output index range declarations are not identical.");
2911 message_context, compile_info->
source_name, &dxbc_desc)) < 0)
2913 WARN(
"Failed to extract shader, vkd3d result %d.\n",
ret);
2918 compile_info, message_context))
2920 WARN(
"Failed to initialise shader parser.\n");
2928 memset(&dxbc_desc, 0,
sizeof(dxbc_desc));
2936 switch (
program->shader_version.type)
2943 if (
program->patch_constant_signature.element_count != 0)
2945 WARN(
"The patch constant signature only makes sense for Hull and Domain Shaders, ignoring it.\n");
2962 instructions = &
program->instructions;
2963 while (sm4.
ptr != sm4.
end)
2967 ERR(
"Failed to allocate instructions.\n");
2977 WARN(
"Encountered unrecognized or invalid instruction.\n");
2981 ++instructions->
count;
3039 && output == register_table[
i].output
3040 &&
version->type == register_table[
i].shader_type)
3043 *
type = register_table[
i].type;
3044 *has_idx = register_table[
i].has_idx;
3060 else if (
index == 1)
3102 const char *semantic_name,
unsigned int semantic_idx,
bool output,
bool is_patch_constant_func)
3165 if (is_patch_constant_func)
3184 *sysval_semantic = ~0
u;
3204 && output == semantics[
i].output
3205 && (semantic_compat_mapping == needs_compat_mapping || !needs_compat_mapping)
3206 &&
version->type == semantics[
i].shader_type)
3208 *sysval_semantic = semantics[
i].semantic;
3213 if (!needs_compat_mapping)
3286 size_t string_offset;
3298 switch (
type->class)
3342 switch (
type->e.numeric.type)
3363 const char *
name = array_type->
name ? array_type->
name :
"<unnamed>";
3366 size_t name_offset = 0;
3369 if (
type->bytecode_offset)
3372 if (
profile->major_version >= 5)
3380 unsigned int field_count = 0;
3381 size_t fields_offset = 0;
3383 for (
i = 0;
i < array_type->
e.
record.field_count; ++
i)
3397 for (
i = 0;
i < array_type->
e.
record.field_count; ++
i)
3422 if (
profile->major_version >= 5)
3434 switch (
type->class)
3453 switch (
format->e.numeric.type)
3481 switch (
type->sampler_dim)
3559 return string +
strlen(
"<resource>");
3565 bool separate_components =
ctx->profile->major_version == 5 &&
ctx->profile->minor_version == 0;
3570 size_t capacity = 0;
3577 if (separate_components)
3580 unsigned int k, regset_offset;
3592 if (regset_offset >
var->regs[
regset].allocation_size)
3595 if (
var->objects_usage[
regset][regset_offset].used)
3598 sizeof(*extern_resources))))
3624 extern_resources[*
count].is_user_packed = !!
var->reg_reservation.reg_type;
3631 extern_resources[*
count].index =
var->regs[
regset].index + regset_offset;
3632 extern_resources[*
count].bind_count = 1;
3633 extern_resources[*
count].loc =
var->loc;
3648 if (!
var->regs[
r].allocated)
3652 sizeof(*extern_resources))))
3666 extern_resources[*
count].var =
var;
3673 && !!
var->reg_reservation.reg_type;
3677 extern_resources[*
count].regset =
r;
3678 extern_resources[*
count].id =
var->regs[
r].id;
3679 extern_resources[*
count].space =
var->regs[
r].space;
3680 extern_resources[*
count].index =
var->regs[
r].index;
3681 extern_resources[*
count].bind_count =
var->bind_count[
r];
3682 extern_resources[*
count].loc =
var->loc;
3691 if (!
buffer->reg.allocated)
3695 sizeof(*extern_resources))))
3713 extern_resources[*
count].is_user_packed = !!
buffer->reservation.reg_type;
3715 extern_resources[*
count].component_type =
NULL;
3719 extern_resources[*
count].space =
buffer->reg.space;
3720 extern_resources[*
count].index =
buffer->reg.index;
3721 extern_resources[*
count].bind_count = 1;
3728 return extern_resources;
3739 unsigned int element_comp_count,
element,
x,
y,
i;
3740 unsigned int base = 0;
3742 switch (
type->class)
3747 return y *
type->dimx +
x;
3756 for (
i = 0;
i <
type->e.record.field_count; ++
i)
3763 base += element_comp_count;
3776 size_t cbuffers_offset, resources_offset, creator_offset, string_offset;
3777 unsigned int cbuffer_count = 0, extern_resources_count,
i,
j;
3778 size_t cbuffer_position, resource_position, creator_position;
3785 static const uint16_t target_types[] =
3799 if (cbuffer->
reg.allocated)
3808 target_types[
profile->type]));
3812 if (
profile->major_version >= 5)
3829 for (
i = 0;
i < extern_resources_count; ++
i)
3844 unsigned int dimx =
resource->component_type->e.resource.format->dimx;
3868 for (
i = 0;
i < extern_resources_count; ++
i)
3873 set_u32(&
buffer, resources_offset +
i * binding_desc_size, string_offset);
3882 unsigned int var_count = 0;
3884 if (!cbuffer->
reg.allocated)
3904 if (!cbuffer->
reg.allocated)
3916 if (!cbuffer->
reg.allocated)
3937 if (
profile->major_version >= 5)
3952 const unsigned int var_size = (
profile->major_version >= 5 ? 10 : 6);
3953 size_t var_offset = vars_start +
j * var_size *
sizeof(
uint32_t);
3960 if (
var->default_values)
3964 unsigned int default_value_offset;
3970 for (
k = 0;
k < comp_count; ++
k)
3973 unsigned int comp_offset, comp_index;
3979 "Cannot write string default value.");
3991 var->default_values[
k].number.u);
4010 switch (
type->sampler_dim)
4061 VKD3D_ASSERT(-8 <= imod->
u.aoffimmi.u && imod->
u.aoffimmi.u <= 7);
4062 VKD3D_ASSERT(-8 <= imod->
u.aoffimmi.v && imod->
u.aoffimmi.v <= 7);
4063 VKD3D_ASSERT(-8 <= imod->
u.aoffimmi.w && imod->
u.aoffimmi.w <= 7);
4105 reg->idx[0].offset = instr->
reg.id;
4107 *writemask = instr->
reg.writemask;
4115 unsigned int offset_const_deref;
4123 if (!
var->indexable)
4126 reg->idx[0].offset += offset_const_deref / 4;
4132 reg->idx[1].offset = offset_const_deref / 4;
4138 unsigned int idx_writemask;
4142 memset(idx_src, 0,
sizeof(*idx_src));
4144 reg->idx[1].rel_addr = idx_src;
4151 *writemask = 0xf & (0xf << (offset_const_deref % 4));
4164 if (
var->is_uniform)
4234 reg->idx[0].offset =
var->buffer->reg.id;
4235 reg->idx[1].offset =
var->buffer->reg.index;
4241 reg->idx[0].offset =
var->buffer->reg.index;
4248 else if (
var->is_input_semantic)
4284 else if (
var->is_output_semantic)
4327 unsigned int hlsl_swizzle;
4344 const struct hlsl_constant_value *
value,
unsigned int width,
unsigned int map_writemask)
4351 src->reg.u.immconst_u32[0] =
value->u[0].u;
4355 unsigned int i,
j = 0;
4358 for (
i = 0;
i < 4; ++
i)
4360 if ((map_writemask & (1u <<
i)) && (
j <
width))
4361 src->reg.u.immconst_u32[
i] =
value->u[
j++].u;
4363 src->reg.u.immconst_u32[
i] = 0;
4371 unsigned int hlsl_swizzle;
4393 if (
reg->idx[
i].rel_addr)
4395 if (
reg->idx[
i].offset == 0)
4408 uint32_t sm4_reg_type, sm4_reg_dim;
4412 if (!register_type_info)
4414 FIXME(
"Unhandled vkd3d-shader register type %#x.\n",
reg->type);
4421 sm4_reg_type = register_type_info->
sm4_type;
4430 if (
reg->idx_count > 0)
4432 if (
reg->idx_count > 1)
4434 if (
reg->idx_count > 2)
4441 switch (sm4_swizzle_type)
4482 for (
k = 0;
k < idx_src->
reg.idx_count; ++
k)
4503 for (
j = 0;
j <
dst->reg.idx_count; ++
j)
4515 switch (
src->modifiers)
4537 ERR(
"Unhandled register modifier %#x.\n",
src->modifiers);
4553 for (
j = 0;
j <
src->reg.idx_count; ++
j)
4582 tpf->
stat->fields[stat_field] =
max(tpf->
stat->fields[stat_field], instr->
idx[0]);
4591 tpf->
stat->fields[stat_field] = instr->
idx[0];
4609 ++tpf->
stat->fields[stat_field];
4618 size_t token_position;
4664 modif.
u.aoffimmi.u =
offset->value.u[0].i;
4665 modif.
u.aoffimmi.v = 0;
4666 modif.
u.aoffimmi.w = 0;
4667 if (
offset->node.data_type->dimx > 1)
4668 modif.
u.aoffimmi.v =
offset->value.u[1].i;
4669 if (
offset->node.data_type->dimx > 2)
4670 modif.
u.aoffimmi.w =
offset->value.u[2].i;
4671 if (modif.
u.aoffimmi.u < -8 || modif.
u.aoffimmi.u > 7
4672 || modif.
u.aoffimmi.v < -8 || modif.
u.aoffimmi.v > 7
4673 || modif.
u.aoffimmi.w < -8 || modif.
u.aoffimmi.w > 7)
4696 instr.
srcs[0].reg.idx[0].offset = cbuffer->
reg.id;
4697 instr.
srcs[0].reg.idx[1].offset = cbuffer->
reg.index;
4698 instr.
srcs[0].reg.idx[2].offset = cbuffer->
reg.index;
4699 instr.
srcs[0].reg.idx_count = 3;
4702 instr.
idx[1] = cbuffer->
reg.space;
4707 instr.
srcs[0].reg.idx[0].offset = cbuffer->
reg.index;
4708 instr.
srcs[0].reg.idx[1].offset =
size;
4709 instr.
srcs[0].reg.idx_count = 2;
4742 instr.
dsts[0].reg.idx_count = 3;
4750 instr.
dsts[0].reg.idx_count = 1;
4778 .dsts[0].reg.idx[0].offset =
resource->id +
i,
4779 .dsts[0].reg.idx_count = 1,
4792 "Multisampled texture object declaration needs sample count for profile %u.%u.",
4802 instr.
dsts[0].reg.idx_count = 3;
4810 instr.
dsts[0].reg.idx_count = 1;
4872 .idx = {
temp->register_idx,
temp->register_size,
temp->component_count},
4902 .dsts[0] = semantic->
reg,
4920 .idx = {group_size->
x, group_size->
y, group_size->
z},
5049 memset(&instr, 0,
sizeof(instr));
5062 "Offset must resolve to integer literal in the range -8 to 7.");
5100 reg->u.immconst_u32[0] =
index->value.u[0].u;
5126 memset(&instr, 0,
sizeof(instr));
5127 switch (
load->load_type)
5162 "Offset must resolve to integer literal in the range -8 to 7.");
5205 memset(&instr, 0,
sizeof(instr));
5234 memset(&instr, 0,
sizeof(instr));
5320 if (
var->is_uniform)
5332 memset(&instr, 0,
sizeof(instr));
5340 struct hlsl_constant_value
value;
5389 memset(&instr, 0,
sizeof(instr));
5405 "Offset must resolve to integer literal in the range -8 to 7 for profiles < 5.");
5429 if (
load->sampler.var && !
load->sampler.var->is_uniform)
5431 hlsl_fixme(tpf->
ctx, &
load->node.loc,
"Sample using non-uniform sampler variable.");
5435 if (!
load->resource.var->is_uniform)
5437 hlsl_fixme(tpf->
ctx, &
load->node.loc,
"Load from non-uniform resource variable.");
5441 switch (
load->load_type)
5445 coords, sample_index, texel_offset,
load->sampling_dim);
5498 if (!store->
resource.var->is_uniform)
5500 hlsl_fixme(tpf->
ctx, &store->
node.loc,
"Store to non-uniform resource variable.");
5506 hlsl_fixme(tpf->
ctx, &store->
node.loc,
"Structured buffers store is not implemented.");
5510 memset(&instr, 0,
sizeof(instr));
5537 memset(&instr, 0,
sizeof(instr));
5556 memset(&instr, 0,
sizeof(instr));
5566 memset(&instr, 0,
sizeof(instr));
5573 struct hlsl_constant_value
value = { .u[0].u =
c->value };
5584 memset(&instr, 0,
sizeof(instr));
5592 unsigned int hlsl_swizzle;
5596 memset(&instr, 0,
sizeof(instr));
5625 ERR(
"Invalid destination count %u for vsir instruction %#x (expected %u).\n",
5632 ERR(
"Invalid source count %u for vsir instruction %#x (expected %u).\n",
5651 instr.
dsts[
i].modifiers &= ~VKD3DSPDM_SATURATE;
5778 unsigned int vsir_instr_idx;
5786 hlsl_fixme(tpf->
ctx, &instr->
loc,
"Class %#x should have been lowered or removed.",
5791 if (!instr->
reg.allocated)
5798 switch (instr->
type)
5866 unsigned int extern_resources_count,
i;
5869 size_t token_count_position;
5894 for (
i = 0;
i < extern_resources_count; ++
i)
5931 if (cbuffer->
reg.allocated)
5935 for (
i = 0;
i < extern_resources_count; ++
i)
5969 unsigned int extern_resources_count;
5976 for (
unsigned int i = 0;
i < extern_resources_count; ++
i)
6080 for (
i = 0;
i < tpf.
dxbc.section_count; ++
i)
static const unsigned char reg_size[]
static int list_empty(struct list_entry *head)
static void put_u32(struct bytecode_buffer *buffer, uint32_t value)
unsigned int component_count
enum _D3D_SHADER_VARIABLE_CLASS D3D_SHADER_VARIABLE_CLASS
enum _D3D_SHADER_INPUT_TYPE D3D_SHADER_INPUT_TYPE
@ D3D_SRV_DIMENSION_TEXTURE2D
@ D3D_SRV_DIMENSION_TEXTURECUBEARRAY
@ D3D_SRV_DIMENSION_TEXTURE2DARRAY
@ D3D_SRV_DIMENSION_TEXTURE2DMSARRAY
@ D3D_SRV_DIMENSION_TEXTURECUBE
@ D3D_SRV_DIMENSION_TEXTURE2DMS
@ D3D_SRV_DIMENSION_TEXTURE1D
@ D3D_SRV_DIMENSION_BUFFER
@ D3D_SRV_DIMENSION_TEXTURE3D
@ D3D_SRV_DIMENSION_TEXTURE1DARRAY
enum _D3D_SHADER_VARIABLE_TYPE D3D_SHADER_VARIABLE_TYPE
static const WCHAR version[]
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP void __cdecl qsort(void *, size_t, size_t, int(__cdecl *)(const void *, const void *))
_ACRTIMP size_t __cdecl strnlen(const char *, size_t)
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP int __cdecl strncmp(const char *, const char *, size_t)
int shader_extract_from_dxbc(const struct vkd3d_shader_code *dxbc, struct vkd3d_shader_message_context *message_context, const char *source_name, struct dxbc_shader_desc *desc)
int dxbc_writer_write(struct dxbc_writer *dxbc, struct vkd3d_shader_code *out)
void dxbc_writer_init(struct dxbc_writer *dxbc)
void free_dxbc_shader_desc(struct dxbc_shader_desc *desc)
void dxbc_writer_add_section(struct dxbc_writer *dxbc, uint32_t tag, const void *data, size_t size)
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLenum GLenum GLuint components
GLboolean GLboolean GLboolean b
GLenum GLint GLint * precision
GLuint GLdouble GLdouble GLint GLint order
GLboolean GLboolean GLboolean GLboolean a
GLubyte GLubyte GLubyte GLubyte w
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
enum wined3d_data_type data_type
bool hlsl_type_is_resource(const struct hlsl_type *type)
const char * hlsl_jump_type_to_string(enum hlsl_ir_jump_type type)
void hlsl_fixme(struct hlsl_ctx *ctx, const struct vkd3d_shader_location *loc, const char *fmt,...)
unsigned int hlsl_type_component_count(const struct hlsl_type *type)
uint32_t hlsl_map_swizzle(uint32_t swizzle, unsigned int writemask)
void hlsl_error(struct hlsl_ctx *ctx, const struct vkd3d_shader_location *loc, enum vkd3d_shader_error error, const char *fmt,...)
uint32_t hlsl_swizzle_from_writemask(unsigned int writemask)
unsigned int hlsl_type_get_component_offset(struct hlsl_ctx *ctx, struct hlsl_type *type, unsigned int index, enum hlsl_regset *regset)
struct hlsl_type * hlsl_type_get_component_type(struct hlsl_ctx *ctx, struct hlsl_type *type, unsigned int index)
uint32_t hlsl_combine_swizzles(uint32_t first, uint32_t second, unsigned int dim)
const struct hlsl_type * hlsl_get_multiarray_element_type(const struct hlsl_type *type)
unsigned int hlsl_get_multiarray_size(const struct hlsl_type *type)
struct vkd3d_string_buffer * hlsl_component_to_string(struct hlsl_ctx *ctx, const struct hlsl_ir_var *var, unsigned int index)
struct hlsl_type * hlsl_deref_get_type(struct hlsl_ctx *ctx, const struct hlsl_deref *deref)
const char * hlsl_node_type_to_string(enum hlsl_ir_node_type type)
unsigned int hlsl_combine_writemasks(unsigned int first, unsigned int second)
enum hlsl_regset hlsl_deref_get_regset(struct hlsl_ctx *ctx, const struct hlsl_deref *deref)
static bool hlsl_array_reserve(struct hlsl_ctx *ctx, void **elements, size_t *capacity, size_t element_count, size_t element_size)
@ HLSL_CLASS_COMPUTE_SHADER
@ HLSL_CLASS_RASTERIZER_STATE
@ HLSL_CLASS_RENDER_TARGET_VIEW
@ HLSL_CLASS_VERTEX_SHADER
@ HLSL_CLASS_GEOMETRY_SHADER
@ HLSL_CLASS_DEPTH_STENCIL_VIEW
@ HLSL_CLASS_LAST_NUMERIC
@ HLSL_CLASS_CONSTANT_BUFFER
@ HLSL_CLASS_EFFECT_GROUP
@ HLSL_CLASS_PIXEL_SHADER
@ HLSL_CLASS_DOMAIN_SHADER
@ HLSL_CLASS_DEPTH_STENCIL_STATE
static char * hlsl_strdup(struct hlsl_ctx *ctx, const char *string)
@ HLSL_IR_VSIR_INSTRUCTION_REF
static unsigned int hlsl_sampler_dim_count(enum hlsl_sampler_dim dim)
#define HLSL_MODIFIER_UNORM
#define HLSL_MODIFIER_SNORM
@ HLSL_RESOURCE_GATHER_BLUE
@ HLSL_RESOURCE_SAMPLE_GRAD
@ HLSL_RESOURCE_SAMPLE_CMP
@ HLSL_RESOURCE_SAMPLE_CMP_LZ
@ HLSL_RESOURCE_SAMPLE_LOD_BIAS
@ HLSL_RESOURCE_SAMPLE_PROJ
@ HLSL_RESOURCE_SAMPLE_INFO
@ HLSL_RESOURCE_GATHER_GREEN
@ HLSL_RESOURCE_GATHER_RED
@ HLSL_RESOURCE_SAMPLE_LOD
@ HLSL_RESOURCE_GATHER_ALPHA
struct hlsl_reg hlsl_reg_from_deref(struct hlsl_ctx *ctx, const struct hlsl_deref *deref)
static bool hlsl_is_numeric_type(const struct hlsl_type *type)
static bool hlsl_version_ge(const struct hlsl_ctx *ctx, unsigned int major, unsigned int minor)
@ HLSL_SAMPLER_DIM_1DARRAY
@ HLSL_SAMPLER_DIM_CUBEARRAY
@ HLSL_SAMPLER_DIM_2DMSARRAY
@ HLSL_SAMPLER_DIM_BUFFER
@ HLSL_SAMPLER_DIM_2DARRAY
@ HLSL_SAMPLER_DIM_RAW_BUFFER
@ HLSL_SAMPLER_DIM_COMPARISON
@ HLSL_SAMPLER_DIM_STRUCTURED_BUFFER
unsigned int hlsl_offset_from_deref_safe(struct hlsl_ctx *ctx, const struct hlsl_deref *deref)
#define HLSL_MODIFIERS_MAJORITY_MASK
#define HLSL_MODIFIER_COLUMN_MAJOR
static bool hlsl_version_lt(const struct hlsl_ctx *ctx, unsigned int major, unsigned int minor)
@ HLSL_IR_JUMP_DISCARD_NZ
static void hlsl_release_string_buffer(struct hlsl_ctx *ctx, struct vkd3d_string_buffer *buffer)
struct signature_element * vsir_signature_find_element_for_reg(const struct shader_signature *signature, unsigned int reg_idx, unsigned int write_mask)
bool vsir_program_init(struct vsir_program *program, const struct vkd3d_shader_compile_info *compile_info, const struct vkd3d_shader_version *version, unsigned int reserve, enum vsir_control_flow_type cf_type, enum vsir_normalisation_level normalisation_level)
void vsir_program_cleanup(struct vsir_program *program)
void vsir_register_init(struct vkd3d_shader_register *reg, enum vkd3d_shader_register_type reg_type, enum vkd3d_data_type data_type, unsigned int idx_count)
void vsir_instruction_init(struct vkd3d_shader_instruction *ins, const struct vkd3d_shader_location *location, enum vkd3d_shader_opcode opcode)
#define memcpy(s1, s2, n)
static const BYTE masks[8]
static float(__cdecl *square_half_float)(float x
#define offsetof(TYPE, MEMBER)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
static const struct wined3d_sm4_opcode_info opcode_table[]
static enum wined3d_shader_register_type register_type_table[]
enum vkd3d_shader_sysval_semantic sysval
union constant::@270 value[4]
const uint32_t * byte_code
struct shader_signature input_signature
struct shader_signature patch_constant_signature
struct shader_signature output_signature
struct hlsl_type * component_type
const struct hlsl_buffer * buffer
const struct hlsl_ir_var * var
struct vkd3d_shader_location loc
enum hlsl_buffer_type type
struct vkd3d_shader_message_context * message_context
struct hlsl_src rel_offset
unsigned int const_offset
struct hlsl_block then_block
struct hlsl_src condition
struct hlsl_block else_block
struct hlsl_src condition
enum hlsl_ir_jump_type type
enum hlsl_ir_node_type type
struct hlsl_type * data_type
struct vkd3d_shader_location loc
struct hlsl_src coords value
struct hlsl_deref resource
unsigned int vsir_instr_idx
struct hlsl_type::@5997::@5998 numeric
enum hlsl_sampler_dim sampler_dim
struct hlsl_type::@5997::@5999 record
enum hlsl_type_class class
unsigned int register_count
struct sm4_index_range ranges[MAX_REG_OUTPUT *2]
enum vkd3d_sm4_instruction_modifier type
struct sm4_instruction_modifier::@6016::@6017 aoffimmi
struct vkd3d_shader_dst_param dsts[2]
unsigned int idx_src_count
struct vkd3d_shader_src_param idx_srcs[7]
struct sm4_instruction_modifier modifiers[1]
unsigned int modifier_count
enum vkd3d_sm4_opcode opcode
struct vkd3d_shader_src_param srcs[5]
uint32_t fields[VKD3D_STAT_COUNT]
struct vkd3d_bytecode_buffer * buffer
struct vsir_program * program
struct vkd3d_sm4_lookup_tables lookup
struct vkd3d_shader_code source
struct vkd3d_shader_register reg
struct vkd3d_shader_dst_param dst
unsigned int register_count
struct vkd3d_shader_instruction * elements
struct vkd3d_shader_src_param * src
struct vkd3d_shader_sampler sampler
enum vsir_global_flags global_flags
struct vkd3d_shader_constant_buffer cb
const struct vkd3d_shader_src_param * predicate
struct vsir_thread_group_size thread_group_size
const struct vkd3d_shader_immediate_constant_buffer * icb
enum vkd3d_shader_tessellator_partitioning tessellator_partitioning
struct vkd3d_shader_texel_offset texel_offset
struct vkd3d_shader_tgsm_raw tgsm_raw
struct vkd3d_shader_raw_resource raw_resource
struct vkd3d_shader_register_semantic register_semantic
enum vkd3d_shader_tessellator_output_primitive tessellator_output_primitive
unsigned int resource_stride
enum vkd3d_tessellator_domain tessellator_domain
struct vkd3d_shader_indexable_temp indexable_temp
enum vkd3d_shader_resource_type resource_type
float max_tessellation_factor
union vkd3d_shader_instruction::@6020 declaration
struct vkd3d_shader_function_table_pointer fp
struct vkd3d_shader_tgsm_structured tgsm_structured
enum vkd3d_shader_opcode opcode
enum vkd3d_data_type resource_data_type[VKD3D_VEC4_SIZE]
struct vkd3d_shader_semantic semantic
struct vkd3d_shader_structured_resource structured_resource
struct vkd3d_shader_dst_param * dst
struct vkd3d_shader_index_range index_range
struct vkd3d_shader_primitive_type primitive_type
struct vkd3d_shader_src_param * rel_addr
struct vkd3d_shader_dst_param reg
enum vkd3d_shader_input_sysval_semantic sysval_semantic
enum vkd3d_shader_resource_type resource_type
enum vkd3d_data_type resource_data_type[VKD3D_VEC4_SIZE]
unsigned int sample_count
struct vkd3d_shader_resource resource
enum vkd3d_shader_opcode phase
struct sm4_index_range_array patch_constant_index_ranges
unsigned int output_register_masks[MAX_REG_OUTPUT]
struct vkd3d_sm4_lookup_tables lookup
struct vkd3d_shader_parser p
struct sm4_index_range_array output_index_ranges
struct sm4_index_range_array input_index_ranges
unsigned int input_register_masks[MAX_REG_OUTPUT]
unsigned int patch_constant_register_masks[MAX_REG_OUTPUT]
bool has_control_point_phase
struct vkd3d_shader_register reg
enum vkd3d_shader_src_modifier modifiers
const struct vkd3d_sm4_register_type_info * register_type_info_from_sm4[VKD3D_SM4_REGISTER_TYPE_COUNT]
const struct vkd3d_sm4_register_type_info * register_type_info_from_vkd3d[VKD3DSPR_COUNT]
const struct vkd3d_sm4_opcode_info * opcode_info_from_sm4[VKD3D_SM4_OP_COUNT]
const struct vkd3d_sm4_stat_field_info * stat_field_from_sm4[VKD3D_SM4_OP_COUNT]
const struct vkd3d_sm4_opcode_info * opcode_info_from_vsir[VKD3DSIH_COUNT]
enum vkd3d_shader_opcode handler_idx
char dst_info[SM4_MAX_DST_COUNT]
char src_info[SM4_MAX_SRC_COUNT]
enum vkd3d_sm4_opcode opcode
void(* read_opcode_func)(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
enum vkd3d_shader_register_type vkd3d_type
enum vkd3d_sm4_register_type sm4_type
enum vkd3d_sm4_swizzle_type default_src_swizzle_type
enum vkd3d_sm4_opcode opcode
enum vkd3d_sm4_stat_field field
static void shader_sm5_read_dcl_interface(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static void tpf_write_dcl_tessellator_domain(const struct tpf_compiler *tpf, enum vkd3d_tessellator_domain domain)
#define VKD3D_SM4_WRITEMASK_SHIFT
#define VKD3D_SM4_VERSION_MINOR(version)
static void shader_sm5_read_dcl_tgsm_raw(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static void sm4_src_from_deref(const struct tpf_compiler *tpf, struct vkd3d_shader_src_param *src, const struct hlsl_deref *deref, unsigned int map_writemask, struct sm4_instruction *sm4_instr)
#define VKD3D_SM4_SIF_TEXTURE_COMPONENTS_SHIFT
static D3D_SHADER_INPUT_TYPE sm4_resource_type(const struct hlsl_type *type)
static bool shader_is_sm_5_1(const struct vkd3d_shader_sm4_parser *sm4)
static void write_sm4_ld(const struct tpf_compiler *tpf, const struct hlsl_ir_node *dst, const struct hlsl_deref *resource, const struct hlsl_ir_node *coords, const struct hlsl_ir_node *sample_index, const struct hlsl_ir_node *texel_offset, enum hlsl_sampler_dim dim)
static void uninvert_used_masks(struct shader_signature *signature)
static void shader_sm5_read_dcl_function_table(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static enum vkd3d_sm4_dimension sm4_dimension_from_vsir_dimension(enum vsir_dimension dim)
static void write_sm4_ret(const struct tpf_compiler *tpf)
#define VKD3D_SM4_REGISTER_ORDER_MASK
bool shader_sm4_is_scalar_register(const struct vkd3d_shader_register *reg)
static bool shader_sm4_read_dst_param(struct vkd3d_shader_sm4_parser *priv, const uint32_t **ptr, const uint32_t *end, enum vkd3d_data_type data_type, struct vkd3d_shader_dst_param *dst_param)
static void write_sm4_resource_load(const struct tpf_compiler *tpf, const struct hlsl_ir_resource_load *load)
static void shader_sm4_read_declaration_count(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *sm4)
static void tpf_dcl_thread_group(const struct tpf_compiler *tpf, const struct vsir_thread_group_size *group_size)
static void tpf_write_stat(struct tpf_compiler *tpf)
static void shader_sm4_validate_default_phase_index_ranges(struct vkd3d_shader_sm4_parser *sm4)
static void sm4_write_dst_register(const struct tpf_compiler *tpf, const struct vkd3d_shader_dst_param *dst)
#define VKD3D_SM4_RESOURCE_TYPE_SHIFT
#define VKD3D_SM4_PRIMITIVE_TYPE_SHIFT
static bool shader_sm4_read_reg_idx(struct vkd3d_shader_sm4_parser *priv, const uint32_t **ptr, const uint32_t *end, uint32_t addressing, struct vkd3d_shader_register_index *reg_idx)
static bool register_is_input_output(const struct vkd3d_shader_register *reg)
#define VKD3D_SM4_OPCODE_MASK
static void write_sm4_swizzle(const struct tpf_compiler *tpf, const struct hlsl_ir_swizzle *swizzle)
static void write_sm4_sampleinfo(const struct tpf_compiler *tpf, const struct hlsl_ir_resource_load *load)
@ VKD3D_SM5_OP_DCL_TESSELLATOR_PARTITIONING
@ VKD3D_SM5_OP_GATHER4_PO_C_S
@ VKD3D_SM5_OP_ATOMIC_AND
@ VKD3D_SM5_OP_DERIV_RTY_FINE
@ VKD3D_SM5_OP_DCL_HS_MAX_TESSFACTOR
@ VKD3D_SM5_OP_DCL_INPUT_CONTROL_POINT_COUNT
@ VKD3D_SM4_OP_DCL_RESOURCE
@ VKD3D_SM5_OP_LD_UAV_TYPED_S
@ VKD3D_SM5_OP_CHECK_ACCESS_FULLY_MAPPED
@ VKD3D_SM4_OP_SAMPLE_C_LZ
@ VKD3D_SM4_OP_SHADER_DATA
@ VKD3D_SM5_OP_CUT_STREAM
@ VKD3D_SM4_OP_DCL_GLOBAL_FLAGS
@ VKD3D_SM5_OP_FIRSTBIT_HI
@ VKD3D_SM5_OP_IMM_ATOMIC_IMIN
@ VKD3D_SM4_OP_SAMPLE_GRAD
@ VKD3D_SM5_OP_DCL_GS_INSTANCES
@ VKD3D_SM5_OP_DERIV_RTX_FINE
@ VKD3D_SM4_OP_DCL_INPUT_SIV
@ VKD3D_SM5_OP_GATHER4_PO_C
@ VKD3D_SM5_OP_DCL_TESSELLATOR_OUTPUT_PRIMITIVE
@ VKD3D_SM5_OP_ATOMIC_UMIN
@ VKD3D_SM5_OP_IMM_ATOMIC_XOR
@ VKD3D_SM5_OP_DERIV_RTY_COARSE
@ VKD3D_SM5_OP_IMM_ATOMIC_UMIN
@ VKD3D_SM5_OP_DCL_OUTPUT_CONTROL_POINT_COUNT
@ VKD3D_SM4_OP_DCL_OUTPUT_TOPOLOGY
@ VKD3D_SM5_OP_DCL_FUNCTION_BODY
@ VKD3D_SM5_OP_DCL_TESSELLATOR_DOMAIN
@ VKD3D_SM5_OP_SAMPLE_GRAD_CL_S
@ VKD3D_SM4_OP_DCL_INDEXABLE_TEMP
@ VKD3D_SM5_OP_FIRSTBIT_LO
@ VKD3D_SM5_OP_ATOMIC_XOR
@ VKD3D_SM5_OP_IMM_ATOMIC_UMAX
@ VKD3D_SM5_OP_ATOMIC_UMAX
@ VKD3D_SM5_OP_GATHER4_PO
@ VKD3D_SM4_OP_DCL_INPUT_PS
@ VKD3D_SM5_OP_DCL_RESOURCE_STRUCTURED
@ VKD3D_SM5_OP_IMM_ATOMIC_IMAX
@ VKD3D_SM4_OP_DCL_INDEX_RANGE
@ VKD3D_SM5_OP_DCL_UAV_TYPED
@ VKD3D_SM5_OP_DCL_RESOURCE_RAW
@ VKD3D_SM5_OP_DCL_TGSM_STRUCTURED
@ VKD3D_SM5_OP_ATOMIC_IMIN
@ VKD3D_SM5_OP_SAMPLE_C_LZ_S
@ VKD3D_SM5_OP_DCL_HS_FORK_PHASE_INSTANCE_COUNT
@ VKD3D_SM5_OP_LD_STRUCTURED_S
@ VKD3D_SM4_OP_DCL_INPUT_PS_SIV
@ VKD3D_SM5_OP_ATOMIC_CMP_STORE
@ VKD3D_SM5_OP_HS_FORK_PHASE
@ VKD3D_SM5_OP_SAMPLE_CL_S
@ VKD3D_SM5_OP_STORE_STRUCTURED
@ VKD3D_SM4_OP_SAMPLE_POS
@ VKD3D_SM5_OP_DCL_FUNCTION_TABLE
@ VKD3D_SM4_OP_DCL_CONSTANT_BUFFER
@ VKD3D_SM5_OP_HS_JOIN_PHASE
@ VKD3D_SM5_OP_FIRSTBIT_SHI
@ VKD3D_SM5_OP_GATHER4_C_S
@ VKD3D_SM5_OP_IMM_ATOMIC_EXCH
@ VKD3D_SM5_OP_DCL_INTERFACE
@ VKD3D_SM5_OP_DCL_THREAD_GROUP
@ VKD3D_SM4_OP_DCL_INPUT_SGV
@ VKD3D_SM5_OP_DCL_HS_JOIN_PHASE_INSTANCE_COUNT
@ VKD3D_SM5_OP_DERIV_RTX_COARSE
@ VKD3D_SM5_OP_LD_UAV_TYPED
@ VKD3D_SM5_OP_SAMPLE_C_CL_S
@ VKD3D_SM5_OP_IMM_ATOMIC_CMP_EXCH
@ VKD3D_SM4_OP_DCL_VERTICES_OUT
@ VKD3D_SM5_OP_DCL_TGSM_RAW
@ VKD3D_SM4_OP_DCL_INPUT_PRIMITIVE
@ VKD3D_SM5_OP_ATOMIC_IADD
@ VKD3D_SM5_OP_IMM_ATOMIC_CONSUME
@ VKD3D_SM4_OP_DCL_OUTPUT
@ VKD3D_SM5_OP_ATOMIC_IMAX
@ VKD3D_SM5_OP_DCL_UAV_RAW
@ VKD3D_SM4_OP_DCL_INPUT_PS_SGV
@ VKD3D_SM5_OP_SAMPLE_B_CL_S
@ VKD3D_SM5_OP_LD_STRUCTURED
@ VKD3D_SM5_OP_HS_CONTROL_POINT_PHASE
@ VKD3D_SM4_OP_SAMPLE_INFO
@ VKD3D_SM5_OP_EMIT_STREAM
@ VKD3D_SM5_OP_IMM_ATOMIC_ALLOC
@ VKD3D_SM4_OP_DCL_SAMPLER
@ VKD3D_SM5_OP_IMM_ATOMIC_IADD
@ VKD3D_SM5_OP_EVAL_CENTROID
@ VKD3D_SM4_OP_SAMPLE_LOD
@ VKD3D_SM5_OP_IMM_ATOMIC_OR
@ VKD3D_SM5_OP_STORE_UAV_TYPED
@ VKD3D_SM5_OP_DCL_STREAM
@ VKD3D_SM5_OP_SAMPLE_LOD_S
@ VKD3D_SM5_OP_DCL_UAV_STRUCTURED
@ VKD3D_SM4_OP_DCL_OUTPUT_SIV
@ VKD3D_SM5_OP_GATHER4_PO_S
@ VKD3D_SM5_OP_IMM_ATOMIC_AND
@ VKD3D_SM5_OP_EVAL_SAMPLE_INDEX
static void shader_sm4_read_instruction(struct vkd3d_shader_sm4_parser *sm4, struct vkd3d_shader_instruction *ins)
#define VKD3D_SM4_INSTRUCTION_LENGTH_SHIFT
#define VKD3D_SM4_WRITEMASK_MASK
vkd3d_sm4_extended_operand_type
@ VKD3D_SM4_EXTENDED_OPERAND_MODIFIER
@ VKD3D_SM4_EXTENDED_OPERAND_NONE
static enum vkd3d_sm4_resource_type sm4_resource_dimension(const struct hlsl_type *type)
static void write_sm4_resource_store(const struct tpf_compiler *tpf, const struct hlsl_ir_resource_store *store)
static uint32_t sm4_encode_instruction_modifier(const struct sm4_instruction_modifier *imod)
#define VKD3D_SM5_SYNC_FLAGS_SHIFT
#define VKD3D_SM4_AOFFIMMI_W_MASK
static uint32_t sm4_encode_register(const struct tpf_compiler *tpf, const struct vkd3d_shader_register *reg, enum vkd3d_sm4_swizzle_type sm4_swizzle_type, uint32_t sm4_swizzle)
static bool shader_sm4_read_src_param(struct vkd3d_shader_sm4_parser *priv, const uint32_t **ptr, const uint32_t *end, enum vkd3d_data_type data_type, struct vkd3d_shader_src_param *src_param)
static void shader_sm4_read_dcl_global_flags(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *sm4)
static void sm4_register_from_node(struct vkd3d_shader_register *reg, uint32_t *writemask, const struct hlsl_ir_node *instr)
#define VKD3D_SM4_SWIZZLE_SHIFT
static const struct vkd3d_sm4_opcode_info * get_info_from_vsir_opcode(const struct vkd3d_sm4_lookup_tables *lookup, enum vkd3d_shader_opcode vsir_opcode)
static void sm4_free_extern_resources(struct extern_resource *extern_resources, unsigned int count)
vkd3d_sm4_input_primitive_type
@ VKD3D_SM5_INPUT_PT_PATCH27
@ VKD3D_SM5_INPUT_PT_PATCH4
@ VKD3D_SM5_INPUT_PT_PATCH14
@ VKD3D_SM5_INPUT_PT_PATCH2
@ VKD3D_SM5_INPUT_PT_PATCH12
@ VKD3D_SM5_INPUT_PT_PATCH21
@ VKD3D_SM5_INPUT_PT_PATCH10
@ VKD3D_SM5_INPUT_PT_PATCH22
@ VKD3D_SM4_INPUT_PT_LINE
@ VKD3D_SM5_INPUT_PT_PATCH13
@ VKD3D_SM5_INPUT_PT_PATCH8
@ VKD3D_SM5_INPUT_PT_PATCH16
@ VKD3D_SM5_INPUT_PT_PATCH28
@ VKD3D_SM5_INPUT_PT_PATCH5
@ VKD3D_SM5_INPUT_PT_PATCH15
@ VKD3D_SM4_INPUT_PT_LINEADJ
@ VKD3D_SM5_INPUT_PT_PATCH20
@ VKD3D_SM5_INPUT_PT_PATCH6
@ VKD3D_SM5_INPUT_PT_PATCH29
@ VKD3D_SM5_INPUT_PT_PATCH11
@ VKD3D_SM5_INPUT_PT_PATCH7
@ VKD3D_SM5_INPUT_PT_PATCH1
@ VKD3D_SM5_INPUT_PT_PATCH3
@ VKD3D_SM5_INPUT_PT_PATCH18
@ VKD3D_SM5_INPUT_PT_PATCH32
@ VKD3D_SM5_INPUT_PT_PATCH25
@ VKD3D_SM5_INPUT_PT_PATCH9
@ VKD3D_SM5_INPUT_PT_PATCH17
@ VKD3D_SM5_INPUT_PT_PATCH19
@ VKD3D_SM4_INPUT_PT_POINT
@ VKD3D_SM4_INPUT_PT_TRIANGLE
@ VKD3D_SM5_INPUT_PT_PATCH23
@ VKD3D_SM5_INPUT_PT_PATCH30
@ VKD3D_SM5_INPUT_PT_PATCH31
@ VKD3D_SM5_INPUT_PT_PATCH24
@ VKD3D_SM5_INPUT_PT_PATCH26
@ VKD3D_SM4_INPUT_PT_TRIANGLEADJ
#define VKD3D_SM5_PRECISE_SHIFT
static void sm4_write_register_index(const struct tpf_compiler *tpf, const struct vkd3d_shader_register *reg, unsigned int j)
#define VKD3D_SM4_TYPE_COMPONENT(com, i)
#define VKD3D_SM4_EXTENDED_OPERAND_TYPE_MASK
#define SM4_MAX_DST_COUNT
#define VKD3D_SM4_DIMENSION_MASK
#define VKD3D_SM4_REGISTER_PRECISION_SHIFT
static void shader_sm5_read_dcl_uav_raw(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static D3D_SRV_DIMENSION sm4_rdef_resource_dimension(const struct hlsl_type *type)
static void tpf_write_dcl_tessellator_partitioning(const struct tpf_compiler *tpf, enum vkd3d_shader_tessellator_partitioning partitioning)
static void tpf_write_hs_control_point_phase(const struct tpf_compiler *tpf)
vkd3d_sm4_output_primitive_type
@ VKD3D_SM4_OUTPUT_PT_POINTLIST
@ VKD3D_SM4_OUTPUT_PT_TRIANGLESTRIP
@ VKD3D_SM4_OUTPUT_PT_LINESTRIP
static void shader_sm5_read_dcl_tessellator_partitioning(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
#define VKD3D_SM4_INSTRUCTION_MODIFIER
static void write_sm4_dcl_global_flags(const struct tpf_compiler *tpf, uint32_t flags)
static void write_sm4_block(struct tpf_compiler *tpf, const struct hlsl_block *block)
#define VKD3D_SM4_AOFFIMMI_V_SHIFT
static enum vkd3d_data_type map_data_type(char t)
#define VKD3D_SM4_AOFFIMMI_V_MASK
#define VKD3D_SM4_ADDRESSING_SHIFT2
static void tpf_write_signature(struct tpf_compiler *tpf, const struct shader_signature *signature, uint32_t tag)
static void add_section(struct hlsl_ctx *ctx, struct dxbc_writer *dxbc, uint32_t tag, struct vkd3d_bytecode_buffer *buffer)
static void init_sm4_lookup_tables(struct vkd3d_sm4_lookup_tables *lookup)
#define VKD3D_SM5_CONTROL_POINT_COUNT_SHIFT
#define VKD3D_SM4_ADDRESSING_MASK1
#define VKD3D_SM4_CONDITIONAL_NZ
static void shader_sm4_read_dcl_constant_buffer(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
#define VKD3D_SM5_MODIFIER_RESOURCE_TYPE_MASK
@ VKD3D_SM4_RESOURCE_TEXTURE_CUBEARRAY
@ VKD3D_SM4_RESOURCE_TEXTURE_3D
@ VKD3D_SM4_RESOURCE_TEXTURE_2DARRAY
@ VKD3D_SM4_RESOURCE_RAW_BUFFER
@ VKD3D_SM4_RESOURCE_BUFFER
@ VKD3D_SM4_RESOURCE_TEXTURE_1D
@ VKD3D_SM4_RESOURCE_TEXTURE_2D
@ VKD3D_SM4_RESOURCE_TEXTURE_2DMS
@ VKD3D_SM4_RESOURCE_TEXTURE_CUBE
@ VKD3D_SM4_RESOURCE_STRUCTURED_BUFFER
@ VKD3D_SM4_RESOURCE_TEXTURE_2DMSARRAY
@ VKD3D_SM4_RESOURCE_TEXTURE_1DARRAY
static void shader_sm5_read_dcl_tgsm_structured(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
#define VKD3D_SM5_UAV_FLAGS_SHIFT
static D3D_SHADER_VARIABLE_CLASS sm4_class(const struct hlsl_type *type)
#define VKD3D_SM4_AOFFIMMI_U_MASK
static void shader_sm5_read_dcl_function_body(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static void shader_sm5_read_dcl_thread_group(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *sm4)
vkd3d_sm4_register_modifier
@ VKD3D_SM4_REGISTER_MODIFIER_NEGATE
@ VKD3D_SM4_REGISTER_MODIFIER_NONE
@ VKD3D_SM4_REGISTER_MODIFIER_ABS
@ VKD3D_SM4_REGISTER_MODIFIER_ABS_NEGATE
static void write_sm4_loop(struct tpf_compiler *tpf, const struct hlsl_ir_loop *loop)
static void shader_sm4_read_case_condition(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static void write_sm4_dcl_textures(const struct tpf_compiler *tpf, const struct extern_resource *resource, bool uav)
static void write_sm4_load(const struct tpf_compiler *tpf, const struct hlsl_ir_load *load)
#define VKD3D_SM4_SAMPLER_MODE_MASK
@ VKD3D_STAT_DCL_GS_INSTANCES
@ VKD3D_STAT_DCL_OUTPUT_TOPOLOGY
@ VKD3D_STAT_TESS_OUTPUT_PRIMITIVE
@ VKD3D_STAT_DCL_INPUT_PRIMITIVE
@ VKD3D_STAT_TESS_CONTROL_POINT_COUNT
@ VKD3D_STAT_TESS_PARTITIONING
@ VKD3D_STAT_DCL_VERTICES_OUT
static void write_sm4_switch(struct tpf_compiler *tpf, const struct hlsl_ir_switch *s)
static void shader_sm4_read_declaration_dst(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static enum vkd3d_sm4_stat_field get_stat_field_from_sm4_opcode(const struct vkd3d_sm4_lookup_tables *lookup, enum vkd3d_sm4_opcode sm4_opcode)
#define VKD3D_SM4_INTERPOLATION_MODE_SHIFT
#define VKD3D_SM4_VERSION_MAJOR(version)
static D3D_SHADER_VARIABLE_TYPE sm4_base_type(const struct hlsl_type *type)
#define VKD3D_SM4_INDEX_TYPE_MASK
#define VKD3D_SM4_PRIMITIVE_TYPE_MASK
static int sm4_compare_extern_resources(const void *a, const void *b)
#define VKD3D_SM4_REGISTER_ORDER_SHIFT
static bool get_insidetessfactor_sysval_semantic(enum vkd3d_shader_sysval_semantic *semantic, enum vkd3d_tessellator_domain domain, uint32_t index)
#define VKD3D_SM4_INSTRUCTION_FLAGS_SHIFT
static void sm4_src_from_node(const struct tpf_compiler *tpf, struct vkd3d_shader_src_param *src, const struct hlsl_ir_node *instr, uint32_t map_writemask)
int tpf_parse(const struct vkd3d_shader_compile_info *compile_info, uint64_t config_flags, struct vkd3d_shader_message_context *message_context, struct vsir_program *program)
static uint32_t mask_from_swizzle(uint32_t swizzle)
static void shader_sm5_read_dcl_tessellator_domain(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static void shader_sm5_read_dcl_tessellator_output_primitive(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
vkd3d_sm4_register_precision
@ VKD3D_SM4_REGISTER_PRECISION_MIN_FLOAT_10
@ VKD3D_SM4_REGISTER_PRECISION_MIN_FLOAT_16
@ VKD3D_SM4_REGISTER_PRECISION_DEFAULT
@ VKD3D_SM4_REGISTER_PRECISION_MIN_INT_16
@ VKD3D_SM4_REGISTER_PRECISION_MIN_UINT_16
static bool shader_sm4_read_register_space(struct vkd3d_shader_sm4_parser *priv, const uint32_t **ptr, const uint32_t *end, unsigned int *register_space)
#define VKD3D_SM4_REGISTER_PRECISION_MASK
@ VKD3D_SM4_DIMENSION_VEC4
@ VKD3D_SM4_DIMENSION_NONE
@ VKD3D_SM4_DIMENSION_SCALAR
static void tpf_write_shader_function(struct tpf_compiler *tpf, struct hlsl_ir_function_decl *func)
static void write_sm4_store(const struct tpf_compiler *tpf, const struct hlsl_ir_store *store)
static void tpf_write_shdr(struct tpf_compiler *tpf, struct hlsl_ir_function_decl *entry_func)
static void tpf_dcl_temps(const struct tpf_compiler *tpf, unsigned int count)
#define VKD3D_SM5_TESSELLATOR_SHIFT
#define VKD3D_SM4_SCALAR_DIM_SHIFT
static void write_sm4_rdef(struct hlsl_ctx *ctx, struct dxbc_writer *dxbc)
#define VKD3D_SM4_SHADER_DATA_TYPE_SHIFT
static bool shader_sm4_init(struct vkd3d_shader_sm4_parser *sm4, struct vsir_program *program, const uint32_t *byte_code, size_t byte_code_size, const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_message_context *message_context)
#define VKD3D_SM5_CONTROL_POINT_COUNT_MASK
static void sm4_update_stat_counters(const struct tpf_compiler *tpf, const struct sm4_instruction *instr)
static enum vkd3d_shader_register_precision register_precision_table[]
static void sm4_dst_from_node(struct vkd3d_shader_dst_param *dst, const struct hlsl_ir_node *instr)
#define VKD3D_SM5_MODIFIER_RESOURCE_TYPE_SHIFT
static void tpf_write_dcl_output_control_point_count(const struct tpf_compiler *tpf, const uint32_t count)
static void tpf_dcl_indexable_temp(const struct tpf_compiler *tpf, const struct vkd3d_shader_indexable_temp *temp)
#define VKD3D_SM5_TESSELLATOR_MASK
enum vkd3d_primitive_type vkd3d_type
static enum vsir_dimension vsir_dimension_from_sm4_dimension(enum vkd3d_sm4_dimension dim)
static uint32_t swizzle_from_sm4(uint32_t s)
static bool shader_sm4_read_param(struct vkd3d_shader_sm4_parser *priv, const uint32_t **ptr, const uint32_t *end, enum vkd3d_data_type data_type, struct vkd3d_shader_register *param, enum vkd3d_shader_src_modifier *modifier)
#define VKD3D_SM4_MODIFIER_MASK
int tpf_compile(struct vsir_program *program, uint64_t config_flags, struct vkd3d_shader_code *out, struct vkd3d_shader_message_context *message_context, struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_func)
unsigned int control_point_count
static void shader_sm4_read_shader_data(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
#define VKD3D_SM5_MODIFIER_DATA_TYPE_MASK
static int signature_element_pointer_compare(const void *x, const void *y)
static void shader_sm4_read_dcl_index_range(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
#define VKD3D_SM4_EXTENDED_OPERAND
#define VKD3D_SM4_SCALAR_DIM_MASK
@ VKD3D_SM4_DATA_CONTINUED
static bool shader_sm4_validate_input_output_register(struct vkd3d_shader_sm4_parser *priv, const struct vkd3d_shader_register *reg, unsigned int mask)
#define VKD3D_SM4_ADDRESSING_MASK2
#define VKD3D_SM5_PRECISE_MASK
@ VKD3D_SM5_RT_PATCH_CONSTANT_DATA
@ VKD3D_SM5_RT_DOMAIN_LOCATION
@ VKD3D_SM5_RT_DEPTHOUT_GREATER_EQUAL
@ VKD3D_SM5_RT_OUTPUT_CONTROL_POINT_ID
@ VKD3D_SM4_RT_INDEXABLE_TEMP
@ VKD3D_SM5_RT_JOIN_INSTANCE_ID
@ VKD3D_SM4_REGISTER_TYPE_COUNT
@ VKD3D_SM5_RT_THREAD_GROUP_ID
@ VKD3D_SM5_RT_OUTPUT_STENCIL_REF
@ VKD3D_SM4_RT_IMMCONSTBUFFER
@ VKD3D_SM5_RT_OUTPUT_CONTROL_POINT
@ VKD3D_SM5_RT_LOCAL_THREAD_ID
@ VKD3D_SM4_RT_RASTERIZER
@ VKD3D_SM5_RT_GS_INSTANCE_ID
@ VKD3D_SM5_RT_SHARED_MEMORY
@ VKD3D_SM4_RT_IMMCONST64
@ VKD3D_SM5_RT_DEPTHOUT_LESS_EQUAL
@ VKD3D_SM5_RT_FUNCTION_BODY
@ VKD3D_SM4_RT_CONSTBUFFER
@ VKD3D_SM5_RT_FUNCTION_POINTER
@ VKD3D_SM5_RT_INPUT_CONTROL_POINT
@ VKD3D_SM5_RT_LOCAL_THREAD_INDEX
@ VKD3D_SM5_RT_FORK_INSTANCE_ID
static const char * string_skip_tag(const char *string)
static void tpf_write_dcl_input_control_point_count(const struct tpf_compiler *tpf, const uint32_t count)
#define VKD3D_SM4_INTERPOLATION_MODE_MASK
#define VKD3D_SM4_ADDRESSING_RELATIVE
static void shader_sm5_read_fcall(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static void shader_sm5_read_dcl_hs_max_tessfactor(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static void shader_sm4_read_dcl_output_topology(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static void write_sm4_gather(const struct tpf_compiler *tpf, const struct hlsl_ir_node *dst, const struct hlsl_deref *resource, const struct hlsl_deref *sampler, const struct hlsl_ir_node *coords, uint32_t swizzle, const struct hlsl_ir_node *texel_offset)
bool sm4_register_from_semantic_name(const struct vkd3d_shader_version *version, const char *semantic_name, bool output, enum vkd3d_shader_register_type *type, bool *has_idx)
#define VKD3D_SM4_RESOURCE_TYPE_MASK
static enum vkd3d_data_type data_type_table[]
#define VKD3D_SM5_FP_ARRAY_SIZE_SHIFT
static void tpf_write_sfi0(struct tpf_compiler *tpf)
static void tpf_dcl_semantic(const struct tpf_compiler *tpf, enum vkd3d_sm4_opcode opcode, const struct vkd3d_shader_dst_param *dst, uint32_t interpolation_flags)
static void tpf_simple_instruction(struct tpf_compiler *tpf, const struct vkd3d_shader_instruction *ins)
#define VKD3D_SM4_SHADER_DATA_TYPE_MASK
static const struct vkd3d_sm4_opcode_info * get_info_from_sm4_opcode(const struct vkd3d_sm4_lookup_tables *lookup, enum vkd3d_sm4_opcode sm4_opcode)
static void shader_sm4_read_dcl_indexable_temp(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static void shader_sm5_read_control_point_count(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *sm4)
static void tpf_write_dcl_tessellator_output_primitive(const struct tpf_compiler *tpf, enum vkd3d_shader_tessellator_output_primitive output_primitive)
#define VKD3D_SM4_RESOURCE_SAMPLE_COUNT_MASK
static void sm4_src_from_constant_value(struct vkd3d_shader_src_param *src, const struct hlsl_constant_value *value, unsigned int width, unsigned int map_writemask)
#define VKD3D_SM5_UAV_FLAGS_MASK
#define VKD3D_SM4_SWIZZLE_MASK
static enum vkd3d_sm4_swizzle_type vkd3d_sm4_get_default_swizzle_type(const struct vkd3d_sm4_lookup_tables *lookup, enum vkd3d_shader_register_type vkd3d_type)
@ VKD3D_SM4_SWIZZLE_SCALAR
@ VKD3D_SM4_SWIZZLE_INVALID
@ VKD3D_SM4_SWIZZLE_DEFAULT
static void shader_sm4_read_conditional_op(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
#define VKD3D_SM5_MODIFIER_RESOURCE_STRIDE_MASK
#define VKD3D_SM5_FP_TABLE_COUNT_MASK
static const struct @6015 input_primitive_type_table[]
#define VKD3D_SM4_INSTRUCTION_FLAGS_MASK
#define VKD3D_SM4_INSTRUCTION_FLAG_SATURATE
vkd3d_sm4_shader_data_type
@ VKD3D_SM4_SHADER_DATA_IMMEDIATE_CONSTANT_BUFFER
@ VKD3D_SM4_SHADER_DATA_MESSAGE
static unsigned int get_component_index_from_default_initializer_index(struct hlsl_type *type, unsigned int index)
static void shader_sm5_read_sync(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static void tpf_write_hs_decls(const struct tpf_compiler *tpf)
static const struct vkd3d_sm4_register_type_info * get_info_from_vkd3d_register_type(const struct vkd3d_sm4_lookup_tables *lookup, enum vkd3d_shader_register_type vkd3d_type)
#define VKD3D_SM4_REGISTER_TYPE_MASK
static void shader_sm5_read_dcl_resource_structured(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static bool shader_sm4_parser_validate_signature(struct vkd3d_shader_sm4_parser *sm4, const struct shader_signature *signature, unsigned int *masks, const char *name)
static void write_sm4_dcl_constant_buffer(const struct tpf_compiler *tpf, const struct hlsl_buffer *cbuffer)
static bool sm4_parser_is_in_fork_or_join_phase(const struct vkd3d_shader_sm4_parser *sm4)
static void shader_sm5_read_dcl_resource_raw(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static enum vkd3d_primitive_type output_primitive_type_table[]
static void shader_sm4_set_descriptor_register_range(struct vkd3d_shader_sm4_parser *sm4, const struct vkd3d_shader_register *reg, struct vkd3d_shader_register_range *range)
static void shader_sm4_read_dcl_sampler(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static enum vkd3d_sm4_data_type sm4_data_type(const struct hlsl_type *type)
#define VKD3D_SM4_ADDRESSING_MASK0
static void shader_sm4_read_instruction_modifier(uint32_t modifier, struct vkd3d_shader_instruction *ins)
static void write_sm4_dcl_samplers(const struct tpf_compiler *tpf, const struct extern_resource *resource)
#define VKD3D_SM4_REGISTER_MODIFIER_SHIFT
static bool register_is_control_point_input(const struct vkd3d_shader_register *reg, const struct vkd3d_shader_sm4_parser *priv)
#define VKD3D_SM4_ADDRESSING_SHIFT0
#define VKD3D_SM4_REGISTER_TYPE_SHIFT
#define VKD3D_SM4_REGISTER_NON_UNIFORM_MASK
static void tpf_dcl_siv_semantic(const struct tpf_compiler *tpf, enum vkd3d_sm4_opcode opcode, const struct vkd3d_shader_register_semantic *semantic, uint32_t interpolation_flags)
static void shader_sm5_read_dcl_uav_structured(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
#define VKD3D_SM4_REQUIRES_ROVS
@ VKD3D_SM4_SAMPLER_COMPARISON
@ VKD3D_SM4_SAMPLER_DEFAULT
static void shader_sm4_read_dcl_input_ps_siv(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
#define VKD3D_SM4_RESOURCE_SAMPLE_COUNT_SHIFT
static void shader_sm4_read_dcl_input_primitive(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *sm4)
#define VKD3D_SM4_GLOBAL_FLAGS_MASK
static unsigned int opcode_info_get_dst_count(const struct vkd3d_sm4_opcode_info *info)
#define VKD3D_SM5_SYNC_FLAGS_MASK
static void tpf_write_hs_fork_phase(const struct tpf_compiler *tpf)
#define SM4_MAX_SRC_COUNT
static void write_sm4_instruction(const struct tpf_compiler *tpf, const struct sm4_instruction *instr)
static int index_range_compare(const void *a, const void *b)
#define VKD3D_SM4_SAMPLER_MODE_SHIFT
static bool var_is_user_input(const struct vkd3d_shader_version *version, const struct hlsl_ir_var *var)
#define VKD3D_SM4_SWIZZLE_TYPE_SHIFT
static void shader_sm4_read_dcl_input_ps(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static void write_sm4_type(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *buffer, struct hlsl_type *type)
static const struct vkd3d_sm4_register_type_info * get_info_from_sm4_register_type(const struct vkd3d_sm4_lookup_tables *lookup, enum vkd3d_sm4_register_type sm4_type)
static void write_sm4_sample(const struct tpf_compiler *tpf, const struct hlsl_ir_resource_load *load)
static uint32_t swizzle_to_sm4(uint32_t s)
vkd3d_sm4_instruction_modifier
@ VKD3D_SM4_MODIFIER_AOFFIMMI
@ VKD3D_SM5_MODIFIER_DATA_TYPE
@ VKD3D_SM5_MODIFIER_RESOURCE_TYPE
bool sm4_sysval_semantic_from_semantic_name(enum vkd3d_shader_sysval_semantic *sysval_semantic, const struct vkd3d_shader_version *version, bool semantic_compat_mapping, enum vkd3d_tessellator_domain domain, const char *semantic_name, unsigned int semantic_idx, bool output, bool is_patch_constant_func)
#define VKD3D_SM4_REGISTER_MODIFIER_MASK
static void shader_sm4_read_dcl_resource(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static unsigned int sm4_get_index_addressing_from_reg(const struct vkd3d_shader_register *reg, unsigned int i)
static void sm4_register_from_deref(const struct tpf_compiler *tpf, struct vkd3d_shader_register *reg, uint32_t *writemask, const struct hlsl_deref *deref, struct sm4_instruction *sm4_instr)
static bool get_tessfactor_sysval_semantic(enum vkd3d_shader_sysval_semantic *semantic, enum vkd3d_tessellator_domain domain, uint32_t index)
#define VKD3D_SM4_DIMENSION_SHIFT
static void write_sm4_jump(const struct tpf_compiler *tpf, const struct hlsl_ir_jump *jump)
#define VKD3D_SM4_AOFFIMMI_U_SHIFT
#define VKD3D_SM4_AOFFIMMI_W_SHIFT
static bool encode_texel_offset_as_aoffimmi(struct sm4_instruction *instr, const struct hlsl_ir_node *texel_offset)
static void sm4_write_src_register(const struct tpf_compiler *tpf, const struct vkd3d_shader_src_param *src)
#define VKD3D_SM4_ADDRESSING_SHIFT1
static void sm4_numeric_register_from_deref(struct hlsl_ctx *ctx, struct vkd3d_shader_register *reg, enum vkd3d_shader_register_type type, uint32_t *writemask, const struct hlsl_deref *deref, struct sm4_instruction *sm4_instr)
#define VKD3D_SM4_GLOBAL_FLAGS_SHIFT
static enum vkd3d_shader_resource_type resource_type_table[]
#define VKD3D_SM4_SWIZZLE_TYPE_MASK
static void shader_sm4_read_declaration_register_semantic(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
static void tpf_handle_instruction(struct tpf_compiler *tpf, const struct vkd3d_shader_instruction *ins)
#define VKD3D_SM4_INSTRUCTION_LENGTH_MASK
static unsigned int opcode_info_get_src_count(const struct vkd3d_sm4_opcode_info *info)
static void write_sm4_if(struct tpf_compiler *tpf, const struct hlsl_ir_if *iff)
static void write_sm4_resinfo(const struct tpf_compiler *tpf, const struct hlsl_ir_resource_load *load)
static struct extern_resource * sm4_get_extern_resources(struct hlsl_ctx *ctx, unsigned int *count)
#define VKD3D_SM5_MODIFIER_RESOURCE_STRIDE_SHIFT
#define VKD3D_SM4_ADDRESSING_OFFSET
#define VKD3D_SM5_MODIFIER_DATA_TYPE_SHIFT
static uint16_t vkd3d_make_u16(uint8_t low, uint8_t high)
static uint32_t vkd3d_make_u32(uint16_t low, uint16_t high)
#define vkd3d_unreachable()
static bool vkd3d_bitmask_is_contiguous(unsigned int mask)
#define VKD3D_ASSERT(cond)
static int ascii_strcasecmp(const char *a, const char *b)
static int ascii_strncasecmp(const char *a, const char *b, size_t n)
static int vkd3d_u32_compare(uint32_t x, uint32_t y)
static void * vkd3d_calloc(size_t count, size_t size)
static void vkd3d_free(void *ptr)
static void * vkd3d_malloc(size_t size)
static uint32_t vkd3d_shader_create_swizzle(enum vkd3d_shader_swizzle_component x, enum vkd3d_shader_swizzle_component y, enum vkd3d_shader_swizzle_component z, enum vkd3d_shader_swizzle_component w)
VKD3D_SHADER_API const char * vkd3d_shader_get_version(unsigned int *major, unsigned int *minor)
VKD3D_SHADER_API void vkd3d_shader_free_shader_code(struct vkd3d_shader_code *code)
vkd3d_shader_sysval_semantic
@ VKD3D_SHADER_SV_VERTEX_ID
@ VKD3D_SHADER_SV_RENDER_TARGET_ARRAY_INDEX
@ VKD3D_SHADER_SV_PRIMITIVE_ID
@ VKD3D_SHADER_SV_COVERAGE
@ VKD3D_SHADER_SV_TESS_FACTOR_TRIEDGE
@ VKD3D_SHADER_SV_TESS_FACTOR_LINEDET
@ VKD3D_SHADER_SV_TESS_FACTOR_QUADEDGE
@ VKD3D_SHADER_SV_IS_FRONT_FACE
@ VKD3D_SHADER_SV_VIEWPORT_ARRAY_INDEX
@ VKD3D_SHADER_SV_TESS_FACTOR_QUADINT
@ VKD3D_SHADER_SV_TESS_FACTOR_TRIINT
@ VKD3D_SHADER_SV_TESS_FACTOR_LINEDEN
@ VKD3D_SHADER_SV_INSTANCE_ID
@ VKD3D_SHADER_SV_SAMPLE_INDEX
@ VKD3D_SHADER_SV_POSITION
vkd3d_shader_tessellator_output_primitive
vkd3d_shader_resource_type
@ VKD3D_SHADER_RESOURCE_NONE
@ VKD3D_SHADER_RESOURCE_TEXTURE_2DARRAY
@ VKD3D_SHADER_RESOURCE_TEXTURE_2DMS
@ VKD3D_SHADER_RESOURCE_TEXTURE_3D
@ VKD3D_SHADER_RESOURCE_TEXTURE_1DARRAY
@ VKD3D_SHADER_RESOURCE_BUFFER
@ VKD3D_SHADER_RESOURCE_TEXTURE_CUBE
@ VKD3D_SHADER_RESOURCE_TEXTURE_1D
@ VKD3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY
@ VKD3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY
@ VKD3D_SHADER_RESOURCE_TEXTURE_2D
vkd3d_shader_tessellator_partitioning
#define VKD3D_SHADER_SWIZZLE(x, y, z, w)
#define VKD3D_SHADER_NO_SWIZZLE
bool shader_instruction_array_add_icb(struct vkd3d_shader_instruction_array *instructions, struct vkd3d_shader_immediate_constant_buffer *icb)
size_t bytecode_reserve_bytes(struct vkd3d_bytecode_buffer *buffer, size_t size)
size_t bytecode_align(struct vkd3d_bytecode_buffer *buffer)
void shader_signature_cleanup(struct shader_signature *signature)
void set_u32(struct vkd3d_bytecode_buffer *buffer, size_t offset, uint32_t value)
void vkd3d_shader_parser_init(struct vkd3d_shader_parser *parser, struct vsir_program *program, struct vkd3d_shader_message_context *message_context, const char *source_name)
bool shader_instruction_array_reserve(struct vkd3d_shader_instruction_array *instructions, unsigned int reserve)
vkd3d_shader_src_modifier
static uint32_t vsir_swizzle_64_from_32(uint32_t swizzle32)
@ VKD3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS
@ VKD3DSGF_FORCE_EARLY_DEPTH_STENCIL
static bool data_type_is_64_bit(enum vkd3d_data_type data_type)
static bool vkd3d_shader_ver_ge(const struct vkd3d_shader_version *v, unsigned int major, unsigned int minor)
static bool vsir_register_is_descriptor(const struct vkd3d_shader_register *reg)
@ VKD3D_SHADER_TYPE_VERTEX
@ VKD3D_SHADER_TYPE_GEOMETRY
@ VKD3D_SHADER_TYPE_COMPUTE
@ VKD3D_SHADER_TYPE_COUNT
@ VKD3D_SHADER_TYPE_PIXEL
@ VKD3D_SHADER_TYPE_DOMAIN
static struct vkd3d_shader_dst_param * vsir_program_get_dst_params(struct vsir_program *program, unsigned int count)
#define VKD3DSP_WRITEMASK_3
vkd3d_shader_register_type
@ VKD3DSPR_INCONTROLPOINT
@ VKD3DSPR_GROUPSHAREDMEM
@ VKD3DSPR_FUNCTIONPOINTER
@ VKD3DSPR_LOCALTHREADINDEX
@ VKD3DSPR_OUTCONTROLPOINT
@ VKD3DSPR_IMMCONSTBUFFER
@ VKD3DSUF_RASTERISER_ORDERED_VIEW
#define VKD3DSI_INDEXED_DYNAMIC
@ VKD3D_SHADER_ERROR_HLSL_INVALID_TEXEL_OFFSET
@ VKD3D_SHADER_ERROR_TPF_INVALID_INDEX_RANGE_DCL
@ VKD3D_SHADER_ERROR_HLSL_INVALID_TYPE
@ VKD3D_SHADER_ERROR_TPF_INVALID_REGISTER_SWIZZLE
@ VKD3D_SHADER_ERROR_TPF_INVALID_REGISTER_DIMENSION
@ VKD3D_SHADER_ERROR_TPF_TOO_MANY_REGISTERS
@ VKD3D_SHADER_ERROR_TPF_INVALID_REGISTER_INDEX_COUNT
@ VKD3D_SHADER_ERROR_TPF_INVALID_REGISTER_DCL
@ VKD3D_SHADER_WARNING_TPF_UNHANDLED_REGISTER_SWIZZLE
@ VKD3D_SHADER_WARNING_TPF_UNHANDLED_REGISTER_MASK
@ VKD3D_SHADER_ERROR_TPF_OUT_OF_MEMORY
@ VKD3D_SHADER_ERROR_TPF_INVALID_CASE_VALUE
@ VKD3D_SHADER_ERROR_TPF_INVALID_REGISTER_RANGE
@ VKD3D_SHADER_ERROR_TPF_INVALID_IO_REGISTER
@ VKD3D_SHADER_WARNING_TPF_MASK_NOT_CONTIGUOUS
static unsigned int vkd3d_write_mask_from_component_count(unsigned int component_count)
#define VKD3DSP_WRITEMASK_ALL
#define SPIRV_MAX_SRC_COUNT
static struct vkd3d_shader_src_param * vsir_program_get_src_params(struct vsir_program *program, unsigned int count)
static unsigned int vsir_swizzle_get_component(uint32_t swizzle, unsigned int idx)
@ VKD3DSIH_LD_UAV_TYPED_S
@ VKD3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER
@ VKD3DSIH_IMM_ATOMIC_UMAX
@ VKD3DSIH_DCL_HS_JOIN_PHASE_INSTANCE_COUNT
@ VKD3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE
@ VKD3DSIH_DCL_INPUT_CONTROL_POINT_COUNT
@ VKD3DSIH_IMM_ATOMIC_XOR
@ VKD3DSIH_GATHER4_PO_C_S
@ VKD3DSIH_DCL_INPUT_PRIMITIVE
@ VKD3DSIH_STORE_UAV_TYPED
@ VKD3DSIH_DCL_GS_INSTANCES
@ VKD3DSIH_DCL_OUTPUT_SIV
@ VKD3DSIH_DCL_FUNCTION_TABLE
@ VKD3DSIH_DCL_RESOURCE_RAW
@ VKD3DSIH_DCL_VERTICES_OUT
@ VKD3DSIH_DCL_OUTPUT_TOPOLOGY
@ VKD3DSIH_IMM_ATOMIC_CONSUME
@ VKD3DSIH_DCL_GLOBAL_FLAGS
@ VKD3DSIH_EVAL_SAMPLE_INDEX
@ VKD3DSIH_CHECK_ACCESS_FULLY_MAPPED
@ VKD3DSIH_DCL_FUNCTION_BODY
@ VKD3DSIH_DCL_HS_MAX_TESSFACTOR
@ VKD3DSIH_DCL_UAV_STRUCTURED
@ VKD3DSIH_HS_CONTROL_POINT_PHASE
@ VKD3DSIH_DCL_INPUT_PS_SIV
@ VKD3DSIH_IMM_ATOMIC_IADD
@ VKD3DSIH_IMM_ATOMIC_EXCH
@ VKD3DSIH_ATOMIC_CMP_STORE
@ VKD3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT
@ VKD3DSIH_DCL_THREAD_GROUP
@ VKD3DSIH_IMM_ATOMIC_IMIN
@ VKD3DSIH_IMM_ATOMIC_IMAX
@ VKD3DSIH_IMM_ATOMIC_ALLOC
@ VKD3DSIH_IMM_ATOMIC_AND
@ VKD3DSIH_DCL_TGSM_STRUCTURED
@ VKD3DSIH_DCL_RESOURCE_STRUCTURED
@ VKD3DSIH_DCL_TESSELLATOR_DOMAIN
@ VKD3DSIH_DCL_OUTPUT_CONTROL_POINT_COUNT
@ VKD3DSIH_SAMPLE_GRAD_CL_S
@ VKD3DSIH_STORE_STRUCTURED
@ VKD3DSIH_IMM_ATOMIC_UMIN
@ VKD3DSIH_DCL_INDEX_RANGE
@ VKD3DSIH_DCL_INPUT_PS_SGV
@ VKD3DSIH_DCL_CONSTANT_BUFFER
@ VKD3DSIH_DCL_INDEXABLE_TEMP
@ VKD3DSIH_IMM_ATOMIC_CMP_EXCH
@ VKD3DSIH_LD_STRUCTURED_S
@ VKD3DSIH_DCL_TESSELLATOR_PARTITIONING
#define VKD3DSI_RESINFO_UINT
static bool vsir_sysval_semantic_is_clip_cull(enum vkd3d_shader_sysval_semantic sysval_semantic)
#define VKD3DSI_SAMPLE_INFO_UINT
vkd3d_shader_register_precision
@ VKD3D_SHADER_REGISTER_PRECISION_DEFAULT
@ VKD3D_SHADER_REGISTER_PRECISION_MIN_UINT_16
@ VKD3D_SHADER_REGISTER_PRECISION_INVALID
@ VKD3D_SHADER_REGISTER_PRECISION_MIN_INT_16
@ VKD3D_SHADER_REGISTER_PRECISION_MIN_FLOAT_10
@ VKD3D_SHADER_REGISTER_PRECISION_MIN_FLOAT_16
@ VKD3D_TESSELLATOR_DOMAIN_TRIANGLE
@ VKD3D_TESSELLATOR_DOMAIN_LINE
@ VKD3D_TESSELLATOR_DOMAIN_QUAD
static size_t put_string(struct vkd3d_bytecode_buffer *buffer, const char *string)
static bool register_is_constant(const struct vkd3d_shader_register *reg)
static uint32_t vsir_write_mask_64_from_32(uint32_t write_mask32)
static bool vsir_sysval_semantic_is_tess_factor(enum vkd3d_shader_sysval_semantic sysval_semantic)
@ VKD3D_PT_TRIANGLELIST_ADJ
@ VKD3D_SHADER_CONDITIONAL_OP_NZ
@ VKD3D_SHADER_CONDITIONAL_OP_Z
void vkd3d_shader_parser_error(struct vkd3d_shader_parser *parser, enum vkd3d_shader_error error, const char *format,...) VKD3D_PRINTF_FUNC(3
vkd3d_shader_dst_modifier
void vkd3d_shader_parser_warning(struct vkd3d_shader_parser *parser, enum vkd3d_shader_error error, const char *format,...) VKD3D_PRINTF_FUNC(3
#define VKD3DSP_WRITEMASK_0
#define VKD3DSP_WRITEMASK_1
#define VKD3DSI_PRECISE_SHIFT
static size_t bytecode_get_size(struct vkd3d_bytecode_buffer *buffer)
@ VKD3D_ERROR_INVALID_ARGUMENT
@ VKD3D_ERROR_INVALID_SHADER
@ VKD3D_ERROR_OUT_OF_MEMORY
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
static size_t align(size_t addr, size_t alignment)
static unsigned int block