diff options
author | Marek Olšák <[email protected]> | 2018-10-18 17:54:24 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-10-18 17:55:44 -0400 |
commit | 2a26b1c0451c9eca16febf76a0881737325fda69 (patch) | |
tree | a565f99d3b62b8e885e1bc4aa5fa4c824148a0f3 /src/gallium | |
parent | 8c0b9fdfa1db596dfce101b9bf5373623a076031 (diff) |
radeonsi: fix gnome-shell crash
I wasn't expecting to get viewports with the center having
negative coordinates.
Broken by: 6cc79e4411f
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state_viewport.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_viewport.c b/src/gallium/drivers/radeonsi/si_state_viewport.c index b7fcd5bdb82..808eb366bde 100644 --- a/src/gallium/drivers/radeonsi/si_state_viewport.c +++ b/src/gallium/drivers/radeonsi/si_state_viewport.c @@ -184,8 +184,8 @@ static void si_emit_guardband(struct si_context *ctx) const unsigned hw_screen_offset_alignment = ctx->chip_class >= VI ? 16 : MAX2(ctx->screen->se_tile_repeat, 16); - hw_screen_offset_x = MIN2(hw_screen_offset_x, hw_screen_offset_max); - hw_screen_offset_y = MIN2(hw_screen_offset_y, hw_screen_offset_max); + hw_screen_offset_x = CLAMP(hw_screen_offset_x, 0, hw_screen_offset_max); + hw_screen_offset_y = CLAMP(hw_screen_offset_y, 0, hw_screen_offset_max); /* Align the screen offset by dropping the low 4 bits. */ hw_screen_offset_x &= ~(hw_screen_offset_alignment - 1); |