vkd3d-shader/spirv: Implement the WAVE_PREFIX_BIT_COUNT instruction.

This commit is contained in:
Conor McCarthy 2024-04-23 22:03:14 +10:00 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
2 changed files with 4 additions and 2 deletions

View File

@ -9902,7 +9902,8 @@ static void spirv_compiler_emit_wave_bit_count(struct spirv_compiler *compiler,
SpvGroupOperation group_op;
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);
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);
break;
case VKD3DSIH_WAVE_ALL_BIT_COUNT:
case VKD3DSIH_WAVE_PREFIX_BIT_COUNT:
spirv_compiler_emit_wave_bit_count(compiler, instruction);
break;
case VKD3DSIH_WAVE_IS_FIRST_LANE:

View File

@ -196,7 +196,7 @@ void main(uint id : SV_GroupIndex)
}
[test]
todo dispatch 4 1 1
dispatch 4 1 1
probe uav 1 (0) rui (0)
probe uav 1 (1) rui (1)
probe uav 1 (2) rui (1)