vkd3d-shader: Define more global flags.

This commit is contained in:
Conor McCarthy 2023-10-03 14:50:09 +10:00 committed by Alexandre Julliard
parent 47d4097efa
commit 06f8a88466
Notes: Alexandre Julliard 2023-10-17 22:39:39 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/388
4 changed files with 36 additions and 8 deletions

View File

@ -391,13 +391,14 @@ static unsigned int shader_get_float_offset(enum vkd3d_shader_register_type regi
} }
} }
static void shader_dump_global_flags(struct vkd3d_d3d_asm_compiler *compiler, uint32_t global_flags) static void shader_dump_global_flags(struct vkd3d_d3d_asm_compiler *compiler,
enum vkd3d_shader_global_flags global_flags)
{ {
unsigned int i; unsigned int i;
static const struct static const struct
{ {
unsigned int flag; enum vkd3d_shader_global_flags flag;
const char *name; const char *name;
} }
global_flag_info[] = global_flag_info[] =
@ -423,7 +424,7 @@ static void shader_dump_global_flags(struct vkd3d_d3d_asm_compiler *compiler, ui
} }
if (global_flags) if (global_flags)
vkd3d_string_buffer_printf(&compiler->buffer, "unknown_flags(%#x)", global_flags); vkd3d_string_buffer_printf(&compiler->buffer, "unknown_flags(%#"PRIx64")", global_flags);
} }
static void shader_dump_sync_flags(struct vkd3d_d3d_asm_compiler *compiler, uint32_t sync_flags) static void shader_dump_sync_flags(struct vkd3d_d3d_asm_compiler *compiler, uint32_t sync_flags)
@ -1637,7 +1638,7 @@ static void shader_dump_instruction(struct vkd3d_d3d_asm_compiler *compiler,
case VKD3DSIH_DCL_GLOBAL_FLAGS: case VKD3DSIH_DCL_GLOBAL_FLAGS:
vkd3d_string_buffer_printf(buffer, " "); vkd3d_string_buffer_printf(buffer, " ");
shader_dump_global_flags(compiler, ins->flags); shader_dump_global_flags(compiler, ins->declaration.global_flags);
break; break;
case VKD3DSIH_DCL_HS_MAX_TESSFACTOR: case VKD3DSIH_DCL_HS_MAX_TESSFACTOR:

View File

@ -5378,7 +5378,7 @@ static size_t spirv_compiler_get_current_function_location(struct spirv_compiler
static void spirv_compiler_emit_dcl_global_flags(struct spirv_compiler *compiler, static void spirv_compiler_emit_dcl_global_flags(struct spirv_compiler *compiler,
const struct vkd3d_shader_instruction *instruction) const struct vkd3d_shader_instruction *instruction)
{ {
unsigned int flags = instruction->flags; enum vkd3d_shader_global_flags flags = instruction->declaration.global_flags;
if (flags & VKD3DSGF_FORCE_EARLY_DEPTH_STENCIL) if (flags & VKD3DSGF_FORCE_EARLY_DEPTH_STENCIL)
{ {
@ -5393,9 +5393,9 @@ static void spirv_compiler_emit_dcl_global_flags(struct spirv_compiler *compiler
} }
if (flags & ~(VKD3DSGF_REFACTORING_ALLOWED | VKD3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS)) if (flags & ~(VKD3DSGF_REFACTORING_ALLOWED | VKD3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS))
FIXME("Unhandled global flags %#x.\n", flags); FIXME("Unhandled global flags %#"PRIx64".\n", flags);
else else
WARN("Unhandled global flags %#x.\n", flags); WARN("Unhandled global flags %#"PRIx64".\n", flags);
} }
static void spirv_compiler_emit_temps(struct spirv_compiler *compiler, uint32_t count) static void spirv_compiler_emit_temps(struct spirv_compiler *compiler, uint32_t count)

View File

@ -1092,7 +1092,7 @@ static void shader_sm4_read_dcl_indexable_temp(struct vkd3d_shader_instruction *
static void shader_sm4_read_dcl_global_flags(struct vkd3d_shader_instruction *ins, uint32_t opcode, 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 *priv) uint32_t opcode_token, const uint32_t *tokens, unsigned int token_count, struct vkd3d_shader_sm4_parser *priv)
{ {
ins->flags = (opcode_token & VKD3D_SM4_GLOBAL_FLAGS_MASK) >> VKD3D_SM4_GLOBAL_FLAGS_SHIFT; ins->declaration.global_flags = (opcode_token & VKD3D_SM4_GLOBAL_FLAGS_MASK) >> VKD3D_SM4_GLOBAL_FLAGS_SHIFT;
} }
static void shader_sm5_read_fcall(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token, static void shader_sm5_read_fcall(struct vkd3d_shader_instruction *ins, uint32_t opcode, uint32_t opcode_token,

View File

@ -642,6 +642,32 @@ enum vkd3d_shader_global_flags
VKD3DSGF_SKIP_OPTIMIZATION = 0x10, VKD3DSGF_SKIP_OPTIMIZATION = 0x10,
VKD3DSGF_ENABLE_MINIMUM_PRECISION = 0x20, VKD3DSGF_ENABLE_MINIMUM_PRECISION = 0x20,
VKD3DSGF_ENABLE_11_1_DOUBLE_EXTENSIONS = 0x40, VKD3DSGF_ENABLE_11_1_DOUBLE_EXTENSIONS = 0x40,
VKD3DSGF_ENABLE_SHADER_EXTENSIONS = 0x80, /* never emitted? */
VKD3DSGF_BIND_FOR_DURATION = 0x100,
VKD3DSGF_ENABLE_VP_AND_RT_ARRAY_INDEX = 0x200,
VKD3DSGF_ENABLE_INNER_COVERAGE = 0x400,
VKD3DSGF_ENABLE_STENCIL_REF = 0x800,
VKD3DSGF_ENABLE_TILED_RESOURCE_INTRINSICS = 0x1000,
VKD3DSGF_ENABLE_RELAXED_TYPED_UAV_FORMATS = 0x2000,
VKD3DSGF_ENABLE_LVL_9_COMPARISON_FILTERING = 0x4000,
VKD3DSGF_ENABLE_UP_TO_64_UAVS = 0x8000,
VKD3DSGF_ENABLE_UAVS_AT_EVERY_STAGE = 0x10000,
VKD3DSGF_ENABLE_CS4_RAW_STRUCTURED_BUFFERS = 0x20000,
VKD3DSGF_ENABLE_RASTERIZER_ORDERED_VIEWS = 0x40000,
VKD3DSGF_ENABLE_WAVE_INTRINSICS = 0x80000,
VKD3DSGF_ENABLE_INT64 = 0x100000,
VKD3DSGF_ENABLE_VIEWID = 0x200000,
VKD3DSGF_ENABLE_BARYCENTRICS = 0x400000,
VKD3DSGF_FORCE_NATIVE_LOW_PRECISION = 0x800000,
VKD3DSGF_ENABLE_SHADINGRATE = 0x1000000,
VKD3DSGF_ENABLE_RAYTRACING_TIER_1_1 = 0x2000000,
VKD3DSGF_ENABLE_SAMPLER_FEEDBACK = 0x4000000,
VKD3DSGF_ENABLE_ATOMIC_INT64_ON_TYPED_RESOURCE = 0x8000000,
VKD3DSGF_ENABLE_ATOMIC_INT64_ON_GROUP_SHARED = 0x10000000,
VKD3DSGF_ENABLE_DERIVATIVES_IN_MESH_AND_AMPLIFICATION_SHADERS = 0x20000000,
VKD3DSGF_ENABLE_RESOURCE_DESCRIPTOR_HEAP_INDEXING = 0x40000000,
VKD3DSGF_ENABLE_SAMPLER_DESCRIPTOR_HEAP_INDEXING = 0x80000000,
VKD3DSGF_ENABLE_ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE = 0x100000000ull,
}; };
enum vkd3d_shader_sync_flags enum vkd3d_shader_sync_flags
@ -1016,6 +1042,7 @@ struct vkd3d_shader_instruction
const struct vkd3d_shader_src_param *predicate; const struct vkd3d_shader_src_param *predicate;
union union
{ {
enum vkd3d_shader_global_flags global_flags;
struct vkd3d_shader_semantic semantic; struct vkd3d_shader_semantic semantic;
struct vkd3d_shader_register_semantic register_semantic; struct vkd3d_shader_register_semantic register_semantic;
struct vkd3d_shader_primitive_type primitive_type; struct vkd3d_shader_primitive_type primitive_type;