59 const char *
string =
key;
87 {
"SetBlendState", 3, 3, { {
"AB_BlendFactor" }, {
"AB_SampleMask" }, {
"BlendState" } }, 4 },
88 {
"SetDepthStencilState", 2, 2, { {
"DS_StencilRef" }, {
"DepthStencilState" } }, 4 },
89 {
"SetRasterizerState", 1, 1, { {
"RasterizerState" } }, 4 },
90 {
"SetVertexShader", 1, 1, { {
"VertexShader" } }, 4 },
91 {
"SetDomainShader", 1, 1, { {
"DomainShader" } }, 5 },
92 {
"SetHullShader", 1, 1, { {
"HullShader" } }, 5 },
93 {
"SetGeometryShader", 1, 1, { {
"GeometryShader" } }, 4 },
94 {
"SetPixelShader", 1, 1, { {
"PixelShader" } }, 4 },
95 {
"SetComputeShader", 1, 1, { {
"ComputeShader" } }, 4 },
96 {
"OMSetRenderTargets", 2, 9, { {0} }, 4 },
110 bool lhs_has_index,
unsigned int lhs_index)
128 if (
info->min_args ==
info->max_args)
131 for (
i = 0;
i < comp_count; ++
i, ++
c)
136 if (!
strcmp(
info->name,
"OMSetRenderTargets"))
138 for (
i = 0;
i < comp_count - 2; ++
i)
148 if (
entry->is_function_call)
155 "Invalid state block function '%s'.",
entry->name);
160 if (
info->min_args ==
info->max_args)
163 "Invalid argument count for state block function '%s' (expected %u).",
169 "Invalid argument count for state block function '%s' (expected from %u to %u).",
241 return fx->ops->write_string(
string,
fx);
260 if (!
v->default_values)
262 "Annotation variable is missing default value.");
264 fx->ops->write_annotation(
v,
fx);
289 unsigned int elements_count, modifiers;
340 unsigned int version =
ctx->profile->major_version;
349 fx->min_technique_version = 9;
350 fx->max_technique_version = 9;
354 fx->min_technique_version = 10;
355 fx->max_technique_version = 10;
359 fx->min_technique_version = 10;
360 fx->max_technique_version = 11;
366 fx->child_effect =
fx->ops->are_child_effects_supported &&
ctx->child_effect;
367 fx->include_empty_buffers =
version == 4 &&
ctx->include_empty_buffers;
393 return fx->ctx->result;
403 return type->e.version >=
fx->min_technique_version &&
type->e.version <=
fx->max_technique_version;
457 uint32_t name_offset, annotation_count_offset;
467 if (
var->state_block_count &&
var->state_blocks[0]->count)
566 static const uint32_t numeric_type_class[] =
580 value |= numeric_type_class[
type->class];
587 switch (
type->e.numeric.type)
611 static const char *
const texture_type_names[] =
624 static const char *
const uav_type_names[] =
639 return "SamplerState";
642 return texture_type_names[
type->sampler_dim];
645 return uav_type_names[
type->sampler_dim];
648 return "DepthStencilState";
651 return "DepthStencilView";
654 return "RenderTargetView";
657 return "VertexShader";
660 return "GeometryShader";
663 return "PixelShader";
696 struct field_offsets *field_offsets =
NULL;
715 for (
i = 0;
i < element_type->
e.
record.field_count; ++
i)
728 switch (element_type->
class)
768 FIXME(
"Writing type class %u is not implemented.\n", element_type->
class);
780 packed_size *= elements_count;
793 for (
i = 0;
i < element_type->
e.
record.field_count; ++
i)
795 const struct field_offsets *
field = &field_offsets[
i];
803 if (
ctx->profile->major_version == 5)
811 static const uint32_t texture_type[] =
898 FIXME(
"Type %u is not supported.\n", element_type->
class);
936 fx->ops->write_technique(
var,
fx);
937 ++
fx->technique_count;
965 bool needs_default_group =
false;
972 needs_default_group =
true;
977 if (needs_default_group)
991 const char *
s =
string ?
string :
"";
992 static const char tail[3];
1015 uint32_t semantic_offset,
offset, elements_count = 0, name_offset;
1034 switch (
type->class)
1050 fx->shader_count += elements_count;
1058 for (
i = 0;
i <
type->e.record.field_count; ++
i)
1073 uint32_t name_offset, pass_count_offset, annotation_count_offset,
count = 0;
1101 unsigned int comp_count;
1108 for (
i = 0;
i < elements_count; ++
i)
1110 switch (
type->class)
1116 switch (
type->e.numeric.type)
1124 for (
j = 0;
j < comp_count; ++
j)
1131 hlsl_fixme(
ctx, &
ctx->location,
"Writing default values for numeric type %u is not implemented.",
1132 type->e.numeric.type);
1141 for (
j = 0;
j <
type->e.record.field_count; ++
j)
1149 hlsl_fixme(
ctx, &
ctx->location,
"Writing default values for class %u is not implemented.",
type->class);
1165 for (
i = 0;
i < elements_count; ++
i)
1169 hlsl_fixme(
ctx, &
var->loc,
"Writing fx_2_0 sampler objects initializers is not implemented.");
1173 switch (
type->class)
1177 const char *
string =
var->default_values[
i].string ?
var->default_values[
i].string :
"";
1188 hlsl_fixme(
ctx, &
var->loc,
"Writing fx_2_0 shader objects initializers is not implemented.");
1193 id =
fx->object_variable_count++;
1215 switch (
type->class)
1234 hlsl_fixme(
ctx, &
var->loc,
"Writing initializer not implemented for parameter class %#x.",
type->class);
1244 switch (
type->class)
1261 switch (
type->sampler_dim)
1310 uint32_t desc_offset, value_offset,
flags, annotation_count_offset;
1314 enum fx_2_parameter_flags
1338 ++
fx->parameter_count;
1345 uint32_t desc_offset, value_offset;
1370 fx.object_variable_count = 1;
1407 if (!
fx.technique_count)
1411 ctx->result =
fx.status;
1428 .are_child_effects_supported =
true,
1439 unsigned int comp_count;
1446 for (
i = 0;
i < elements_count; ++
i)
1448 switch (
type->class)
1454 switch (
type->e.numeric.type)
1462 for (
j = 0;
j < comp_count; ++
j)
1469 hlsl_fixme(
ctx, &
ctx->location,
"Writing default values for numeric type %u is not implemented.",
1470 type->e.numeric.type);
1479 for (
j = 0;
j <
type->e.record.field_count; ++
j)
1487 hlsl_fixme(
ctx, &
ctx->location,
"Writing default values for class %u is not implemented.",
type->class);
1497 const struct hlsl_default_value *
value =
var->default_values;
1508 for (
i = 0;
i < elements_count; ++
i, ++
value)
1518 uint32_t name_offset, type_offset, value_offset;
1520 enum fx_4_numeric_variable_flags
1522 HAS_EXPLICIT_BIND_POINT = 0x4,
1525 if (
var->has_explicit_bind_point)
1526 flags |= HAS_EXPLICIT_BIND_POINT;
1542 fx->shared_numeric_variable_count++;
1551 fx->numeric_variable_count++;
1579 hlsl_fixme(
ctx, &
var->loc,
"Writing annotations for type class %u is not implemented.",
type->class);
1641 uint32_t value_offset = 0, assignment_type = 0, rhs_offset, type_offset,
offset;
1655 switch (
value->type)
1669 if (
load->src.path_len)
1670 hlsl_fixme(
ctx, &
var->loc,
"Indexed access in RHS values is not implemented.");
1698 value_offset =
put_u32(unstructured, value_offset);
1699 put_u32(unstructured,
c->value.u[0].u);
1702 if (
c->value.u[0].u >=
type->e.array.elements_count)
1704 "Array index %u exceeds array size %u.",
c->value.u[0].u,
type->e.array.elements_count);
1711 index_var =
load->src.var;
1715 && !
load->src.path_len)
1719 value_offset =
put_u32(unstructured, value_offset);
1728 hlsl_fixme(
ctx, &
var->loc,
"Complex array index expressions in RHS values are not implemented.");
1745 for (
i = start_index;
i <
block->count; ++
i)
1749 if (
cur->is_function_call)
1755 if (
cur->lhs_has_index !=
entry->lhs_has_index)
1758 if (
cur->lhs_has_index &&
cur->lhs_index !=
entry->lhs_index)
1798 if (!replace_context->
values)
1807 "Unrecognized state constant %s.", state_constant->
name);
1910 {
"MIN_MAG_MIP_POINT", 0x00 },
1911 {
"MIN_MAG_POINT_MIP_LINEAR", 0x01 },
1912 {
"MIN_POINT_MAG_LINEAR_MIP_POINT", 0x04 },
1913 {
"MIN_POINT_MAG_MIP_LINEAR", 0x05 },
1914 {
"MIN_LINEAR_MAG_MIP_POINT", 0x10 },
1915 {
"MIN_LINEAR_MAG_POINT_MIP_LINEAR", 0x11 },
1916 {
"MIN_MAG_LINEAR_MIP_POINT", 0x14 },
1917 {
"MIN_MAG_MIP_LINEAR", 0x15 },
1918 {
"ANISOTROPIC", 0x55 },
1919 {
"COMPARISON_MIN_MAG_MIP_POINT", 0x80 },
1920 {
"COMPARISON_MIN_MAG_POINT_MIP_LINEAR", 0x81 },
1921 {
"COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT", 0x84 },
1922 {
"COMPARISON_MIN_POINT_MAG_MIP_LINEAR", 0x85 },
1923 {
"COMPARISON_MIN_LINEAR_MAG_MIP_POINT", 0x90 },
1924 {
"COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR", 0x91 },
1925 {
"COMPARISON_MIN_MAG_LINEAR_MIP_POINT", 0x94 },
1926 {
"COMPARISON_MIN_MAG_MIP_LINEAR", 0x95 },
1927 {
"COMPARISON_ANISOTROPIC", 0xd5 },
1937 {
"MIRROR_ONCE", 5 },
1946 {
"LESS_EQUAL", 4 },
1949 {
"GREATER_EQUAL", 7 },
1966 {
"LESS_EQUAL", 4 },
1969 {
"GREATER_EQUAL", 7 },
2007 {
"INV_SRC_COLOR", 4 },
2009 {
"INV_SRC_ALPHA", 6 },
2010 {
"DEST_ALPHA", 7 },
2011 {
"INV_DEST_ALPHA", 8 },
2012 {
"DEST_COLOR", 9 },
2013 {
"INV_DEST_COLOR", 10 },
2014 {
"SRC_ALPHA_SAT", 11 },
2015 {
"BLEND_FACTOR", 14 },
2016 {
"INV_BLEND_FACTOR", 15 },
2017 {
"SRC1_COLOR", 16 },
2018 {
"INV_SRC1_COLOR", 17 },
2019 {
"SRC1_ALPHA", 18 },
2020 {
"INV_SRC1_ALPHA", 19 },
2028 {
"REV_SUBTRACT", 3 },
2128 static const struct fx_4_state fx_5_blend_states[] =
2158 table.ptr = fx_5_blend_states;
2183 if (
entry->args_count != 1)
2190 if (
entry->lhs_has_index &&
state->array_size == 1)
2197 if (!
entry->lhs_has_index &&
state->array_size > 1)
2214 replace_context.
var =
var;
2233 if (
load->src.path_len)
2251 if (
c->value.u[0].u != 0)
2253 "Only 0 integer constants are allowed for object-typed fields.");
2258 "Unexpected constant used for object-typed field.");
2264 hlsl_fixme(
ctx, &
ctx->location,
"Unhandled node type for object-typed field.");
2271 switch (
state->class)
2320 if (entry_index !=
block->count - 1)
2323 (
block->count - entry_index - 1) *
sizeof(*
block->entries));
2339 if (!
entry->is_function_call)
2345 if (
info->min_profile >
ctx->profile->major_version)
2348 "State %s is not supported for this profile.",
entry->name);
2353 if (
info->min_args ==
info->max_args &&
info->min_args == 1)
2365 for (
i = 0;
i <
entry->args_count; ++
i)
2368 unsigned int arg_index = (
i + 1) %
entry->args_count;
2374 return entry->args_count;
2382 static const char *states[] = {
"SrcBlend",
"DestBlend",
"BlendOp",
"SrcBlendAlpha",
"DestBlendAlpha",
"BlendOpAlpha" };
2394 if (
entry->lhs_has_index)
2412 block->entries[entry_index]->lhs_has_index =
true;
2416 entry->name,
true,
i,
true, 0);
2427 if (
entry->is_function_call)
2440 if (
var->state_blocks)
2442 block =
var->state_blocks[block_index];
2444 for (
i = 0;
i <
block->count;)
2474 for (
i = 0;
i < elements_count; ++
i)
2489 for (
i = 0;
i < elements_count; ++
i)
2500 for (
i = 0;
i < elements_count; ++
i)
2519 uint32_t semantic_offset, bind_point = ~0
u;
2523 if (
var->reg_reservation.reg_type)
2524 bind_point =
var->reg_reservation.reg_index;
2538 ++
fx->shared_object_count;
2543 switch (
type->class)
2546 fx->rtv_count += elements_count;
2549 fx->texture_count += elements_count;
2552 fx->uav_count += elements_count;
2558 fx->shader_count += elements_count;
2565 fx->shader_count += elements_count;
2569 fx->dsv_count += elements_count;
2574 fx->depth_stencil_state_count += elements_count;
2579 fx->sampler_state_count += elements_count;
2584 fx->rasterizer_state_count += elements_count;
2589 fx->blend_state_count += elements_count;
2594 fx->string_count += elements_count;
2598 hlsl_fixme(
ctx, &
ctx->location,
"Writing initializer for object class %u is not implemented.",
2604 ++
fx->object_variable_count;
2609 enum fx_4_buffer_flags
2624 if (
b->reservation.reg_type)
2625 bind_point =
b->reservation.reg_index;
2627 flags |= IS_TBUFFER;
2641 ++
fx->shared_buffer_count;
2656 if (
var->buffer !=
b)
2672 if (shared && !
fx->child_effect)
2677 if (!
buffer->size && !
fx->include_empty_buffers)
2692 switch (
type->class)
2708 if (
ctx->profile->major_version < 5)
2712 if (
ctx->profile->major_version < 5)
2714 if (
type->e.resource.rasteriser_ordered)
2728 if (shared && !
fx->child_effect)
2760 put_u32(&
buffer,
ctx->profile->minor_version == 0 ? 0xfeff1001 : 0xfeff1011);
2791 ctx->result =
fx.status;
2854 ctx->result =
fx.status;
2867 if (
ctx->profile->major_version == 2)
2871 else if (
ctx->profile->major_version == 4)
2875 else if (
ctx->profile->major_version == 5)
3006 return (
const char *)(
parser->unstructured.ptr +
offset);
3027 unsigned int base_type, comp_count;
3033 for (
i = 0;
i < comp_count; ++
i)
3050 if (
i < comp_count - 1)
3065 struct fx_4_annotation
3071 const char *
name, *type_name;
3097 if (
type.element_count)
3100 if (
type.element_count)
3123 "Only numeric and string types are supported in annotations.\n");
3126 if (
type.element_count)
3138 struct fx_4_numeric_variable
3147 const char *
name, *semantic, *type_name;
3160 if (
type.element_count)
3196 for (
i = 0;
i <
parser->buffer_count; ++
i)
3219 const char *
p, *
q, *
end;
3241 switch (object_type)
3276 info.source.size = data_size;
3286 "Failed to disassemble shader blob.\n");
3317 for (
unsigned int i = 0;
i <
ARRAY_SIZE(shader5.sodecl); ++
i)
3319 if (shader5.sodecl[
i])
3323 if (shader5.sodecl_count)
3332 switch (
type->typeinfo)
3358 return id -
state->id;
3364 struct fx_4_assignment
3407 if (
state->container != type_class)
3410 "State '%s' does not belong to object type class %#x.",
state->name, type_class);
3416 if (
state->array_size > 1)
3424 if (value_types[
state->type])
3426 if (
state->dimx > 1)
3469 if (comp_count > 1 &&
j < comp_count - 1)
3491 "Unsupported assignment type %u.\n",
entry.type);
3516 switch (
type->typeinfo)
3547 "Parsing object type %u is not implemented.",
type->typeinfo);
3557 struct fx_4_object_variable
3565 const char *
name, *type_name;
3571 for (
i = 0;
i <
parser->object_count; ++
i)
3582 if (
type.element_count)
3623 for (
i = 0;
i < technique.count; ++
i)
3663 for (
i = 0;
i <
parser->group_count; ++
i)
3692 uint32_t shared_numeric_variable_count;
3698 uint32_t depth_stencil_state_count;
3728 for (
i = 0;
i <
header.technique_count; ++
i)
3731 return parser->failed ? - 1 : 0;
3743 uint32_t shared_numeric_variable_count;
3749 uint32_t depth_stencil_state_count;
3760 uint32_t interface_variable_element_count;
3761 uint32_t class_instance_element_count;
3786 return parser->failed ? - 1 : 0;
3795 .ptr = compile_info->
source.code,
3822 "Invalid effect binary version value 0x%08x.",
version);
struct outqueuenode * tail
static void list_remove(struct list_entry *entry)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
static void put_u32(struct bytecode_buffer *buffer, uint32_t value)
D3DXPARAMETER_TYPE hlsl_sm1_base_type(const struct hlsl_type *type)
D3DXPARAMETER_CLASS hlsl_sm1_class(const struct hlsl_type *type)
static const struct @282 state_table[]
static const WCHAR version[]
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
static const struct rhs_named_value fill_values[]
static int fx_4_state_id_compare(const void *a, const void *b)
static uint32_t write_fx_2_object_initializer(const struct hlsl_ir_var *var, struct fx_write_context *fx)
static const struct rhs_named_value compare_func_values[]
static uint32_t fx_parser_read_u32(struct fx_parser *parser)
static void fx_parse_buffers(struct fx_parser *parser)
static void write_fx_4_object_variable(struct hlsl_ir_var *var, struct fx_write_context *fx)
static const struct rhs_named_value blend_values[]
static void add_function_component(struct function_component **components, const char *name, bool lhs_has_index, unsigned int lhs_index)
static void get_state_block_function_components(const struct state_block_function_info *info, struct function_component *components, unsigned int comp_count)
static void fx_4_parse_objects(struct fx_parser *parser)
static const uint32_t fx_4_numeric_base_types[]
static void fx_parse_fx_4_technique(struct fx_parser *parser)
static uint32_t write_annotations(struct hlsl_scope *scope, struct fx_write_context *fx)
static const struct fx_4_state fx_4_states[]
static uint32_t write_string(const char *string, struct fx_write_context *fx)
static void write_fx_4_technique(struct hlsl_ir_var *var, struct fx_write_context *fx)
static uint32_t write_fx_4_string(const char *string, struct fx_write_context *fx)
static void write_fx_4_state_object_initializer(struct hlsl_ir_var *var, struct fx_write_context *fx)
static uint32_t write_fx_2_default_value(struct hlsl_type *value_type, struct hlsl_default_value *value, struct fx_write_context *fx)
static void fx_parser_skip(struct fx_parser *parser, size_t size)
static bool get_fx_4_state_enum_value(const struct rhs_named_value *pairs, const char *name, unsigned int *value)
static int fx_4_parse(struct fx_parser *parser)
static void write_fx_4_annotation(struct hlsl_ir_var *var, struct fx_write_context *fx)
static int fx_2_parse(struct fx_parser *parser)
static size_t put_u32_unaligned(struct vkd3d_bytecode_buffer *buffer, uint32_t value)
static bool is_object_fx_type(enum state_property_component_type type)
static bool replace_state_block_constant(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context)
static uint32_t write_fx_2_initial_value(const struct hlsl_ir_var *var, struct fx_write_context *fx)
static int fx_5_parse(struct fx_parser *parser)
static bool is_type_supported_fx_2(struct hlsl_ctx *ctx, const struct hlsl_type *type, const struct vkd3d_shader_location *loc)
static void set_status(struct fx_write_context *fx, int status)
static void parse_fx_end_indent(struct fx_parser *parser)
static void fx_parse_fx_4_numeric_variables(struct fx_parser *parser, uint32_t count)
static void write_fx_4_numeric_variable(struct hlsl_ir_var *var, bool shared, struct fx_write_context *fx)
static const struct rhs_named_value address_values[]
static void write_fx_2_parameters(struct fx_write_context *fx)
static void fx_4_parse_state_object_initializer(struct fx_parser *parser, uint32_t count, enum hlsl_type_class type_class)
static void write_fx_4_annotations(struct hlsl_scope *scope, struct fx_write_context *fx)
static void fx_4_parse_object_initializer(struct fx_parser *parser, const struct fx_4_binary_type *type)
static uint32_t write_fx_4_type(const struct hlsl_type *type, struct fx_write_context *fx)
bool hlsl_validate_state_block_entry(struct hlsl_ctx *ctx, struct hlsl_state_block_entry *entry, const struct vkd3d_shader_location *loc)
static bool technique_matches_version(const struct hlsl_ir_var *var, const struct fx_write_context *fx)
static void string_storage_destroy(struct rb_entry *entry, void *context)
static const struct rhs_named_value stencil_op_values[]
static bool is_numeric_fx_4_type(const struct hlsl_type *type)
static void write_groups(struct fx_write_context *fx)
static int hlsl_fx_2_write(struct hlsl_ctx *ctx, struct vkd3d_shader_code *out)
static const struct rhs_named_value cull_values[]
static uint32_t write_fx_2_parameter(const struct hlsl_type *type, const char *name, const struct hlsl_semantic *semantic, struct fx_write_context *fx)
static const struct rhs_named_value null_values[]
static const struct rhs_named_value blendop_values[]
static enum hlsl_type_class hlsl_type_class_from_fx_type(enum state_property_component_type type)
static unsigned int decompose_fx_4_state_block(struct hlsl_ir_var *var, struct hlsl_state_block *block, unsigned int entry_index, struct fx_write_context *fx)
static const char * get_fx_4_type_name(const struct hlsl_type *type)
state_property_component_type
@ FX_COMPONENT_TYPE_COUNT
static int hlsl_fx_5_write(struct hlsl_ctx *ctx, struct vkd3d_shader_code *out)
static uint32_t get_fx_4_type_size(const struct hlsl_type *type)
static uint32_t get_fx_2_type_class(const struct hlsl_type *type)
static bool is_supported_object_variable(const struct hlsl_ctx *ctx, const struct hlsl_ir_var *var)
static void fx_parse_groups(struct fx_parser *parser)
static void write_fx_2_annotations(struct hlsl_ir_var *var, uint32_t count_offset, struct fx_write_context *fx)
static void write_objects(struct fx_write_context *fx, bool shared)
static unsigned int decompose_fx_4_state_function_call(struct hlsl_ir_var *var, struct hlsl_state_block *block, unsigned int entry_index, struct fx_write_context *fx)
static void write_fx_4_string_initializer(struct hlsl_ir_var *var, struct fx_write_context *fx)
static void write_techniques(struct hlsl_scope *scope, struct fx_write_context *fx)
static void write_fx_4_state_assignment(const struct hlsl_ir_var *var, struct hlsl_state_block_entry *entry, struct fx_write_context *fx)
static void fx_parser_read_unstructured(struct fx_parser *parser, void *dst, uint32_t offset, size_t size)
static void fx_4_parse_string_initializer(struct fx_parser *parser, uint32_t offset)
static void resolve_fx_4_state_block_values(struct hlsl_ir_var *var, struct hlsl_state_block_entry *entry, struct fx_write_context *fx)
static const struct fx_write_context_ops fx_4_ops
static int hlsl_fx_4_write(struct hlsl_ctx *ctx, struct vkd3d_shader_code *out)
static uint32_t write_fx_4_state_numeric_value(struct hlsl_ir_constant *value, struct fx_write_context *fx)
static void write_fx_2_technique(struct hlsl_ir_var *var, struct fx_write_context *fx)
static uint32_t write_fx_2_string(const char *string, struct fx_write_context *fx)
static bool decompose_fx_4_state_add_entries(struct hlsl_state_block *block, unsigned int entry_index, unsigned int count)
static void parse_fx_4_numeric_value(struct fx_parser *parser, uint32_t offset, const struct fx_4_binary_type *type)
static const struct rhs_named_value depth_write_mask_values[]
static void fx_write_context_init(struct hlsl_ctx *ctx, const struct fx_write_context_ops *ops, struct fx_write_context *fx)
static uint32_t write_fx_4_default_value(struct hlsl_type *value_type, struct hlsl_default_value *value, struct fx_write_context *fx)
static bool fx_4_object_has_initializer(const struct fx_4_binary_type *type)
static void write_buffers(struct fx_write_context *fx, bool shared)
static const struct fx_write_context_ops fx_2_ops
static const char * fx_4_get_string(struct fx_parser *parser, uint32_t offset)
static void write_fx_4_buffer(struct hlsl_buffer *b, struct fx_write_context *fx)
static const struct rhs_named_value filter_values[]
static void write_fx_4_state_block(struct hlsl_ir_var *var, unsigned int block_index, uint32_t count_offset, struct fx_write_context *fx)
int fx_parse(const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_code *out, struct vkd3d_shader_message_context *message_context)
static void write_fx_4_pass(struct hlsl_ir_var *var, struct fx_write_context *fx)
static void write_fx_4_shader_initializer(struct hlsl_ir_var *var, struct fx_write_context *fx)
static void fx_parse_fx_4_annotations(struct fx_parser *parser)
static void write_fx_5_shader_initializer(struct hlsl_ir_var *var, struct fx_write_context *fx)
static int fx_write_context_cleanup(struct fx_write_context *fx)
static void fx_4_parse_shader_initializer(struct fx_parser *parser, unsigned int object_type)
static bool state_block_contains_state(const struct hlsl_state_block_entry *entry, unsigned int start_index, struct hlsl_state_block *block)
static const struct rhs_named_value bool_values[]
static const struct rhs_named_value comparison_values[]
@ FX_4_OBJECT_TYPE_BLEND_STATE
@ FX_5_OBJECT_TYPE_UAV_1DARRAY
@ FX_5_OBJECT_TYPE_UAV_STRUCTURED_BUFFER
@ FX_5_OBJECT_TYPE_UAV_BUFFER
@ FX_5_OBJECT_TYPE_HULL_SHADER
@ FX_4_NUMERIC_BASE_TYPE_SHIFT
@ FX_4_OBJECT_TYPE_TEXTURE_2DMSARRAY
@ FX_4_NUMERIC_CLASS_VECTOR
@ FX_5_OBJECT_TYPE_GEOMETRY_SHADER
@ FX_4_OBJECT_TYPE_TEXTURE
@ FX_4_NUMERIC_ROWS_SHIFT
@ FX_4_OBJECT_TYPE_GEOMETRY_SHADER
@ FX_4_OBJECT_TYPE_SAMPLER_STATE
@ FX_4_OBJECT_TYPE_STRING
@ FX_5_OBJECT_TYPE_SRV_APPEND_STRUCTURED_BUFFER
@ FX_4_NUMERIC_CLASS_SCALAR
@ FX_4_OBJECT_TYPE_VERTEX_SHADER
@ FX_4_ASSIGNMENT_CONSTANT
@ FX_4_OBJECT_TYPE_TEXTURE_CUBEARRAY
@ FX_5_OBJECT_TYPE_SRV_STRUCTURED_BUFFER
@ FX_4_NUMERIC_COLUMN_MAJOR_MASK
@ FX_4_OBJECT_TYPE_GEOMETRY_SHADER_SO
@ FX_4_OBJECT_TYPE_TEXTURE_3D
@ FX_5_OBJECT_TYPE_UAV_2DARRAY
@ FX_4_OBJECT_TYPE_TEXTURE_1D
@ FX_4_OBJECT_TYPE_TEXTURE_2DARRAY
@ FX_4_ASSIGNMENT_ARRAY_VARIABLE_INDEX
@ FX_4_OBJECT_TYPE_PIXEL_SHADER
@ FX_4_OBJECT_TYPE_TEXTURE_2DMS
@ FX_5_OBJECT_TYPE_SRV_CONSUME_STRUCTURED_BUFFER
@ FX_4_TYPE_CLASS_NUMERIC
@ FX_5_OBJECT_TYPE_UAV_3D
@ FX_4_ASSIGNMENT_VARIABLE
@ FX_5_OBJECT_TYPE_SRV_RAW_BUFFER
@ FX_4_OBJECT_TYPE_RASTERIZER_STATE
@ FX_4_OBJECT_TYPE_TEXTURE_CUBE
@ FX_4_NUMERIC_CLASS_MATRIX
@ FX_5_OBJECT_TYPE_DOMAIN_SHADER
@ FX_5_OBJECT_TYPE_UAV_2D
@ FX_5_OBJECT_TYPE_UAV_1D
@ FX_5_OBJECT_TYPE_COMPUTE_SHADER
@ FX_4_OBJECT_TYPE_TEXTURE_2D
@ FX_4_OBJECT_TYPE_TEXTURE_1DARRAY
@ FX_4_NUMERIC_TYPE_FLOAT
@ FX_4_NUMERIC_COLUMNS_SHIFT
@ FX_4_ASSIGNMENT_ARRAY_CONSTANT_INDEX
@ FX_4_OBJECT_TYPE_DEPTH_STENCIL_STATE
@ FX_5_OBJECT_TYPE_UAV_RAW_BUFFER
static const void * fx_parser_get_unstructured_ptr(struct fx_parser *parser, uint32_t offset, size_t size)
static void write_fx_2_annotation(struct hlsl_ir_var *var, struct fx_write_context *fx)
static uint32_t write_type(const struct hlsl_type *type, struct fx_write_context *fx)
static void write_fx_2_pass(struct hlsl_ir_var *var, struct fx_write_context *fx)
static void write_group(struct hlsl_ir_var *var, struct fx_write_context *fx)
static unsigned int decompose_fx_4_state_block_expand_array(struct hlsl_ir_var *var, struct hlsl_state_block *block, unsigned int entry_index, struct fx_write_context *fx)
int hlsl_emit_effect_binary(struct hlsl_ctx *ctx, struct vkd3d_shader_code *out)
static uint32_t get_fx_4_numeric_type_description(const struct hlsl_type *type, struct fx_write_context *fx)
static void parse_fx_print_indent(struct fx_parser *parser)
static void fx_parser_read_u32s(struct fx_parser *parser, void *dst, size_t size)
static const struct state_block_function_info * get_state_block_function_info(const char *name)
static int string_storage_compare(const void *key, const struct rb_entry *entry)
static enum hlsl_base_type hlsl_type_from_fx_type(enum state_property_component_type type)
static bool lower_null_constant(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void *context)
static void parse_fx_start_indent(struct fx_parser *parser)
static void write_pass(struct hlsl_ir_var *var, struct fx_write_context *fx)
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble GLdouble q
GLsizei const GLchar *const * strings
GLenum GLenum GLuint components
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
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 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_types_are_equal(const struct hlsl_type *t1, const struct hlsl_type *t2)
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)
void hlsl_free_state_block_entry(struct hlsl_state_block_entry *entry)
struct hlsl_ir_node * hlsl_new_cast(struct hlsl_ctx *ctx, struct hlsl_ir_node *node, struct hlsl_type *type, const struct vkd3d_shader_location *loc)
void hlsl_error(struct hlsl_ctx *ctx, const struct vkd3d_shader_location *loc, enum vkd3d_shader_error error, const char *fmt,...)
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 hlsl_ir_node * hlsl_new_uint_constant(struct hlsl_ctx *ctx, unsigned int n, const struct vkd3d_shader_location *loc)
void hlsl_replace_node(struct hlsl_ir_node *old, struct hlsl_ir_node *new)
struct hlsl_ir_node * hlsl_new_binary_expr(struct hlsl_ctx *ctx, enum hlsl_ir_expr_op op, struct hlsl_ir_node *arg1, struct hlsl_ir_node *arg2)
struct hlsl_state_block_entry * clone_stateblock_entry(struct hlsl_ctx *ctx, const struct hlsl_state_block_entry *src, const char *name, bool lhs_has_index, unsigned int lhs_index, bool single_arg, unsigned int arg_index)
static void hlsl_src_from_node(struct hlsl_src *src, struct hlsl_ir_node *node)
@ 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_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)
static struct hlsl_type * hlsl_get_vector_type(const struct hlsl_ctx *ctx, enum hlsl_base_type base_type, unsigned int dimx)
#define HLSL_STORAGE_UNIFORM
static void * hlsl_calloc(struct hlsl_ctx *ctx, size_t count, size_t size)
@ HLSL_IR_STATEBLOCK_CONSTANT
static struct hlsl_type * hlsl_get_scalar_type(const struct hlsl_ctx *ctx, enum hlsl_base_type base_type)
void hlsl_calculate_buffer_offsets(struct hlsl_ctx *ctx)
bool hlsl_transform_ir(struct hlsl_ctx *ctx, bool(*func)(struct hlsl_ctx *ctx, struct hlsl_ir_node *, void *), struct hlsl_block *block, void *context)
static void * hlsl_alloc(struct hlsl_ctx *ctx, size_t size)
static bool hlsl_is_numeric_type(const struct hlsl_type *type)
@ HLSL_SAMPLER_DIM_GENERIC
@ 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_STRUCTURED_BUFFER
static void hlsl_src_remove(struct hlsl_src *src)
#define HLSL_MODIFIER_SINGLE
#define HLSL_STORAGE_SHARED
#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)
void hlsl_run_const_passes(struct hlsl_ctx *ctx, struct hlsl_block *body)
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
static ULONG ** element_count
static float(__cdecl *square_half_float)(float x
for(i=0;i< sizeof(testsuite)/sizeof(testsuite[0]);++i) ok(call_test(testsuite[i].func)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
__WINE_SERVER_LIST_INLINE void list_add_before(struct list *elem, struct list *to_add)
__WINE_SERVER_LIST_INLINE void list_add_after(struct list *elem, struct list *to_add)
#define RB_ENTRY_VALUE(element, type, field)
static void rb_destroy(struct rb_tree *tree, rb_traverse_func_t *callback, void *context)
static int rb_put(struct rb_tree *tree, const void *key, struct rb_entry *entry)
static struct rb_entry * rb_get(const struct rb_tree *tree, const void *key)
static void rb_init(struct rb_tree *tree, rb_compare_func_t compare)
const struct rhs_named_value * values
enum state_property_component_type type
enum hlsl_type_class container
struct fx_parser::@5995 unstructured
struct vkd3d_shader_message_context * message_context
void(* write_technique)(struct hlsl_ir_var *var, struct fx_write_context *fx)
void(* write_annotation)(struct hlsl_ir_var *var, struct fx_write_context *fx)
void(* write_pass)(struct hlsl_ir_var *var, struct fx_write_context *fx)
uint32_t(* write_string)(const char *string, struct fx_write_context *fx)
bool are_child_effects_supported
struct vkd3d_bytecode_buffer unstructured
uint32_t shared_object_count
const struct fx_write_context_ops * ops
uint32_t blend_state_count
unsigned int max_technique_version
uint32_t object_variable_count
uint32_t sampler_state_count
uint32_t depth_stencil_state_count
unsigned int min_technique_version
struct vkd3d_bytecode_buffer objects
uint32_t numeric_variable_count
uint32_t shared_buffer_count
bool include_empty_buffers
struct vkd3d_bytecode_buffer structured
uint32_t rasterizer_state_count
uint32_t shared_numeric_variable_count
enum hlsl_ir_node_type type
struct hlsl_type * data_type
struct vkd3d_shader_location loc
struct hlsl_scope * scope
struct hlsl_type * data_type
unsigned int elements_count
enum hlsl_sampler_dim sampler_dim
unsigned int reg_size[HLSL_REGSET_LAST+1]
struct hlsl_type::@5997::@5999 record
enum hlsl_type_class class
const struct rhs_named_value * values
struct vkd3d_shader_code source
#define VKD3D_PRINTF_FUNC(fmt, args)
#define vkd3d_unreachable()
#define VKD3D_ASSERT(cond)
static int ascii_strcasecmp(const char *a, const char *b)
static void vkd3d_free(void *ptr)
bool vkd3d_array_reserve(void **elements, size_t *capacity, size_t element_count, size_t element_size)
@ VKD3D_SHADER_COMPILE_OPTION_API_VERSION
VKD3D_SHADER_API void vkd3d_shader_free_shader_code(struct vkd3d_shader_code *code)
@ VKD3D_SHADER_SOURCE_DXBC_TPF
@ VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO
@ VKD3D_SHADER_API_VERSION_1_14
VKD3D_SHADER_API int vkd3d_shader_compile(const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_code *out, char **messages)
@ VKD3D_SHADER_TARGET_D3D_ASM
void vkd3d_string_buffer_init(struct vkd3d_string_buffer *buffer)
void vkd3d_shader_code_from_string_buffer(struct vkd3d_shader_code *code, struct vkd3d_string_buffer *buffer)
void vkd3d_shader_verror(struct vkd3d_shader_message_context *context, const struct vkd3d_shader_location *location, enum vkd3d_shader_error error, const char *format, va_list args)
size_t bytecode_put_bytes_unaligned(struct vkd3d_bytecode_buffer *buffer, const void *bytes, size_t size)
void set_u32(struct vkd3d_bytecode_buffer *buffer, size_t offset, uint32_t value)
size_t bytecode_put_bytes(struct vkd3d_bytecode_buffer *buffer, const void *bytes, size_t size)
int vkd3d_string_buffer_printf(struct vkd3d_string_buffer *buffer, const char *format,...)
@ VKD3D_SHADER_ERROR_FX_INVALID_VERSION
@ VKD3D_SHADER_ERROR_HLSL_INVALID_STATE_BLOCK_ENTRY
@ VKD3D_SHADER_ERROR_FX_INVALID_DATA
@ VKD3D_SHADER_ERROR_HLSL_OFFSET_OUT_OF_BOUNDS
@ VKD3D_SHADER_ERROR_HLSL_INVALID_SYNTAX
@ VKD3D_SHADER_ERROR_HLSL_MISSING_TECHNIQUE
@ VKD3D_SHADER_ERROR_FX_NOT_IMPLEMENTED
@ VKD3D_ERROR_NOT_IMPLEMENTED
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
size_t const buffer_count