mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/spirv: Introduce a UINT64 component type.
This commit is contained in:
parent
fe44873979
commit
13459a55f1
Notes:
Alexandre Julliard
2024-01-02 23:08:54 +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/490
@ -1569,6 +1569,8 @@ enum vkd3d_shader_component_type
|
||||
VKD3D_SHADER_COMPONENT_BOOL = 0x4,
|
||||
/** 64-bit IEEE floating-point. */
|
||||
VKD3D_SHADER_COMPONENT_DOUBLE = 0x5,
|
||||
/** 64-bit unsigned integer. \since 1.11 */
|
||||
VKD3D_SHADER_COMPONENT_UINT64 = 0x6,
|
||||
|
||||
VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_COMPONENT_TYPE),
|
||||
};
|
||||
|
@ -1797,6 +1797,8 @@ static uint32_t vkd3d_spirv_get_type_id(struct vkd3d_spirv_builder *builder,
|
||||
break;
|
||||
case VKD3D_SHADER_COMPONENT_DOUBLE:
|
||||
return vkd3d_spirv_get_op_type_float(builder, 64);
|
||||
case VKD3D_SHADER_COMPONENT_UINT64:
|
||||
return vkd3d_spirv_get_op_type_int(builder, 64, 0);
|
||||
default:
|
||||
FIXME("Unhandled component type %#x.\n", component_type);
|
||||
return 0;
|
||||
@ -1830,6 +1832,8 @@ static uint32_t vkd3d_spirv_get_type_id_for_data_type(struct vkd3d_spirv_builder
|
||||
break;
|
||||
case VKD3D_DATA_DOUBLE:
|
||||
return vkd3d_spirv_get_op_type_float(builder, 64);
|
||||
case VKD3D_DATA_UINT64:
|
||||
return vkd3d_spirv_get_op_type_int(builder, 64, 0);
|
||||
case VKD3D_DATA_BOOL:
|
||||
return vkd3d_spirv_get_op_type_bool(builder);
|
||||
default:
|
||||
@ -2988,7 +2992,7 @@ static uint32_t spirv_compiler_get_constant64(struct spirv_compiler *compiler,
|
||||
assert(0 < component_count && component_count <= VKD3D_DVEC2_SIZE);
|
||||
type_id = vkd3d_spirv_get_type_id(builder, component_type, component_count);
|
||||
|
||||
if (component_type != VKD3D_SHADER_COMPONENT_DOUBLE)
|
||||
if (component_type != VKD3D_SHADER_COMPONENT_DOUBLE && component_type != VKD3D_SHADER_COMPONENT_UINT64)
|
||||
{
|
||||
FIXME("Unhandled component_type %#x.\n", component_type);
|
||||
return vkd3d_spirv_get_op_undef(builder, type_id);
|
||||
|
@ -622,7 +622,7 @@ static inline bool data_type_is_bool(enum vkd3d_data_type data_type)
|
||||
|
||||
static inline bool data_type_is_64_bit(enum vkd3d_data_type data_type)
|
||||
{
|
||||
return data_type == VKD3D_DATA_DOUBLE;
|
||||
return data_type == VKD3D_DATA_DOUBLE || data_type == VKD3D_DATA_UINT64;
|
||||
}
|
||||
|
||||
enum vsir_dimension
|
||||
@ -1460,6 +1460,8 @@ static inline enum vkd3d_shader_component_type vkd3d_component_type_from_data_ty
|
||||
return VKD3D_SHADER_COMPONENT_INT;
|
||||
case VKD3D_DATA_DOUBLE:
|
||||
return VKD3D_SHADER_COMPONENT_DOUBLE;
|
||||
case VKD3D_DATA_UINT64:
|
||||
return VKD3D_SHADER_COMPONENT_UINT64;
|
||||
case VKD3D_DATA_BOOL:
|
||||
return VKD3D_SHADER_COMPONENT_BOOL;
|
||||
default:
|
||||
|
@ -244,4 +244,4 @@ float4 main() : sv_target
|
||||
[test]
|
||||
uniform 0 uint64_t2 0x300000000 0x500000000
|
||||
draw quad
|
||||
todo probe all rgba (25769803776.0, 4294967296.0, 30064771072.0, 1.844674404e19) 1
|
||||
probe all rgba (25769803776.0, 4294967296.0, 30064771072.0, 1.844674404e19) 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user