mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/spirv: Support UINT64 source in spirv_compiler_emit_bool_cast().
This commit is contained in:
parent
99924d913b
commit
1eaa7d1dbe
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
@ -4362,6 +4362,19 @@ static uint32_t spirv_compiler_emit_bool_to_int(struct spirv_compiler *compiler,
|
||||
return vkd3d_spirv_build_op_select(builder, type_id, val_id, true_id, false_id);
|
||||
}
|
||||
|
||||
static uint32_t spirv_compiler_emit_bool_to_int64(struct spirv_compiler *compiler,
|
||||
unsigned int component_count, uint32_t val_id, bool signedness)
|
||||
{
|
||||
struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
|
||||
uint32_t type_id, true_id, false_id;
|
||||
|
||||
true_id = spirv_compiler_get_constant_uint64_vector(compiler, signedness ? UINT64_MAX : 1,
|
||||
component_count);
|
||||
false_id = spirv_compiler_get_constant_uint64_vector(compiler, 0, component_count);
|
||||
type_id = vkd3d_spirv_get_type_id(builder, VKD3D_SHADER_COMPONENT_UINT64, component_count);
|
||||
return vkd3d_spirv_build_op_select(builder, type_id, val_id, true_id, false_id);
|
||||
}
|
||||
|
||||
static uint32_t spirv_compiler_emit_bool_to_float(struct spirv_compiler *compiler,
|
||||
unsigned int component_count, uint32_t val_id, bool signedness)
|
||||
{
|
||||
@ -6741,6 +6754,10 @@ static void spirv_compiler_emit_bool_cast(struct spirv_compiler *compiler,
|
||||
{
|
||||
val_id = spirv_compiler_emit_bool_to_int(compiler, 1, val_id, instruction->handler_idx == VKD3DSIH_ITOI);
|
||||
}
|
||||
else if (dst->reg.data_type == VKD3D_DATA_UINT64)
|
||||
{
|
||||
val_id = spirv_compiler_emit_bool_to_int64(compiler, 1, val_id, instruction->handler_idx == VKD3DSIH_ITOI);
|
||||
}
|
||||
else
|
||||
{
|
||||
WARN("Unhandled data type %u.\n", dst->reg.data_type);
|
||||
|
Loading…
x
Reference in New Issue
Block a user