Skip to content

Commit

Permalink
Output a proper SPIR-V bound value
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Oct 15, 2023
1 parent d3fddf1 commit b42e2a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/backends/spirv.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,10 @@ static void write_generator_magic_number(instructions_buffer *instructions) {
instructions->instructions[instructions->offset++] = 0; // TODO: Register a number at https://github.com/KhronosGroup/SPIRV-Headers
}

static uint32_t next_index = 1;

static void write_bound(instructions_buffer *instructions) {
instructions->instructions[instructions->offset++] = 256; // TODO: Exclusive upper bound of used IDs
instructions->instructions[instructions->offset++] = next_index;
}

static void write_instruction_schema(instructions_buffer *instructions) {
Expand All @@ -190,8 +192,6 @@ static void write_capability(instructions_buffer *instructions, capability c) {
write_instruction(instructions, 2, SPIRV_OPCODE_CAPABILITY, &operand);
}

static uint32_t next_index = 1;

static uint32_t allocate_index(void) {
uint32_t result = next_index;
++next_index;
Expand Down

0 comments on commit b42e2a4

Please sign in to comment.