mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
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.
This commit is contained in:
parent
2a58cb03d0
commit
ccd84848f0
2 changed files with 4 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue