Commit: 5b525bd50ff1c2a2d33906a2b5cc9a7fa7db92aa
Parent: a38101cc5dea56e72d401e2fd7427605017d0805
Author: Randy Palamar
Date: Thu, 18 Jun 2026 12:17:50 -0600
core: fix bogus dirty shader assert
There should be 1 bit per shader and what the assert was supposed
to check was that bits outside the supported stage count were not
set. However the mask to do this would need 16 bits set not the 4
needed to count 16 stages. Instead just assert that the bit index
is less than the maximum shader count.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/beamformer_core.c b/beamformer_core.c
@@ -1351,10 +1351,10 @@ complete_queue(BeamformerCtx *ctx, BeamformWorkQueue *q, Arena *arena)
post_sync_barrier(ctx->shared_memory, BeamformerSharedMemoryLockKind_DispatchCompute);
u32 dirty_programs = atomic_swap_u32(&cp->dirty_programs, 0);
- static_assert(IsPowerOfTwo(BeamformerMaxComputeShaderStages), "");
- assert((dirty_programs & ~((u32)BeamformerMaxComputeShaderStages - 1)) == 0);
+ static_assert(BeamformerMaxComputeShaderStages <= 32, "");
if unlikely(dirty_programs) {
for EachBit(dirty_programs, slot) {
+ assert(slot < BeamformerMaxComputeShaderStages);
beamformer_reload_compute_pipeline(cp->vulkan_pipelines + slot,
cp->pipeline.shaders[slot],
cp->shader_descriptors + slot, *arena);