mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-03 04:20:26 +01:00
d3d12: transition the right planes
We need to start transitioning at plane 1 for stencil-only resources, otherwise we end up transitioning the depth-plane instead. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3837 Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7672>
This commit is contained in:
parent
968e360e47
commit
17ebce2f13
4 changed files with 21 additions and 4 deletions
|
|
@ -419,11 +419,13 @@ d3d12_direct_copy(struct d3d12_context *ctx,
|
|||
src_subres, dst_subres);
|
||||
|
||||
|
||||
d3d12_transition_subresources_state(ctx, src, src_subres, 1, 0, 1, 0,
|
||||
d3d12_transition_subresources_state(ctx, src, src_subres, 1, 0, 1,
|
||||
d3d12_get_format_start_plane(src->base.format),
|
||||
d3d12_get_format_num_planes(src->base.format),
|
||||
D3D12_RESOURCE_STATE_COPY_SOURCE);
|
||||
|
||||
d3d12_transition_subresources_state(ctx, dst, dst_subres, 1, 0, 1, 0,
|
||||
d3d12_transition_subresources_state(ctx, dst, dst_subres, 1, 0, 1,
|
||||
d3d12_get_format_start_plane(dst->base.format),
|
||||
d3d12_get_format_num_planes(dst->base.format),
|
||||
D3D12_RESOURCE_STATE_COPY_DEST);
|
||||
|
||||
|
|
|
|||
|
|
@ -114,7 +114,8 @@ fill_srv_descriptors(struct d3d12_context *ctx,
|
|||
d3d12_transition_subresources_state(ctx, d3d12_resource(view->base.texture),
|
||||
view->base.u.tex.first_level, view->mip_levels,
|
||||
view->base.u.tex.first_layer, view->array_size,
|
||||
0, d3d12_get_format_num_planes(view->base.format),
|
||||
d3d12_get_format_start_plane(view->base.format),
|
||||
d3d12_get_format_num_planes(view->base.format),
|
||||
state);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -384,7 +385,8 @@ transition_surface_subresources_state(struct d3d12_context *ctx,
|
|||
d3d12_transition_subresources_state(ctx, res,
|
||||
psurf->u.tex.level, 1,
|
||||
start_layer, num_layers,
|
||||
0, d3d12_get_format_num_planes(psurf->format),
|
||||
d3d12_get_format_start_plane(psurf->format),
|
||||
d3d12_get_format_num_planes(psurf->format),
|
||||
state);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -290,6 +290,16 @@ d3d12_non_opaque_plane_count(DXGI_FORMAT format)
|
|||
return 1;
|
||||
}
|
||||
|
||||
unsigned
|
||||
d3d12_get_format_start_plane(enum pipe_format fmt)
|
||||
{
|
||||
const struct util_format_description *desc = util_format_description(fmt);
|
||||
if (util_format_has_stencil(desc) && !util_format_has_depth(desc))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned
|
||||
d3d12_get_format_num_planes(enum pipe_format fmt)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -56,6 +56,9 @@ d3d12_get_format_info(enum pipe_format format, enum pipe_texture_target);
|
|||
enum pipe_format
|
||||
d3d12_emulated_vtx_format(enum pipe_format fmt);
|
||||
|
||||
unsigned
|
||||
d3d12_get_format_start_plane(enum pipe_format fmt);
|
||||
|
||||
unsigned
|
||||
d3d12_get_format_num_planes(enum pipe_format fmt);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue