102 "Internal compiler error: Unhandled register datatype %#x.",
data_type);
119 if (
reg->idx_count != 1)
122 "Internal compiler error: Unhandled input register index count %u.",
reg->idx_count);
126 if (
reg->idx[0].rel_addr)
129 "Internal compiler error: Unhandled input register indirect addressing.");
138 if (
reg->idx_count != 1)
141 "Internal compiler error: Unhandled output register index count %u.",
reg->idx_count);
145 if (
reg->idx[0].rel_addr)
148 "Internal compiler error: Unhandled output register indirect addressing.");
157 if (
reg->idx_count != 3)
160 "Internal compiler error: Unhandled constant buffer register index count %u.",
reg->idx_count);
164 if (
reg->idx[0].rel_addr ||
reg->idx[2].rel_addr)
167 "Internal compiler error: Unhandled constant buffer register indirect addressing.");
177 "Internal compiler error: Unhandled register type %#x.",
reg->type);
185 const char swizzle_chars[] =
"xyzw";
221 if (
reg->non_uniform)
223 "Internal compiler error: Unhandled 'non-uniform' modifier.");
226 "Internal compiler error: Unhandled source modifier(s) %#x.", vsir_src->
modifiers);
246 "Internal compiler error: Unhandled 'precise' modifier.");
247 if (vsir_dst->
reg.non_uniform)
249 "Internal compiler error: Unhandled 'non-uniform' modifier.");
266 if (
dst->vsir->shift)
268 "Internal compiler error: Unhandled destination shift %#x.",
dst->vsir->shift);
269 if (
dst->vsir->modifiers)
271 "Internal compiler error: Unhandled destination modifier(s) %#x.",
dst->vsir->modifiers);
288 "Internal compiler error: Unhandled instruction %#x.", ins->
opcode);
357 WARN(
"Invalid shader visibility %#x.\n", visibility);
363 unsigned int register_space,
unsigned int register_idx,
unsigned int *binding_idx)
380 if (
binding->register_index != register_idx)
398 unsigned int binding_idx;
404 "Constant buffer %u has unsupported descriptor array size %u.", cbv->
register_id, cbv->
count);
411 "No descriptor binding specified for constant buffer %u.", cbv->
register_id);
420 "Unsupported binding set %u specified for constant buffer %u.",
binding->set, cbv->
register_id);
427 "Unsupported binding count %u specified for constant buffer %u.",
binding->count, cbv->
register_id);
445 if (!
info->descriptor_count)
450 for (
i = 0;
i <
info->descriptor_count; ++
i)
464 "Internal compiler error: Unhandled descriptor type %#x.",
descriptor->type);
490 if (
e->sysval_semantic)
493 "Internal compiler error: Unhandled system value %#x.",
e->sysval_semantic);
500 "Internal compiler error: Unhandled minimum precision %#x.",
e->min_precision);
507 "Internal compiler error: Unhandled interpolation mode %#x.",
e->interpolation_mode);
511 if(
e->register_count > 1)
514 "Internal compiler error: Unhandled register count %u.",
e->register_count);
520 switch(
e->component_type)
534 "Internal compiler error: Unhandled component type %#x.",
e->component_type);
550 "Internal compiler error: Unhandled shader type %#x.",
type);
562 switch (
e->sysval_semantic)
572 "Internal compiler error: Unhandled vertex shader system value %#x.",
e->sysval_semantic);
579 switch (
e->sysval_semantic)
586 "Internal compiler error: Unhandled pixel shader system value %#x.",
e->sysval_semantic);
611 "Internal compiler error: Unhandled minimum precision %#x.",
e->min_precision);
618 "Internal compiler error: Unhandled interpolation mode %#x.",
e->interpolation_mode);
622 if(
e->register_count > 1)
625 "Internal compiler error: Unhandled register count %u.",
e->register_count);
631 switch(
e->component_type)
645 "Internal compiler error: Unhandled component type %#x.",
e->component_type);
661 "Internal compiler error: Unhandled shader type %#x.",
type);
697 "Internal compiler error: Unhandled system value %#x input.",
e->sysval_semantic);
717 switch (
e->sysval_semantic)
731 "Internal compiler error: Unhandled system value %#x input.",
e->sysval_semantic);
751 "Internal compiler error: Unhandled shader type %#x.",
type);
762 "constant vkd3d_%s_descriptors& descriptors [[buffer(0)]],\n", gen->
prefix);
790 MESSAGE(
"Generating a MSL shader. This is unsupported; you get to keep all the pieces if it breaks.\n");
794 if (gen->
program->global_flags)
796 "Internal compiler error: Unhandled global flags %#"PRIx64".", (
uint64_t)gen->
program->global_flags);
808 "void %s_main(thread vkd3d_vec4 *v, "
809 "thread vkd3d_vec4 *o",
823 for (
i = 0;
i < instructions->
count; ++
i)
858 memset(gen, 0,
sizeof(*gen));
870 "Internal compiler error: Unhandled shader type %#x.",
type);
static const WCHAR indent[]
GLuint GLuint GLsizei GLenum type
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
enum wined3d_data_type data_type
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)
static RPC_BINDING_HANDLE binding
static void msl_src_init(struct msl_src *msl_src, struct msl_generator *gen, const struct vkd3d_shader_src_param *vsir_src, uint32_t mask)
static int msl_generator_generate(struct msl_generator *gen, struct vkd3d_shader_code *out)
static void msl_print_register_name(struct vkd3d_string_buffer *buffer, struct msl_generator *gen, const struct vkd3d_shader_register *reg)
static void msl_mov(struct msl_generator *gen, const struct vkd3d_shader_instruction *ins)
static void msl_print_swizzle(struct vkd3d_string_buffer *buffer, uint32_t swizzle, uint32_t mask)
static void msl_generate_cbv_declaration(struct msl_generator *gen, const struct vkd3d_shader_descriptor_info1 *cbv)
static void msl_unhandled(struct msl_generator *gen, const struct vkd3d_shader_instruction *ins)
static void msl_generator_cleanup(struct msl_generator *gen)
static void msl_print_write_mask(struct vkd3d_string_buffer *buffer, uint32_t write_mask)
static void msl_dst_cleanup(struct msl_dst *dst, struct vkd3d_string_buffer_cache *cache)
static void msl_handle_instruction(struct msl_generator *gen, const struct vkd3d_shader_instruction *ins)
static const char * msl_get_prefix(enum vkd3d_shader_type type)
static uint32_t msl_dst_init(struct msl_dst *msl_dst, struct msl_generator *gen, const struct vkd3d_shader_instruction *ins, const struct vkd3d_shader_dst_param *vsir_dst)
static void msl_generate_entrypoint(struct msl_generator *gen)
static void msl_generate_descriptor_struct_declarations(struct msl_generator *gen)
static void msl_src_cleanup(struct msl_src *src, struct vkd3d_string_buffer_cache *cache)
static void msl_print_indent(struct vkd3d_string_buffer *buffer, unsigned int indent)
int msl_compile(struct vsir_program *program, uint64_t config_flags, const struct vkd3d_shader_scan_descriptor_info1 *descriptor_info, const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_code *out, struct vkd3d_shader_message_context *message_context)
static void msl_generate_output_struct_declarations(struct msl_generator *gen)
static void msl_ret(struct msl_generator *gen, const struct vkd3d_shader_instruction *ins)
static void msl_generate_entrypoint_epilogue(struct msl_generator *gen)
static void msl_generate_entrypoint_prologue(struct msl_generator *gen)
static void msl_generate_input_struct_declarations(struct msl_generator *gen)
static bool msl_get_cbv_binding(const struct msl_generator *gen, unsigned int register_space, unsigned int register_idx, unsigned int *binding_idx)
static void msl_generate_pixel_output_element_attribute(struct msl_generator *gen, const struct signature_element *e)
static bool msl_check_shader_visibility(const struct msl_generator *gen, enum vkd3d_shader_visibility visibility)
static void msl_generate_vertex_output_element_attribute(struct msl_generator *gen, const struct signature_element *e)
static int msl_generator_init(struct msl_generator *gen, struct vsir_program *program, const struct vkd3d_shader_compile_info *compile_info, const struct vkd3d_shader_scan_descriptor_info1 *descriptor_info, struct vkd3d_shader_message_context *message_context)
static void msl_print_register_datatype(struct vkd3d_string_buffer *buffer, struct msl_generator *gen, enum vkd3d_data_type data_type)
const struct vkd3d_shader_dst_param * vsir
struct vkd3d_string_buffer * register_name
struct vkd3d_string_buffer * mask
struct vkd3d_shader_location location
const struct vkd3d_shader_scan_descriptor_info1 * descriptor_info
struct vkd3d_string_buffer * buffer
struct vkd3d_string_buffer_cache string_buffers
struct vkd3d_shader_message_context * message_context
const struct vkd3d_shader_interface_info * interface_info
struct vsir_program * program
struct vkd3d_string_buffer * str
unsigned int register_index
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
enum vkd3d_shader_opcode opcode
struct vkd3d_shader_dst_param * dst
unsigned int register_space
struct vkd3d_shader_register reg
enum vkd3d_shader_src_modifier modifiers
#define VKD3D_PRINTF_FUNC(fmt, args)
#define VKD3D_ASSERT(cond)
VKD3D_SHADER_API const char * vkd3d_shader_get_version(unsigned int *major, unsigned int *minor)
@ VKD3D_SHADER_SV_POSITION
@ 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_INT
@ VKD3D_SHADER_COMPONENT_UINT
@ VKD3D_SHADER_COMPONENT_FLOAT
@ VKD3D_SHADER_DESCRIPTOR_TYPE_CBV
@ 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_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)
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
@ VKD3D_SHADER_TYPE_VERTEX
@ VKD3D_SHADER_TYPE_GEOMETRY
@ VKD3D_SHADER_TYPE_COMPUTE
@ VKD3D_SHADER_TYPE_PIXEL
@ VKD3D_SHADER_TYPE_DOMAIN
#define VKD3DSP_WRITEMASK_3
@ VKD3D_SHADER_ERROR_MSL_BINDING_NOT_FOUND
@ VKD3D_SHADER_ERROR_MSL_INTERNAL
@ VSIR_FULLY_NORMALISED_IO
static unsigned int vsir_swizzle_get_component(uint32_t swizzle, unsigned int idx)
@ VKD3DSIH_DCL_OUTPUT_SIV
#define vkd3d_string_buffer_trace(buffer)
static enum vkd3d_data_type vkd3d_data_type_from_component_type(enum vkd3d_shader_component_type component_type)
#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)