mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 10:00:14 +01:00
swr: Fix type to match parameters of std::max()
Include propagation of comparisons further down. Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
This commit is contained in:
parent
f1ca377ab1
commit
2085088033
1 changed files with 7 additions and 7 deletions
|
|
@ -35,7 +35,7 @@ swr_clear(struct pipe_context *pipe,
|
|||
struct pipe_framebuffer_state *fb = &ctx->framebuffer;
|
||||
|
||||
UINT clearMask = 0;
|
||||
int layers = 0;
|
||||
unsigned layers = 0;
|
||||
|
||||
if (!swr_check_render_cond(pipe))
|
||||
return;
|
||||
|
|
@ -47,20 +47,20 @@ swr_clear(struct pipe_context *pipe,
|
|||
if (fb->cbufs[i] && (buffers & (PIPE_CLEAR_COLOR0 << i))) {
|
||||
clearMask |= (SWR_ATTACHMENT_COLOR0_BIT << i);
|
||||
layers = std::max(layers, fb->cbufs[i]->u.tex.last_layer -
|
||||
fb->cbufs[i]->u.tex.first_layer + 1);
|
||||
fb->cbufs[i]->u.tex.first_layer + 1u);
|
||||
}
|
||||
}
|
||||
|
||||
if (buffers & PIPE_CLEAR_DEPTH && fb->zsbuf) {
|
||||
clearMask |= SWR_ATTACHMENT_DEPTH_BIT;
|
||||
layers = std::max(layers, fb->zsbuf->u.tex.last_layer -
|
||||
fb->zsbuf->u.tex.first_layer + 1);
|
||||
fb->zsbuf->u.tex.first_layer + 1u);
|
||||
}
|
||||
|
||||
if (buffers & PIPE_CLEAR_STENCIL && fb->zsbuf) {
|
||||
clearMask |= SWR_ATTACHMENT_STENCIL_BIT;
|
||||
layers = std::max(layers, fb->zsbuf->u.tex.last_layer -
|
||||
fb->zsbuf->u.tex.first_layer + 1);
|
||||
fb->zsbuf->u.tex.first_layer + 1u);
|
||||
}
|
||||
|
||||
#if 0 // XXX HACK, override clear color alpha. On ubuntu, clears are
|
||||
|
|
@ -68,7 +68,7 @@ swr_clear(struct pipe_context *pipe,
|
|||
((union pipe_color_union *)color)->f[3] = 1.0; /* cast off your const'd-ness */
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < layers; ++i) {
|
||||
for (unsigned i = 0; i < layers; ++i) {
|
||||
swr_update_draw_context(ctx);
|
||||
SwrClearRenderTarget(ctx->swrContext, clearMask, i,
|
||||
color->f, depth, stencil,
|
||||
|
|
@ -76,11 +76,11 @@ swr_clear(struct pipe_context *pipe,
|
|||
|
||||
// Mask out the attachments that are out of layers.
|
||||
if (fb->zsbuf &&
|
||||
fb->zsbuf->u.tex.last_layer - fb->zsbuf->u.tex.first_layer <= i)
|
||||
(fb->zsbuf->u.tex.last_layer <= fb->zsbuf->u.tex.first_layer + i))
|
||||
clearMask &= ~(SWR_ATTACHMENT_DEPTH_BIT | SWR_ATTACHMENT_STENCIL_BIT);
|
||||
for (unsigned c = 0; c < fb->nr_cbufs; ++c) {
|
||||
const struct pipe_surface *sf = fb->cbufs[c];
|
||||
if (sf && sf->u.tex.last_layer - sf->u.tex.first_layer <= i)
|
||||
if (sf && (sf->u.tex.last_layer <= sf->u.tex.first_layer + i))
|
||||
clearMask &= ~(SWR_ATTACHMENT_COLOR0_BIT << c);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue