83 generator->failed =
true;
118 {2, 1, 1,
"1DArray"},
119 {3, 1, 1,
"2DArray"},
120 {3, 1, 0,
"2DMSArray"},
121 {4, 1, 1,
"CubeArray"},
135 for (
unsigned int i = 0;
i <
info->descriptor_count; ++
i)
139 if (
d->type ==
type &&
d->register_space ==
space &&
d->register_index ==
idx)
151 for (
unsigned int i = 0;
i <
info->descriptor_count; ++
i)
155 if (
d->type ==
type &&
d->register_id ==
id)
169 unsigned int resource_space,
unsigned int sampler_index,
unsigned int sampler_space)
200 if (
reg->idx_count != 1)
203 "Internal compiler error: Unhandled input register index count %u.",
reg->idx_count);
207 if (
reg->idx[0].rel_addr)
210 "Internal compiler error: Unhandled input register indirect addressing.");
218 if (
reg->idx_count != 1)
221 "Internal compiler error: Unhandled output register index count %u.",
reg->idx_count);
225 if (
reg->idx[0].rel_addr)
228 "Internal compiler error: Unhandled output register indirect addressing.");
238 "Internal compiler error: Unhandled depth output in shader type #%x.",
239 gen->
program->shader_version.type);
244 switch (
reg->dimension)
252 reg->u.immconst_u32[0],
reg->u.immconst_u32[1],
253 reg->u.immconst_u32[2],
reg->u.immconst_u32[3]);
259 "Internal compiler error: Unhandled dimension %#x.",
reg->dimension);
265 if (
reg->idx_count != 3)
268 "Internal compiler error: Unhandled constant buffer register index count %u.",
reg->idx_count);
272 if (
reg->idx[0].rel_addr ||
reg->idx[2].rel_addr)
275 "Internal compiler error: Unhandled constant buffer register indirect addressing.");
294 "Internal compiler error: Unhandled register type %#x.",
reg->type);
302 const char swizzle_chars[] =
"xyzw";
339 if (dst_data_type == src_data_type)
347 switch (dst_data_type)
362 switch (dst_data_type)
379 "Internal compiler error: Unhandled bitcast from %#x to %#x.",
380 src_data_type, dst_data_type);
394 if (
reg->non_uniform)
396 "Internal compiler error: Unhandled 'non-uniform' modifier.");
429 "Internal compiler error: Unhandled source modifier(s) %#x.", vsir_src->
modifiers);
458 "Internal compiler error: Unhandled 'precise' modifier.");
459 if (vsir_dst->
reg.non_uniform)
461 "Internal compiler error: Unhandled 'non-uniform' modifier.");
500 if (
dst->vsir->shift)
502 "Internal compiler error: Unhandled destination shift %#x.",
dst->vsir->shift);
505 "Internal compiler error: Unhandled destination modifier(s) %#x.", modifiers);
516 "Internal compiler error: Unhandled destination register data type %#x.",
data_type);
544 shader_glsl_vprint_assignment(gen,
dst,
dst->vsir->reg.data_type,
format,
args);
563 "Internal compiler error: Unhandled instruction %#x.", ins->
opcode);
577 shader_glsl_print_assignment(gen, &
dst,
"%s %s %s",
src[0].
str->buffer,
op,
src[1].str->buffer);
597 shader_glsl_print_assignment(gen, &
dst,
"vec%d(dot(%s, %s))",
600 shader_glsl_print_assignment(gen, &
dst,
"dot(%s, %s)",
626 shader_glsl_print_assignment(gen, &
dst,
"%s(%s)",
op,
args->buffer);
635 unsigned int mask_size;
645 shader_glsl_print_assignment(gen, &
dst,
"uvec%u(%s(%s, %s)) * 0xffffffffu",
646 mask_size, vector_op,
src[0].
str->buffer,
src[1].str->buffer);
648 shader_glsl_print_assignment(gen, &
dst,
"%s %s %s ? 0xffffffffu : 0u",
649 src[0].
str->buffer, scalar_op,
src[1].str->buffer);
657 const char *scalar_constructor,
const char *vector_constructor)
668 shader_glsl_print_assignment(gen, &
dst,
"%s%u(%s)",
671 shader_glsl_print_assignment(gen, &
dst,
"%s(%s)",
779 "Internal compiler error: Invalid texel offset size %u.", offset_size);
789 unsigned int resource_id, resource_idx, resource_space, sample_count;
802 "Internal compiler error: Unhandled texel fetch offset.");
804 if (ins->
src[1].reg.idx[0].rel_addr || ins->
src[1].reg.idx[1].rel_addr)
806 "Descriptor indexing is not supported.");
808 resource_id = ins->
src[1].reg.idx[0].offset;
809 resource_idx = ins->
src[1].reg.idx[1].offset;
812 resource_type =
d->resource_type;
813 resource_space =
d->register_space;
814 sample_count =
d->sample_count;
821 "Internal compiler error: Undeclared resource descriptor %u.", resource_id);
835 "Internal compiler error: Unhandled resource type %#x.", resource_type);
852 else if (sample_count == 1)
902 bool shadow_sampler,
array,
bias, dynamic_offset, gather, grad,
lod, lod_zero,
offset, shadow;
905 unsigned int resource_id, resource_idx, resource_space;
906 unsigned int sampler_id, sampler_idx, sampler_space;
930 "Descriptor indexing is not supported.");
932 resource_id =
resource->reg.idx[0].offset;
933 resource_idx =
resource->reg.idx[1].offset;
936 resource_type =
d->resource_type;
937 resource_space =
d->register_space;
944 "Internal compiler error: Undeclared resource descriptor %u.", resource_id);
958 "Internal compiler error: Unhandled resource type %#x.", resource_type);
963 sampler_id =
sampler->reg.idx[0].offset;
964 sampler_idx =
sampler->reg.idx[1].offset;
967 sampler_space =
d->register_space;
974 "Internal compiler error: Sampler %u is not a comparison sampler.", sampler_id);
980 "Internal compiler error: Sampler %u is a comparison sampler.", sampler_id);
986 "Internal compiler error: Undeclared sampler descriptor %u.", sampler_id);
1061 unsigned int uav_id, uav_idx, uav_space;
1067 if (ins->
src[1].reg.idx[0].rel_addr || ins->
src[1].reg.idx[1].rel_addr)
1069 "Descriptor indexing is not supported.");
1071 uav_id = ins->
src[1].reg.idx[0].offset;
1072 uav_idx = ins->
src[1].reg.idx[1].offset;
1075 resource_type =
d->resource_type;
1076 uav_space =
d->register_space;
1082 "Internal compiler error: Undeclared UAV descriptor %u.", uav_id);
1095 "Internal compiler error: Unhandled UAV type %#x.", resource_type);
1108 shader_glsl_print_assignment_ext(gen, &
dst,
1122 unsigned int uav_id, uav_idx, uav_space;
1127 if (ins->
dst[0].reg.idx[0].rel_addr || ins->
dst[0].reg.idx[1].rel_addr)
1129 "Descriptor indexing is not supported.");
1131 uav_id = ins->
dst[0].reg.idx[0].offset;
1132 uav_idx = ins->
dst[0].reg.idx[1].offset;
1135 resource_type =
d->resource_type;
1136 uav_space =
d->register_space;
1142 "Internal compiler error: Undeclared UAV descriptor %u.", uav_id);
1155 "Internal compiler error: Unhandled UAV type %#x.", resource_type);
1174 "Internal compiler error: Unhandled component type %#x.",
component_type);
1205 shader_glsl_print_assignment(gen, &
dst,
"%s%s",
op,
src.str->buffer);
1220 shader_glsl_print_assignment(gen, &
dst,
"%s",
src.str->
buffer);
1239 shader_glsl_print_assignment(gen, &
dst,
"mix(%s, %s, bvec%u(%s))",
1242 shader_glsl_print_assignment(gen, &
dst,
"mix(%s, %s, bool(%s))",
1243 src[2].
str->buffer,
src[1].str->buffer,
src[0].str->buffer);
1261 shader_glsl_print_assignment(gen, &
dst,
"<unhandled 64-bit multiplication>");
1265 "Internal compiler error: Unhandled 64-bit integer multiplication.");
1274 shader_glsl_print_assignment(gen, &
dst,
"%s * %s",
src[0].
str->buffer,
src[1].str->buffer);
1294 "Internal compiler error: Unhandled SV_POSITION in shader type #%x.",
version->type);
1299 "Internal compiler error: Unhandled SV_POSITION index %u.",
idx);
1309 "Internal compiler error: Unhandled SV_VERTEX_ID in shader type #%x.",
version->type);
1316 "Internal compiler error: Unhandled SV_IS_FRONT_FACE in shader type #%x.",
version->type);
1318 "uintBitsToFloat(uvec4(gl_FrontFacing ? 0xffffffffu : 0u, 0u, 0u, 0u))");
1324 "Internal compiler error: Unhandled SV_SAMPLE_INDEX in shader type #%x.",
version->type);
1331 "Internal compiler error: Unhandled SV_TARGET in shader type #%x.",
version->type);
1338 "Internal compiler error: Unhandled system value %#x.",
sysval);
1365 if (
e->target_location >= gen->
limits.input_count)
1367 "Internal compiler error: Input element %u specifies target location %u, "
1368 "but only %u inputs are supported.",
1369 i,
e->target_location, gen->
limits.input_count);
1373 switch (
e->component_type)
1383 "Internal compiler error: Unhandled input component type %#x.",
e->component_type);
1416 type =
e->component_type;
1424 if (
e->target_location >= gen->
limits.output_count)
1426 "Internal compiler error: Output element %u specifies target location %u, "
1427 "but only %u outputs are supported.",
1428 i,
e->target_location, gen->
limits.output_count);
1434 "Internal compiler error: Unhandled output.");
1452 "Internal compiler error: Unhandled output component type %#x.",
e->component_type);
1696 WARN(
"Invalid shader visibility %#x.\n", visibility);
1723 if (
binding->register_index != register_idx)
1727 if (!(
binding->flags & resource_type_flag))
1740 const char *image_type_prefix, *image_type, *read_format;
1745 unsigned int binding_idx;
1747 if (uav->
count != 1)
1750 "UAV %u has unsupported descriptor array size %u.", uav->
register_id, uav->
count);
1758 "No descriptor binding specified for UAV %u.", uav->
register_id);
1774 "Unsupported binding count %u specified for UAV %u.",
binding->count, uav->
register_id);
1781 if (
offset->static_offset ||
offset->dynamic_offset_index != ~0
u)
1784 "Internal compiler error: Unhandled descriptor offset specified for UAV %u.",
1797 "Internal compiler error: Unhandled UAV type %#x.", uav->
resource_type);
1798 image_type =
"<unhandled image type>";
1804 image_type_prefix =
"u";
1805 read_format =
"r32ui";
1808 image_type_prefix =
"i";
1809 read_format =
"r32i";
1813 "Internal compiler error: Unhandled component type %#x for UAV %u.",
1817 image_type_prefix =
"";
1818 read_format =
"r32f";
1833 unsigned int register_space,
unsigned int register_idx,
unsigned int *binding_idx)
1850 if (
binding->register_index != register_idx)
1870 unsigned int binding_idx;
1873 if (cbv->
count != 1)
1876 "Constant buffer %u has unsupported descriptor array size %u.", cbv->
register_id, cbv->
count);
1883 "No descriptor binding specified for constant buffer %u.", cbv->
register_id);
1892 "Unsupported binding set %u specified for constant buffer %u.",
binding->set, cbv->
register_id);
1899 "Unsupported binding count %u specified for constant buffer %u.",
binding->count, cbv->
register_id);
1906 if (
offset->static_offset ||
offset->dynamic_offset_index != ~0
u)
1909 "Internal compiler error: Unhandled descriptor offset specified for constant buffer %u.",
1919 "layout(std140, binding = %u) uniform block_%s_cb_%u { vec4 %s_cb_%u[%zu]; };\n",
1955 if (!(
s->flags & resource_type_flag))
1972 const char *sampler_type, *sampler_type_prefix;
1974 unsigned int binding_idx;
1975 bool shadow =
false;
1983 "Internal compiler error: No descriptor found for sampler %u, space %u.",
1994 "Internal compiler error: No descriptor found for resource %u, space %u.",
2018 "Comparison samplers are not supported with resource type %#x.", resource_type);
2023 "Internal compiler error: Unhandled resource type %#x for combined resource/sampler "
2024 "for resource %u, space %u and sampler %u, space %u.", resource_type,
2026 sampler_type =
"<unhandled sampler type>";
2032 sampler_type_prefix =
"u";
2035 sampler_type_prefix =
"i";
2038 sampler_type_prefix =
"";
2042 "Internal compiler error: Unhandled component type %#x for combined resource/sampler "
2043 "for resource %u, space %u and sampler %u, space %u.",
component_type,
2045 sampler_type_prefix =
"";
2052 "No descriptor binding specified for combined resource/sampler "
2053 "for resource %u, space %u and sampler %u, space %u.",
2063 "Unsupported binding set %u specified for combined resource/sampler "
2064 "for resource %u, space %u and sampler %u, space %u.",
binding->set,
2072 "Unsupported binding count %u specified for combined resource/sampler "
2073 "for resource %u, space %u and sampler %u, space %u.",
binding->count,
2079 binding->binding, sampler_type_prefix, sampler_type, shadow ?
"Shadow" :
"");
2092 for (
i = 0;
i <
info->descriptor_count; ++
i)
2114 "Internal compiler error: Unhandled descriptor type %#x.",
descriptor->type);
2122 if (
info->descriptor_count)
2152 m =
e->interpolation_mode;
2165 "Internal compiler error: Unhandled interpolation mode %#x for %s location %u.",
m,
type,
location);
2174 const char *interpolation;
2205 "Internal compiler error: Unhandled minimum precision %#x.",
e->min_precision);
2212 "Internal compiler error: Unhandled interpolation mode %#x.",
e->interpolation_mode);
2217 switch (
e->component_type)
2231 "Internal compiler error: Unhandled input component type %#x.",
e->component_type);
2240 else if (gen->
limits.input_count)
2266 "Internal compiler error: Unhandled system value %#x.",
e->sysval_semantic);
2273 "Internal compiler error: Unhandled minimum precision %#x.",
e->min_precision);
2280 "Internal compiler error: Unhandled interpolation mode %#x.",
e->interpolation_mode);
2285 switch (
e->component_type)
2299 "Internal compiler error: Unhandled output component type %#x.",
e->component_type);
2308 else if (gen->
limits.output_count)
2321 flags &= ~VKD3DSGF_FORCE_EARLY_DEPTH_STENCIL;
2337 group_size = &
program->thread_group_size;
2339 group_size->
x, group_size->
y, group_size->
z);
2348 if (gen->
limits.input_count)
2350 if (gen->
limits.output_count)
2364 MESSAGE(
"Generating a GLSL shader. This is unsupported; you get to keep all the pieces if it breaks.\n");
2376 for (
i = 0;
i < instructions->
count; ++
i)
2408 struct shader_limits *limits = &gen->
limits;
2412 "Internal compiler error: Unhandled shader version %u.%u.",
version->major,
version->minor);
2417 limits->input_count = 32;
2418 limits->output_count = 32;
2421 limits->input_count = 32;
2422 limits->output_count = 8;
2425 limits->input_count = 0;
2426 limits->output_count = 0;
2430 "Internal compiler error: Unhandled shader type %#x.",
version->type);
2431 limits->input_count = 0;
2432 limits->output_count = 0;
2445 memset(gen, 0,
sizeof(*gen));
2454 "Internal compiler error: Unhandled shader type %#x.",
type);
unsigned int component_count
static const WCHAR indent[]
static const WCHAR version[]
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLdouble GLdouble GLdouble r
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
static void shader_glsl_dot(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins, uint32_t src_mask)
static void shader_glsl_generate_output_declarations(struct vkd3d_glsl_generator *gen)
static void shader_glsl_intrinsic(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins, const char *op)
static int vkd3d_glsl_generator_generate(struct vkd3d_glsl_generator *gen, struct vkd3d_shader_code *out)
static void vkd3d_glsl_generator_cleanup(struct vkd3d_glsl_generator *gen)
static void shader_glsl_binop(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins, const char *op)
static void shader_glsl_print_subscript(struct vkd3d_string_buffer *buffer, struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_src_param *rel_addr, unsigned int offset)
static void shader_glsl_shader_prologue(struct vkd3d_glsl_generator *gen)
static void shader_glsl_generate_sampler_declaration(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_combined_resource_sampler_info *crs)
static void shader_glsl_mul_extended(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
static void shader_glsl_generate_declarations(struct vkd3d_glsl_generator *gen)
static void shader_glsl_dcl_indexable_temp(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
static void shader_glsl_init_limits(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_version *version)
static void shader_glsl_print_texel_offset(struct vkd3d_string_buffer *buffer, struct vkd3d_glsl_generator *gen, unsigned int offset_size, const struct vkd3d_shader_texel_offset *offset)
static void shader_glsl_default(struct vkd3d_glsl_generator *gen)
static void shader_glsl_print_register_name(struct vkd3d_string_buffer *buffer, struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_register *reg)
static bool shader_glsl_get_uav_binding(const struct vkd3d_glsl_generator *gen, unsigned int register_space, unsigned int register_idx, enum vkd3d_shader_resource_type resource_type, unsigned int *binding_idx)
static void glsl_src_init(struct glsl_src *glsl_src, struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_src_param *vsir_src, uint32_t mask)
static const struct signature_element * signature_get_element_by_location(const struct shader_signature *signature, unsigned int location)
static void shader_glsl_print_combined_sampler_name(struct vkd3d_string_buffer *buffer, struct vkd3d_glsl_generator *gen, unsigned int resource_index, unsigned int resource_space, unsigned int sampler_index, unsigned int sampler_space)
static void shader_glsl_handle_global_flags(struct vkd3d_string_buffer *buffer, struct vkd3d_glsl_generator *gen, enum vsir_global_flags flags)
static void glsl_src_cleanup(struct glsl_src *src, struct vkd3d_string_buffer_cache *cache)
static void shader_glsl_unhandled(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
static void shader_glsl_relop(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins, const char *scalar_op, const char *vector_op)
static void shader_glsl_continue(struct vkd3d_glsl_generator *gen)
static void glsl_dst_cleanup(struct glsl_dst *dst, struct vkd3d_string_buffer_cache *cache)
static bool shader_glsl_check_shader_visibility(const struct vkd3d_glsl_generator *gen, enum vkd3d_shader_visibility visibility)
static void shader_glsl_generate_interface_block(struct vkd3d_glsl_generator *gen, const struct shader_signature *signature, const char *type, unsigned int count)
static void shader_glsl_break(struct vkd3d_glsl_generator *gen)
static void shader_glsl_print_shadow_coord(struct vkd3d_string_buffer *buffer, struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_src_param *coord, const struct vkd3d_shader_src_param *ref, unsigned int coord_size)
static void shader_glsl_ret(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
static bool shader_glsl_get_combined_sampler_binding(const struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_combined_resource_sampler_info *crs, enum vkd3d_shader_resource_type resource_type, unsigned int *binding_idx)
static void shader_glsl_sample(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
static void shader_glsl_mov(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
int glsl_compile(struct vsir_program *program, uint64_t config_flags, const struct vkd3d_shader_scan_descriptor_info1 *descriptor_info, const struct vkd3d_shader_scan_combined_resource_sampler_info *combined_sampler_info, const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_code *out, struct vkd3d_shader_message_context *message_context)
static const struct glsl_resource_type_info * shader_glsl_get_resource_type_info(enum vkd3d_shader_resource_type t)
static void shader_glsl_print_image_name(struct vkd3d_string_buffer *buffer, struct vkd3d_glsl_generator *gen, unsigned int idx, unsigned int space)
static void shader_glsl_if(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
static bool shader_glsl_get_cbv_binding(const struct vkd3d_glsl_generator *gen, unsigned int register_space, unsigned int register_idx, unsigned int *binding_idx)
static void shader_glsl_load_uav_typed(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
static void shader_glsl_cast(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins, const char *scalar_constructor, const char *vector_constructor)
static void shader_glsl_print_sysval_name(struct vkd3d_string_buffer *buffer, struct vkd3d_glsl_generator *gen, enum vkd3d_shader_sysval_semantic sysval, unsigned int idx)
static void shader_glsl_ld(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
static void shader_glsl_print_indent(struct vkd3d_string_buffer *buffer, unsigned int indent)
static void shader_glsl_store_uav_typed(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
static void shader_glsl_case(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
static void shader_glsl_end_block(struct vkd3d_glsl_generator *gen)
static void shader_glsl_unary_op(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins, const char *op)
static void shader_glsl_print_bitcast(struct vkd3d_string_buffer *dst, struct vkd3d_glsl_generator *gen, const char *src, enum vkd3d_data_type dst_data_type, enum vkd3d_data_type src_data_type, unsigned int size)
static const char * shader_glsl_get_interpolation(struct vkd3d_glsl_generator *gen, const struct shader_signature *signature, const char *type, unsigned int location)
static void shader_glsl_shader_epilogue(struct vkd3d_glsl_generator *gen)
static const char * shader_glsl_get_prefix(enum vkd3d_shader_type type)
static void shader_glsl_loop(struct vkd3d_glsl_generator *gen)
static const struct vkd3d_shader_descriptor_info1 * shader_glsl_get_descriptor(struct vkd3d_glsl_generator *gen, enum vkd3d_shader_descriptor_type type, unsigned int idx, unsigned int space)
static const struct vkd3d_shader_descriptor_info1 * shader_glsl_get_descriptor_by_id(struct vkd3d_glsl_generator *gen, enum vkd3d_shader_descriptor_type type, unsigned int id)
static void vkd3d_glsl_handle_instruction(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
static void shader_glsl_print_src(struct vkd3d_string_buffer *buffer, struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_src_param *vsir_src, uint32_t mask, enum vkd3d_data_type data_type)
static void vkd3d_glsl_generator_init(struct vkd3d_glsl_generator *gen, struct vsir_program *program, const struct vkd3d_shader_compile_info *compile_info, const struct vkd3d_shader_scan_descriptor_info1 *descriptor_info, const struct vkd3d_shader_scan_combined_resource_sampler_info *combined_sampler_info, struct vkd3d_shader_message_context *message_context)
static void shader_glsl_switch(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
static void shader_glsl_print_swizzle(struct vkd3d_string_buffer *buffer, uint32_t swizzle, uint32_t mask)
static uint32_t glsl_dst_init(struct glsl_dst *glsl_dst, struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins, const struct vkd3d_shader_dst_param *vsir_dst)
static void shader_glsl_print_write_mask(struct vkd3d_string_buffer *buffer, uint32_t write_mask)
static void shader_glsl_generate_descriptor_declarations(struct vkd3d_glsl_generator *gen)
static void shader_glsl_begin_block(struct vkd3d_glsl_generator *gen)
static void shader_glsl_else(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
static void shader_glsl_generate_input_declarations(struct vkd3d_glsl_generator *gen)
static void shader_glsl_movc(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_instruction *ins)
static void shader_glsl_generate_uav_declaration(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_descriptor_info1 *uav)
static void shader_glsl_generate_cbv_declaration(struct vkd3d_glsl_generator *gen, const struct vkd3d_shader_descriptor_info1 *cbv)
enum wined3d_data_type data_type
static const struct @335 resource_type_info[]
enum vkd3d_result vsir_program_transform(struct vsir_program *program, uint64_t config_flags, const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_message_context *message_context)
#define memcpy(s1, s2, n)
static RPC_BINDING_HANDLE binding
enum vkd3d_shader_sysval_semantic sysval
const struct vkd3d_shader_dst_param * vsir
struct vkd3d_string_buffer * register_name
struct vkd3d_string_buffer * mask
struct vkd3d_string_buffer * str
unsigned int output_count
struct vkd3d_glsl_generator::shader_limits limits
struct vkd3d_shader_message_context * message_context
struct vsir_program * program
struct vkd3d_string_buffer_cache string_buffers
const struct vkd3d_shader_scan_descriptor_info1 * descriptor_info
struct vkd3d_string_buffer * buffer
const struct vkd3d_shader_interface_info * interface_info
const struct vkd3d_shader_scan_combined_resource_sampler_info * combined_sampler_info
struct vkd3d_shader_location location
const struct vkd3d_shader_descriptor_offset_info * offset_info
unsigned int resource_index
unsigned int sampler_index
unsigned int resource_space
unsigned int sampler_space
enum vkd3d_shader_resource_data_type resource_data_type
unsigned int sample_count
unsigned int register_index
enum vkd3d_shader_resource_type resource_type
unsigned int register_space
struct vkd3d_shader_register reg
struct vkd3d_shader_instruction * elements
struct vkd3d_shader_src_param * src
struct vkd3d_shader_location location
struct vkd3d_shader_texel_offset texel_offset
struct vkd3d_shader_indexable_temp indexable_temp
union vkd3d_shader_instruction::@6020 declaration
enum vkd3d_shader_opcode opcode
struct vkd3d_shader_dst_param * dst
unsigned int register_space
unsigned int combined_sampler_count
struct vkd3d_shader_combined_resource_sampler_info * combined_samplers
struct vkd3d_shader_register reg
enum vkd3d_shader_src_modifier modifiers
Character const *const prefix
#define VKD3D_PRINTF_FUNC(fmt, args)
#define VKD3D_ASSERT(cond)
static void * vkd3d_malloc(size_t size)
VKD3D_SHADER_API const char * vkd3d_shader_get_version(unsigned int *major, unsigned int *minor)
@ VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_UAV_READ
@ VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_SAMPLER_COMPARISON_MODE
vkd3d_shader_sysval_semantic
@ VKD3D_SHADER_SV_VERTEX_ID
@ VKD3D_SHADER_SV_IS_FRONT_FACE
@ VKD3D_SHADER_SV_SAMPLE_INDEX
@ VKD3D_SHADER_SV_POSITION
#define VKD3D_SHADER_DUMMY_SAMPLER_INDEX
@ VKD3D_SHADER_VISIBILITY_DOMAIN
@ VKD3D_SHADER_VISIBILITY_COMPUTE
@ VKD3D_SHADER_VISIBILITY_PIXEL
@ VKD3D_SHADER_VISIBILITY_ALL
@ VKD3D_SHADER_VISIBILITY_GEOMETRY
@ VKD3D_SHADER_VISIBILITY_VERTEX
@ VKD3D_SHADER_VISIBILITY_HULL
vkd3d_shader_component_type
@ VKD3D_SHADER_COMPONENT_INT
@ VKD3D_SHADER_COMPONENT_UINT
@ VKD3D_SHADER_COMPONENT_FLOAT
vkd3d_shader_descriptor_type
@ VKD3D_SHADER_DESCRIPTOR_TYPE_UAV
@ VKD3D_SHADER_DESCRIPTOR_TYPE_CBV
@ VKD3D_SHADER_DESCRIPTOR_TYPE_SAMPLER
@ VKD3D_SHADER_DESCRIPTOR_TYPE_SRV
vkd3d_shader_resource_type
@ VKD3D_SHADER_RESOURCE_TEXTURE_2DARRAY
@ VKD3D_SHADER_RESOURCE_TEXTURE_2DMS
@ VKD3D_SHADER_RESOURCE_BUFFER
@ VKD3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY
@ VKD3D_SHADER_RESOURCE_TEXTURE_2D
vkd3d_shader_binding_flag
@ VKD3D_SHADER_BINDING_FLAG_IMAGE
@ VKD3D_SHADER_BINDING_FLAG_BUFFER
@ VKD3D_SHADER_MINIMUM_PRECISION_NONE
int vkd3d_string_buffer_vprintf(struct vkd3d_string_buffer *buffer, const char *format, va_list args)
struct vkd3d_string_buffer * vkd3d_string_buffer_get(struct vkd3d_string_buffer_cache *cache)
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)
void vkd3d_string_buffer_release(struct vkd3d_string_buffer_cache *cache, struct vkd3d_string_buffer *buffer)
void vkd3d_string_buffer_cache_init(struct vkd3d_string_buffer_cache *cache)
void vkd3d_string_buffer_cache_cleanup(struct vkd3d_string_buffer_cache *cache)
int vkd3d_string_buffer_printf(struct vkd3d_string_buffer *buffer, const char *format,...)
#define vkd3d_find_struct(c, t)
#define VKD3DSI_PRECISE_XYZW
static enum vkd3d_shader_component_type vkd3d_component_type_from_resource_data_type(enum vkd3d_shader_resource_data_type data_type)
static bool vkd3d_shader_instruction_has_texel_offset(const struct vkd3d_shader_instruction *ins)
@ VKD3DSGF_FORCE_EARLY_DEPTH_STENCIL
@ VKD3D_SHADER_TYPE_VERTEX
@ VKD3D_SHADER_TYPE_GEOMETRY
@ VKD3D_SHADER_TYPE_COMPUTE
@ VKD3D_SHADER_TYPE_PIXEL
@ VKD3D_SHADER_TYPE_DOMAIN
vkd3d_shader_interpolation_mode
#define VKD3DSP_WRITEMASK_3
static unsigned int vsir_write_mask_component_count(uint32_t write_mask)
@ VKD3D_SHADER_ERROR_GLSL_BINDING_NOT_FOUND
@ VKD3D_SHADER_ERROR_GLSL_UNSUPPORTED
@ VKD3D_SHADER_ERROR_GLSL_INTERNAL
static unsigned int vkd3d_write_mask_from_component_count(unsigned int component_count)
#define VKD3DSP_WRITEMASK_ALL
@ VSIR_FULLY_NORMALISED_IO
static unsigned int vsir_swizzle_get_component(uint32_t swizzle, unsigned int idx)
@ VKD3DSIH_STORE_UAV_TYPED
@ VKD3DSIH_DCL_OUTPUT_SIV
@ VKD3DSIH_DCL_INPUT_PS_SIV
@ VKD3DSIH_DCL_INPUT_PS_SGV
@ VKD3DSIH_DCL_INDEXABLE_TEMP
#define vkd3d_string_buffer_trace(buffer)
static enum vkd3d_data_type vkd3d_data_type_from_component_type(enum vkd3d_shader_component_type component_type)
@ VKD3D_SHADER_CONDITIONAL_OP_NZ
#define VKD3DSP_WRITEMASK_0
#define VKD3DSP_WRITEMASK_1
#define SIGNATURE_TARGET_LOCATION_UNUSED
#define VKD3DSP_WRITEMASK_2
@ 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)