freedreno: Fix rast state for multisample clear
a6xx in particular cares about the multisample bit. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6649>
This commit is contained in:
@@ -194,7 +194,8 @@ fd_blitter_clear(struct pipe_context *pctx, unsigned buffers,
|
|||||||
};
|
};
|
||||||
pctx->set_constant_buffer(pctx, PIPE_SHADER_FRAGMENT, 0, &cb);
|
pctx->set_constant_buffer(pctx, PIPE_SHADER_FRAGMENT, 0, &cb);
|
||||||
|
|
||||||
if (!ctx->clear_rs_state) {
|
unsigned rs_idx = pfb->samples > 1 ? 1 : 0;
|
||||||
|
if (!ctx->clear_rs_state[rs_idx]) {
|
||||||
const struct pipe_rasterizer_state tmpl = {
|
const struct pipe_rasterizer_state tmpl = {
|
||||||
.cull_face = PIPE_FACE_NONE,
|
.cull_face = PIPE_FACE_NONE,
|
||||||
.half_pixel_center = 1,
|
.half_pixel_center = 1,
|
||||||
@@ -202,10 +203,11 @@ fd_blitter_clear(struct pipe_context *pctx, unsigned buffers,
|
|||||||
.flatshade = 1,
|
.flatshade = 1,
|
||||||
.depth_clip_near = 1,
|
.depth_clip_near = 1,
|
||||||
.depth_clip_far = 1,
|
.depth_clip_far = 1,
|
||||||
|
.multisample = pfb->samples > 1,
|
||||||
};
|
};
|
||||||
ctx->clear_rs_state = pctx->create_rasterizer_state(pctx, &tmpl);
|
ctx->clear_rs_state[rs_idx] = pctx->create_rasterizer_state(pctx, &tmpl);
|
||||||
}
|
}
|
||||||
pctx->bind_rasterizer_state(pctx, ctx->clear_rs_state);
|
pctx->bind_rasterizer_state(pctx, ctx->clear_rs_state[rs_idx]);
|
||||||
|
|
||||||
struct pipe_viewport_state vp = {
|
struct pipe_viewport_state vp = {
|
||||||
.scale = { 0.5f * pfb->width, -0.5f * pfb->height, depth },
|
.scale = { 0.5f * pfb->width, -0.5f * pfb->height, depth },
|
||||||
|
@@ -235,8 +235,9 @@ fd_context_destroy(struct pipe_context *pctx)
|
|||||||
if (pctx->stream_uploader)
|
if (pctx->stream_uploader)
|
||||||
u_upload_destroy(pctx->stream_uploader);
|
u_upload_destroy(pctx->stream_uploader);
|
||||||
|
|
||||||
if (ctx->clear_rs_state)
|
for (i = 0; i < ARRAY_SIZE(ctx->clear_rs_state); i++)
|
||||||
pctx->delete_rasterizer_state(pctx, ctx->clear_rs_state);
|
if (ctx->clear_rs_state[i])
|
||||||
|
pctx->delete_rasterizer_state(pctx, ctx->clear_rs_state[i]);
|
||||||
|
|
||||||
if (ctx->primconvert)
|
if (ctx->primconvert)
|
||||||
util_primconvert_destroy(ctx->primconvert);
|
util_primconvert_destroy(ctx->primconvert);
|
||||||
|
@@ -185,7 +185,7 @@ struct fd_context {
|
|||||||
struct fd_pipe *pipe;
|
struct fd_pipe *pipe;
|
||||||
|
|
||||||
struct blitter_context *blitter;
|
struct blitter_context *blitter;
|
||||||
void *clear_rs_state;
|
void *clear_rs_state[2];
|
||||||
struct primconvert_context *primconvert;
|
struct primconvert_context *primconvert;
|
||||||
|
|
||||||
/* slab for pipe_transfer allocations: */
|
/* slab for pipe_transfer allocations: */
|
||||||
|
Reference in New Issue
Block a user