util/blitter: iterate samples in stencil_fallback
this matches handling in do_blits and fixes multisampled stencil blits fixes (nv): GTF-GL45.gtf44.GL31Tests.texture_stencil8.texture_stencil8_gl44 cc: mesa-stable Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27988>
This commit is contained in:
committed by
Marge Bot
parent
981900055c
commit
2665badcfe
@@ -2953,33 +2953,36 @@ util_blitter_stencil_fallback(struct blitter_context *blitter,
|
||||
struct pipe_stencil_ref sr = { { (1u << stencil_bits) - 1 } };
|
||||
pipe->set_stencil_ref(pipe, sr);
|
||||
|
||||
union blitter_attrib coord;
|
||||
get_texcoords(src_view, src->width0, src->height0,
|
||||
srcbox->x, srcbox->y,
|
||||
srcbox->x + srcbox->width, srcbox->y + srcbox->height,
|
||||
srcbox->z, 0, true,
|
||||
&coord);
|
||||
for (unsigned i = 0; i <= util_res_sample_count(dst) - 1; i++) {
|
||||
pipe->set_sample_mask(pipe, 1 << i);
|
||||
union blitter_attrib coord;
|
||||
get_texcoords(src_view, src->width0, src->height0,
|
||||
srcbox->x, srcbox->y,
|
||||
srcbox->x + srcbox->width, srcbox->y + srcbox->height,
|
||||
srcbox->z, i, true,
|
||||
&coord);
|
||||
|
||||
for (int i = 0; i < stencil_bits; ++i) {
|
||||
uint32_t mask = 1 << i;
|
||||
struct pipe_constant_buffer cb = {
|
||||
.user_buffer = &mask,
|
||||
.buffer_size = sizeof(mask),
|
||||
};
|
||||
pipe->set_constant_buffer(pipe, PIPE_SHADER_FRAGMENT, blitter->cb_slot,
|
||||
false, &cb);
|
||||
for (int i = 0; i < stencil_bits; ++i) {
|
||||
uint32_t mask = 1 << i;
|
||||
struct pipe_constant_buffer cb = {
|
||||
.user_buffer = &mask,
|
||||
.buffer_size = sizeof(mask),
|
||||
};
|
||||
pipe->set_constant_buffer(pipe, PIPE_SHADER_FRAGMENT, blitter->cb_slot,
|
||||
false, &cb);
|
||||
|
||||
pipe->bind_depth_stencil_alpha_state(pipe,
|
||||
get_stencil_blit_fallback_dsa(ctx, i));
|
||||
pipe->bind_depth_stencil_alpha_state(pipe,
|
||||
get_stencil_blit_fallback_dsa(ctx, i));
|
||||
|
||||
blitter->draw_rectangle(blitter, ctx->velem_state,
|
||||
get_vs_passthrough_pos_generic,
|
||||
dstbox->x, dstbox->y,
|
||||
dstbox->x + dstbox->width,
|
||||
dstbox->y + dstbox->height,
|
||||
0, 1,
|
||||
UTIL_BLITTER_ATTRIB_TEXCOORD_XYZW,
|
||||
&coord);
|
||||
blitter->draw_rectangle(blitter, ctx->velem_state,
|
||||
get_vs_passthrough_pos_generic,
|
||||
dstbox->x, dstbox->y,
|
||||
dstbox->x + dstbox->width,
|
||||
dstbox->y + dstbox->height,
|
||||
0, 1,
|
||||
UTIL_BLITTER_ATTRIB_TEXCOORD_XYZW,
|
||||
&coord);
|
||||
}
|
||||
}
|
||||
|
||||
if (scissor)
|
||||
|
||||
Reference in New Issue
Block a user