summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorKevin Rogovin <[email protected]>2017-09-25 13:34:05 +0300
committerKenneth Graunke <[email protected]>2017-10-29 22:41:23 -0700
commitd30b5f2f9bea19149f84eb4db23ca3afcadcc0bf (patch)
treedfebbcab9994e6bac2d5c74725ee9b8bcfd13217 /src/mesa/drivers
parent992e2cf57f5a1eaab13ea6a3b5904b8248af8c83 (diff)
i965: correctly assign SamplerCount of INTERFACE_DESCRIPTOR_DATA
We were dividing by 4 twice. This also papered over a bug where we were neglecting to clamp the sampler count to the [0, 16] range. This should have no functional impact, it only affects prefetching. v2 [Kenneth Graunke]: - Clamp sampler_count to [0, 16] to avoid overflowing the valid values for this field. Write a commit message. Signed-off-by: Kevin Rogovin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/genX_state_upload.c2
1 files changed, 1 insertions, 1 deletions
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,