mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader/spirv: Introduce a compiler feature flag for int64 capability.
This commit is contained in:
committed by
Alexandre Julliard
parent
108941fce0
commit
cdb9eecfd1
Notes:
Alexandre Julliard
2023-12-12 23:15:46 +01: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/489
@@ -196,6 +196,14 @@ enum vkd3d_shader_compile_option_fragment_coordinate_origin
|
|||||||
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_COMPILE_OPTION_FRAGMENT_COORDINATE_ORIGIN),
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_COMPILE_OPTION_FRAGMENT_COORDINATE_ORIGIN),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Advertises feature availability. \since 1.11 */
|
||||||
|
enum vkd3d_shader_compile_option_feature_flags
|
||||||
|
{
|
||||||
|
VKD3D_SHADER_COMPILE_OPTION_FEATURE_INT64 = 0x00000001,
|
||||||
|
|
||||||
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_COMPILE_OPTION_FEATURE_FLAGS),
|
||||||
|
};
|
||||||
|
|
||||||
enum vkd3d_shader_compile_option_name
|
enum vkd3d_shader_compile_option_name
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -253,6 +261,16 @@ enum vkd3d_shader_compile_option_name
|
|||||||
* \since 1.10
|
* \since 1.10
|
||||||
*/
|
*/
|
||||||
VKD3D_SHADER_COMPILE_OPTION_FRAGMENT_COORDINATE_ORIGIN = 0x00000009,
|
VKD3D_SHADER_COMPILE_OPTION_FRAGMENT_COORDINATE_ORIGIN = 0x00000009,
|
||||||
|
/**
|
||||||
|
* This option specifies the shader features available in the target
|
||||||
|
* environment. These are not extensions, i.e. they are always supported
|
||||||
|
* by the driver, but may not be supported by the available hardware.
|
||||||
|
*
|
||||||
|
* \a value is a member of enum vkd3d_shader_compile_option_feature_flags.
|
||||||
|
*
|
||||||
|
* \since 1.11
|
||||||
|
*/
|
||||||
|
VKD3D_SHADER_COMPILE_OPTION_FEATURE = 0x0000000a,
|
||||||
|
|
||||||
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_COMPILE_OPTION_NAME),
|
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_COMPILE_OPTION_NAME),
|
||||||
};
|
};
|
||||||
|
@@ -2396,6 +2396,7 @@ struct spirv_compiler
|
|||||||
struct vkd3d_shader_spec_constant *spec_constants;
|
struct vkd3d_shader_spec_constant *spec_constants;
|
||||||
size_t spec_constants_size;
|
size_t spec_constants_size;
|
||||||
enum vkd3d_shader_compile_option_formatting_flags formatting;
|
enum vkd3d_shader_compile_option_formatting_flags formatting;
|
||||||
|
enum vkd3d_shader_compile_option_feature_flags features;
|
||||||
bool write_tess_geom_point_size;
|
bool write_tess_geom_point_size;
|
||||||
|
|
||||||
struct vkd3d_string_buffer_cache string_buffers;
|
struct vkd3d_string_buffer_cache string_buffers;
|
||||||
@@ -2553,6 +2554,10 @@ static struct spirv_compiler *spirv_compiler_create(const struct vkd3d_shader_ve
|
|||||||
WARN("Ignoring unrecognised value %#x for option %#x.\n", option->value, option->name);
|
WARN("Ignoring unrecognised value %#x for option %#x.\n", option->value, option->name);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case VKD3D_SHADER_COMPILE_OPTION_FEATURE:
|
||||||
|
compiler->features = option->value;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
WARN("Ignoring unrecognised option %#x with value %#x.\n", option->name, option->value);
|
WARN("Ignoring unrecognised option %#x with value %#x.\n", option->name, option->value);
|
||||||
break;
|
break;
|
||||||
@@ -5528,9 +5533,16 @@ static void spirv_compiler_emit_dcl_global_flags(struct spirv_compiler *compiler
|
|||||||
|
|
||||||
if (flags & VKD3DSGF_ENABLE_INT64)
|
if (flags & VKD3DSGF_ENABLE_INT64)
|
||||||
{
|
{
|
||||||
FIXME("Unsupported 64-bit integer ops.\n");
|
if (compiler->features & VKD3D_SHADER_COMPILE_OPTION_FEATURE_INT64)
|
||||||
|
{
|
||||||
|
vkd3d_spirv_enable_capability(&compiler->spirv_builder, SpvCapabilityInt64);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
WARN("Unsupported 64-bit integer ops.\n");
|
||||||
spirv_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_UNSUPPORTED_FEATURE,
|
spirv_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_UNSUPPORTED_FEATURE,
|
||||||
"Support for 64-bit integers is not implemented.");
|
"The target environment does not support 64-bit integers.");
|
||||||
|
}
|
||||||
flags &= ~VKD3DSGF_ENABLE_INT64;
|
flags &= ~VKD3DSGF_ENABLE_INT64;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7147,6 +7159,13 @@ static void spirv_compiler_emit_int_div(struct spirv_compiler *compiler,
|
|||||||
div_op = instruction->handler_idx == VKD3DSIH_IDIV ? SpvOpSDiv : SpvOpUDiv;
|
div_op = instruction->handler_idx == VKD3DSIH_IDIV ? SpvOpSDiv : SpvOpUDiv;
|
||||||
mod_op = instruction->handler_idx == VKD3DSIH_IDIV ? SpvOpSRem : SpvOpUMod;
|
mod_op = instruction->handler_idx == VKD3DSIH_IDIV ? SpvOpSRem : SpvOpUMod;
|
||||||
|
|
||||||
|
if (dst[0].reg.data_type == VKD3D_DATA_UINT64 || dst[1].reg.data_type == VKD3D_DATA_UINT64)
|
||||||
|
{
|
||||||
|
FIXME("Unsupported 64-bit result.\n");
|
||||||
|
spirv_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_UNSUPPORTED_FEATURE,
|
||||||
|
"Bool cast to 64-bit integer is not supported.");
|
||||||
|
}
|
||||||
|
|
||||||
if (dst[0].reg.type != VKD3DSPR_NULL)
|
if (dst[0].reg.type != VKD3DSPR_NULL)
|
||||||
{
|
{
|
||||||
component_count = vkd3d_write_mask_component_count(dst[0].write_mask);
|
component_count = vkd3d_write_mask_component_count(dst[0].write_mask);
|
||||||
|
Reference in New Issue
Block a user