diff options
author | Kenneth Graunke <[email protected]> | 2015-12-29 15:50:15 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2015-12-29 15:51:14 -0800 |
commit | ccd84848f0ff71ccc4a257ee2628f5ebc94be3b5 (patch) | |
tree | 422ec253e229855302ff7a7fda6cf179edbe35e4 /src | |
parent | 2a58cb03d04b8cff632e6be70f1bef0ec12d9f0b (diff) |
anv/state: Fix reversed MIN vs. MAX in levelCount handling.
The point is to promote a levelCount of 0 to 1 before subtracting 1.
This needs MAX, not MIN.
Diffstat (limited to 'src')
-rw-r--r-- | src/vulkan/gen7_state.c | 4 | ||||
-rw-r--r-- | src/vulkan/gen8_state.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/vulkan/gen7_state.c b/src/vulkan/gen7_state.c index cb299a3278b..88a508a1be9 100644 --- a/src/vulkan/gen7_state.c +++ b/src/vulkan/gen7_state.c @@ -329,7 +329,7 @@ genX(image_view_init)(struct anv_image_view *iview, * sampler engine is [SurfaceMinLOD, SurfaceMinLOD + MIPCountLOD]. */ surface_state.SurfaceMinLOD = range->baseMipLevel; - surface_state.MIPCountLOD = MIN2(range->levelCount, 1) - 1; + surface_state.MIPCountLOD = MAX2(range->levelCount, 1) - 1; GENX(RENDER_SURFACE_STATE_pack)(NULL, iview->nonrt_surface_state.map, &surface_state); @@ -369,7 +369,7 @@ genX(image_view_init)(struct anv_image_view *iview, format->surface_format); surface_state.SurfaceMinLOD = range->baseMipLevel; - surface_state.MIPCountLOD = MIN2(range->levelCount, 1) - 1; + surface_state.MIPCountLOD = MAX2(range->levelCount, 1) - 1; GENX(RENDER_SURFACE_STATE_pack)(NULL, iview->storage_surface_state.map, &surface_state); diff --git a/src/vulkan/gen8_state.c b/src/vulkan/gen8_state.c index 199905b60dc..34c4d26b20f 100644 --- a/src/vulkan/gen8_state.c +++ b/src/vulkan/gen8_state.c @@ -305,7 +305,7 @@ genX(image_view_init)(struct anv_image_view *iview, * sampler engine is [SurfaceMinLOD, SurfaceMinLOD + MIPCountLOD]. */ surface_state.SurfaceMinLOD = range->baseMipLevel; - surface_state.MIPCountLOD = MIN2(range->levelCount, 1) - 1; + surface_state.MIPCountLOD = MAX2(range->levelCount, 1) - 1; GENX(RENDER_SURFACE_STATE_pack)(NULL, iview->nonrt_surface_state.map, &surface_state); @@ -344,7 +344,7 @@ genX(image_view_init)(struct anv_image_view *iview, format_info->surface_format); surface_state.SurfaceMinLOD = range->baseMipLevel; - surface_state.MIPCountLOD = MIN2(range->levelCount, 1) - 1; + surface_state.MIPCountLOD = MAX2(range->levelCount, 1) - 1; GENX(RENDER_SURFACE_STATE_pack)(NULL, iview->storage_surface_state.map, &surface_state); |