Skip to content

Commit

Permalink
vulkan: Fix off-by-one error resulting in spurious set_error calls
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSpydog authored and flibitijibibo committed Jun 24, 2023
1 parent 117873b commit b4d377f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mojoshader_vulkan.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ static void update_uniform_buffer(
ubo->currentBlockSize = next_highest_offset_alignment(ctx, uniform_data_size(shader));
ubo->currentBlockIncrement = ubo->currentBlockSize;

if (ubo->dynamicOffset + ubo->currentBlockSize >= ubo->bufferSize * ctx->frameIndex)
if (ubo->dynamicOffset + ubo->currentBlockSize >= ubo->bufferSize * (ctx->frameIndex + 1))
{
set_error("UBO overflow!!");
} // if
Expand Down

0 comments on commit b4d377f

Please sign in to comment.