mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/spirv: Handle the WAVELANECOUNT register.
This commit is contained in:
parent
6a56b4e5d8
commit
a130c970a6
Notes:
Alexandre Julliard
2024-05-02 22:40:21 +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/800
@ -2631,6 +2631,11 @@ static bool spirv_compiler_is_opengl_target(const struct spirv_compiler *compile
|
||||
return spirv_compiler_get_target_environment(compiler) == VKD3D_SHADER_SPIRV_ENVIRONMENT_OPENGL_4_5;
|
||||
}
|
||||
|
||||
static bool spirv_compiler_is_spirv_min_1_3_target(const struct spirv_compiler *compiler)
|
||||
{
|
||||
return spirv_compiler_get_target_environment(compiler) == VKD3D_SHADER_SPIRV_ENVIRONMENT_VULKAN_1_1;
|
||||
}
|
||||
|
||||
static bool spirv_compiler_is_target_extension_supported(const struct spirv_compiler *compiler,
|
||||
enum vkd3d_shader_spirv_extension extension)
|
||||
{
|
||||
@ -3149,6 +3154,9 @@ static bool spirv_compiler_get_register_name(char *buffer, unsigned int buffer_s
|
||||
case VKD3DSPR_OUTSTENCILREF:
|
||||
snprintf(buffer, buffer_size, "oStencilRef");
|
||||
break;
|
||||
case VKD3DSPR_WAVELANECOUNT:
|
||||
snprintf(buffer, buffer_size, "vWaveLaneCount");
|
||||
break;
|
||||
default:
|
||||
FIXME("Unhandled register %#x.\n", reg->type);
|
||||
snprintf(buffer, buffer_size, "unrecognized_%#x", reg->type);
|
||||
@ -4534,6 +4542,9 @@ static void spirv_compiler_decorate_builtin(struct spirv_compiler *compiler,
|
||||
case SpvBuiltInCullDistance:
|
||||
vkd3d_spirv_enable_capability(builder, SpvCapabilityCullDistance);
|
||||
break;
|
||||
case SpvBuiltInSubgroupSize:
|
||||
vkd3d_spirv_enable_capability(builder, SpvCapabilityGroupNonUniform);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -4723,6 +4734,8 @@ vkd3d_register_builtins[] =
|
||||
{VKD3DSPR_DEPTHOUTLE, {VKD3D_SHADER_COMPONENT_FLOAT, 1, SpvBuiltInFragDepth}},
|
||||
|
||||
{VKD3DSPR_OUTSTENCILREF, {VKD3D_SHADER_COMPONENT_UINT, 1, SpvBuiltInFragStencilRefEXT}},
|
||||
|
||||
{VKD3DSPR_WAVELANECOUNT, {VKD3D_SHADER_COMPONENT_UINT, 1, SpvBuiltInSubgroupSize}},
|
||||
};
|
||||
|
||||
static void spirv_compiler_emit_register_execution_mode(struct spirv_compiler *compiler,
|
||||
@ -5771,6 +5784,23 @@ static void spirv_compiler_emit_dcl_global_flags(struct spirv_compiler *compiler
|
||||
flags &= ~VKD3DSGF_ENABLE_INT64;
|
||||
}
|
||||
|
||||
if (flags & VKD3DSGF_ENABLE_WAVE_INTRINSICS)
|
||||
{
|
||||
if (!(compiler->features & VKD3D_SHADER_COMPILE_OPTION_FEATURE_WAVE_OPS))
|
||||
{
|
||||
WARN("Unsupported wave ops.\n");
|
||||
spirv_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_UNSUPPORTED_FEATURE,
|
||||
"The target environment does not support wave ops.");
|
||||
}
|
||||
else if (!spirv_compiler_is_spirv_min_1_3_target(compiler))
|
||||
{
|
||||
WARN("Wave ops enabled but environment does not support SPIR-V 1.3 or greater.\n");
|
||||
spirv_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_UNSUPPORTED_FEATURE,
|
||||
"The target environment uses wave ops but does not support SPIR-V 1.3 or greater.");
|
||||
}
|
||||
flags &= ~VKD3DSGF_ENABLE_WAVE_INTRINSICS;
|
||||
}
|
||||
|
||||
if (flags & ~(VKD3DSGF_REFACTORING_ALLOWED | VKD3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS))
|
||||
FIXME("Unhandled global flags %#"PRIx64".\n", (uint64_t)flags);
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user