mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
nvk: Fix scissor bounds
This code is old, copied from the old nouveau GL driver. As of Pascal,
we have have 32k images so we need 32k scissors as well. Use the
max_image_dimension() helper instead of hard-coding it.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33478>
(cherry picked from commit 6f64962f27)
This commit is contained in:
parent
6285eefd88
commit
6d3863b41b
2 changed files with 10 additions and 6 deletions
|
|
@ -354,7 +354,7 @@
|
|||
"description": "nvk: Fix scissor bounds",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1781,7 +1781,8 @@ nvk_flush_ts_state(struct nvk_cmd_buffer *cmd)
|
|||
static void
|
||||
nvk_flush_vp_state(struct nvk_cmd_buffer *cmd)
|
||||
{
|
||||
const struct nvk_device *dev = nvk_cmd_buffer_device(cmd);
|
||||
struct nvk_device *dev = nvk_cmd_buffer_device(cmd);
|
||||
struct nvk_physical_device *pdev = nvk_device_physical(dev);
|
||||
|
||||
const struct vk_dynamic_graphics_state *dyn =
|
||||
&cmd->vk.dynamic_graphics_state;
|
||||
|
|
@ -1890,13 +1891,16 @@ nvk_flush_vp_state(struct nvk_cmd_buffer *cmd)
|
|||
}
|
||||
|
||||
if (BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_VP_SCISSORS)) {
|
||||
const uint32_t sr_max =
|
||||
nvk_image_max_dimension(&pdev->info, VK_IMAGE_TYPE_2D);
|
||||
|
||||
for (unsigned i = 0; i < dyn->vp.scissor_count; i++) {
|
||||
const VkRect2D *s = &dyn->vp.scissors[i];
|
||||
|
||||
const uint32_t xmin = MIN2(16384, s->offset.x);
|
||||
const uint32_t xmax = MIN2(16384, s->offset.x + s->extent.width);
|
||||
const uint32_t ymin = MIN2(16384, s->offset.y);
|
||||
const uint32_t ymax = MIN2(16384, s->offset.y + s->extent.height);
|
||||
const uint32_t xmin = MIN2(sr_max, s->offset.x);
|
||||
const uint32_t xmax = MIN2(sr_max, s->offset.x + s->extent.width);
|
||||
const uint32_t ymin = MIN2(sr_max, s->offset.y);
|
||||
const uint32_t ymax = MIN2(sr_max, s->offset.y + s->extent.height);
|
||||
|
||||
P_MTHD(p, NV9097, SET_SCISSOR_ENABLE(i));
|
||||
P_NV9097_SET_SCISSOR_ENABLE(p, i, V_TRUE);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue