mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 22:20:14 +01:00
gallium/util: allow scaling blits for stencil-fallback
We also need to be able to scale the stencil-blits, so let's pass the full destination box instead of just the position. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6898>
This commit is contained in:
parent
69654f0918
commit
b4c07a8a87
2 changed files with 11 additions and 10 deletions
|
|
@ -2818,7 +2818,7 @@ void
|
||||||
util_blitter_stencil_fallback(struct blitter_context *blitter,
|
util_blitter_stencil_fallback(struct blitter_context *blitter,
|
||||||
struct pipe_resource *dst,
|
struct pipe_resource *dst,
|
||||||
unsigned dst_level,
|
unsigned dst_level,
|
||||||
unsigned dstx, unsigned dsty, unsigned dstz,
|
const struct pipe_box *dstbox,
|
||||||
struct pipe_resource *src,
|
struct pipe_resource *src,
|
||||||
unsigned src_level,
|
unsigned src_level,
|
||||||
const struct pipe_box *srcbox)
|
const struct pipe_box *srcbox)
|
||||||
|
|
@ -2835,7 +2835,7 @@ util_blitter_stencil_fallback(struct blitter_context *blitter,
|
||||||
|
|
||||||
/* Initialize the surface. */
|
/* Initialize the surface. */
|
||||||
struct pipe_surface *dst_view, dst_templ;
|
struct pipe_surface *dst_view, dst_templ;
|
||||||
util_blitter_default_dst_texture(&dst_templ, dst, dst_level, dstz);
|
util_blitter_default_dst_texture(&dst_templ, dst, dst_level, dstbox->z);
|
||||||
dst_view = pipe->create_surface(pipe, dst, &dst_templ);
|
dst_view = pipe->create_surface(pipe, dst, &dst_templ);
|
||||||
|
|
||||||
/* Initialize the sampler view. */
|
/* Initialize the sampler view. */
|
||||||
|
|
@ -2851,8 +2851,8 @@ util_blitter_stencil_fallback(struct blitter_context *blitter,
|
||||||
|
|
||||||
/* set a framebuffer state */
|
/* set a framebuffer state */
|
||||||
struct pipe_framebuffer_state fb_state = { 0 };
|
struct pipe_framebuffer_state fb_state = { 0 };
|
||||||
fb_state.width = srcbox->width;
|
fb_state.width = dstbox->width;
|
||||||
fb_state.height = srcbox->height;
|
fb_state.height = dstbox->height;
|
||||||
fb_state.zsbuf = dst_view;
|
fb_state.zsbuf = dst_view;
|
||||||
pipe->set_framebuffer_state(pipe, &fb_state);
|
pipe->set_framebuffer_state(pipe, &fb_state);
|
||||||
pipe->set_sample_mask(pipe, ~0);
|
pipe->set_sample_mask(pipe, ~0);
|
||||||
|
|
@ -2862,7 +2862,7 @@ util_blitter_stencil_fallback(struct blitter_context *blitter,
|
||||||
blitter_set_dst_dimensions(ctx, dst_view->width, dst_view->height);
|
blitter_set_dst_dimensions(ctx, dst_view->width, dst_view->height);
|
||||||
|
|
||||||
pipe->clear_depth_stencil(pipe, dst_view, PIPE_CLEAR_STENCIL, 0.0, 0,
|
pipe->clear_depth_stencil(pipe, dst_view, PIPE_CLEAR_STENCIL, 0.0, 0,
|
||||||
dstx, dsty, srcbox->width, srcbox->height,
|
dstbox->x, dstbox->y, dstbox->width, dstbox->height,
|
||||||
true);
|
true);
|
||||||
|
|
||||||
pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, &src_view);
|
pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, &src_view);
|
||||||
|
|
@ -2894,9 +2894,11 @@ util_blitter_stencil_fallback(struct blitter_context *blitter,
|
||||||
pipe->bind_depth_stencil_alpha_state(pipe,
|
pipe->bind_depth_stencil_alpha_state(pipe,
|
||||||
get_stencil_blit_fallback_dsa(ctx, i));
|
get_stencil_blit_fallback_dsa(ctx, i));
|
||||||
|
|
||||||
blitter->draw_rectangle(blitter, ctx->velem_state, get_vs_passthrough_pos,
|
blitter->draw_rectangle(blitter, ctx->velem_state,
|
||||||
dstx, dsty,
|
get_vs_passthrough_pos_generic,
|
||||||
dstx + srcbox->width, dsty + srcbox->height,
|
dstbox->x, dstbox->y,
|
||||||
|
dstbox->x + dstbox->width,
|
||||||
|
dstbox->y + dstbox->height,
|
||||||
0, stencil_bits,
|
0, stencil_bits,
|
||||||
UTIL_BLITTER_ATTRIB_TEXCOORD_XYZW,
|
UTIL_BLITTER_ATTRIB_TEXCOORD_XYZW,
|
||||||
&coord);
|
&coord);
|
||||||
|
|
|
||||||
|
|
@ -404,8 +404,7 @@ void util_blitter_custom_shader(struct blitter_context *blitter,
|
||||||
void util_blitter_stencil_fallback(struct blitter_context *blitter,
|
void util_blitter_stencil_fallback(struct blitter_context *blitter,
|
||||||
struct pipe_resource *dst,
|
struct pipe_resource *dst,
|
||||||
unsigned dst_level,
|
unsigned dst_level,
|
||||||
unsigned dstx, unsigned dsty,
|
const struct pipe_box *dstbox,
|
||||||
unsigned dstz,
|
|
||||||
struct pipe_resource *src,
|
struct pipe_resource *src,
|
||||||
unsigned src_level,
|
unsigned src_level,
|
||||||
const struct pipe_box *srcbox);
|
const struct pipe_box *srcbox);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue