Skip to content

Commit 15e6fd4

Browse files
committed
fixed nvidia proprietary hack
1 parent 07c82db commit 15e6fd4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/shady/emit/spirv/emit_spv_instructions.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "../../type.h"
77
#include "../../transform/memory_layout.h"
8+
#include "../../transform/ir_gen_helpers.h"
89

910
#include <assert.h>
1011

@@ -236,8 +237,8 @@ static void emit_primop(Emitter* emitter, FnBuilder fn_builder, BBBuilder bb_bui
236237

237238
if (emitter->configuration->hacks.spv_shuffle_instead_of_broadcast_first) {
238239
SpvId local_id;
239-
error("TODO: fix")
240-
//emit_primop(emitter, fn_builder, bb_builder, prim_op(emitter->arena, (PrimOp) { .op = subgroup_local_id_op }), 1, &local_id);
240+
const Node* b = ref_decl_helper(emitter->arena, get_builtin(emitter->module, BuiltinSubgroupLocalInvocationId, NULL));
241+
emit_primop(emitter, fn_builder, bb_builder, prim_op(emitter->arena, (PrimOp) { .op = load_op, .operands = singleton(b) }), 1, &local_id);
241242
result = spvb_group_shuffle(bb_builder, emit_type(emitter, get_unqualified_type(first(args)->type)), scope_subgroup, emit_value(emitter, bb_builder, first(args)), local_id);
242243
spvb_capability(emitter->file_builder, SpvCapabilityGroupNonUniformShuffle);
243244
} else {

0 commit comments

Comments
 (0)