Skip to content

Commit 2d863a7

Browse files
committed
emit_spv: deal with constant ops
1 parent 3437afd commit 2d863a7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/shady/emit/spirv/emit_spv.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ SpvId emit_value(Emitter* emitter, BBBuilder bb_builder, const Node* node) {
123123
}
124124
case Constant_TAG: {
125125
const Node* init_value = get_quoted_value(decl->payload.constant.instruction);
126+
if (!init_value && bb_builder) {
127+
SpvId r;
128+
emit_instruction(emitter, NULL, &bb_builder, NULL, decl->payload.constant.instruction, 1, &r);
129+
return r;
130+
}
126131
assert(init_value && "TODO: support some measure of constant expressions");
127132
new = emit_value(emitter, NULL, init_value);
128133
break;

0 commit comments

Comments
 (0)