Skip to content

Commit

Permalink
Align validation with greatest common requirement
Browse files Browse the repository at this point in the history
While the Metal backend will accept a larger buffer neither
the GL nor the DirectX backend will. By making validation
stricter we prevent code developed with the Metal backend
from crashing when run on GL or DX.
  • Loading branch information
nmr8acme authored Jan 19, 2023
1 parent b3aecb2 commit 9520c57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sokol_gfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -15062,7 +15062,7 @@ _SOKOL_PRIVATE bool _sg_validate_apply_uniforms(sg_shader_stage stage_index, int
SOKOL_VALIDATE(ub_index < stage->num_uniform_blocks, _SG_VALIDATE_AUB_NO_UB_AT_SLOT);

/* check that the provided data size doesn't exceed the uniform block size */
SOKOL_VALIDATE(data->size <= stage->uniform_blocks[ub_index].size, _SG_VALIDATE_AUB_SIZE);
SOKOL_VALIDATE(data->size == stage->uniform_blocks[ub_index].size, _SG_VALIDATE_AUB_SIZE);

return SOKOL_VALIDATE_END();
#endif
Expand Down

0 comments on commit 9520c57

Please sign in to comment.