diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c b/src/mesa/drivers/dri/i965/genX_state_upload.c index 4ccfd489191..98f69522de5 100644 --- a/src/mesa/drivers/dri/i965/genX_state_upload.c +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c @@ -4237,7 +4237,7 @@ genX(upload_cs_state)(struct brw_context *brw) const struct GENX(INTERFACE_DESCRIPTOR_DATA) idd = { .KernelStartPointer = brw->cs.base.prog_offset, .SamplerStatePointer = stage_state->sampler_offset, - .SamplerCount = DIV_ROUND_UP(stage_state->sampler_count, 4) >> 2, + .SamplerCount = DIV_ROUND_UP(CLAMP(stage_state->sampler_count, 0, 16), 4), .BindingTablePointer = stage_state->bind_bo_offset, .ConstantURBEntryReadLength = cs_prog_data->push.per_thread.regs, .NumberofThreadsinGPGPUThreadGroup = cs_prog_data->threads,