mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/spirv: Implement the WAVE_PREFIX_BIT_COUNT instruction.
This commit is contained in:
committed by
Alexandre Julliard
parent
2810edf45b
commit
77259da1ad
Notes:
Alexandre Julliard
2024-05-13 22:56:53 +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/856
@@ -9902,7 +9902,8 @@ static void spirv_compiler_emit_wave_bit_count(struct spirv_compiler *compiler,
|
|||||||
SpvGroupOperation group_op;
|
SpvGroupOperation group_op;
|
||||||
uint32_t type_id, val_id;
|
uint32_t type_id, val_id;
|
||||||
|
|
||||||
group_op = SpvGroupOperationReduce;
|
group_op = (instruction->handler_idx == VKD3DSIH_WAVE_PREFIX_BIT_COUNT) ? SpvGroupOperationExclusiveScan
|
||||||
|
: SpvGroupOperationReduce;
|
||||||
|
|
||||||
val_id = spirv_compiler_emit_group_nonuniform_ballot(compiler, instruction->src);
|
val_id = spirv_compiler_emit_group_nonuniform_ballot(compiler, instruction->src);
|
||||||
type_id = vkd3d_spirv_get_type_id(builder, VKD3D_SHADER_COMPONENT_UINT, 1);
|
type_id = vkd3d_spirv_get_type_id(builder, VKD3D_SHADER_COMPONENT_UINT, 1);
|
||||||
@@ -10288,6 +10289,7 @@ static int spirv_compiler_handle_instruction(struct spirv_compiler *compiler,
|
|||||||
spirv_compiler_emit_wave_alu_op(compiler, instruction);
|
spirv_compiler_emit_wave_alu_op(compiler, instruction);
|
||||||
break;
|
break;
|
||||||
case VKD3DSIH_WAVE_ALL_BIT_COUNT:
|
case VKD3DSIH_WAVE_ALL_BIT_COUNT:
|
||||||
|
case VKD3DSIH_WAVE_PREFIX_BIT_COUNT:
|
||||||
spirv_compiler_emit_wave_bit_count(compiler, instruction);
|
spirv_compiler_emit_wave_bit_count(compiler, instruction);
|
||||||
break;
|
break;
|
||||||
case VKD3DSIH_WAVE_IS_FIRST_LANE:
|
case VKD3DSIH_WAVE_IS_FIRST_LANE:
|
||||||
|
@@ -196,7 +196,7 @@ void main(uint id : SV_GroupIndex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
[test]
|
[test]
|
||||||
todo dispatch 4 1 1
|
dispatch 4 1 1
|
||||||
probe uav 1 (0) rui (0)
|
probe uav 1 (0) rui (0)
|
||||||
probe uav 1 (1) rui (1)
|
probe uav 1 (1) rui (1)
|
||||||
probe uav 1 (2) rui (1)
|
probe uav 1 (2) rui (1)
|
||||||
|
Reference in New Issue
Block a user