mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-19 06:18:24 +02:00
anv: use the correct MOCS for depth destinations
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: mesa-stable Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31778>
This commit is contained in:
parent
45ada1c7fb
commit
08e82b28e8
1 changed files with 16 additions and 4 deletions
|
|
@ -170,14 +170,23 @@ anv_blorp_batch_finish(struct blorp_batch *batch)
|
||||||
|
|
||||||
static isl_surf_usage_flags_t
|
static isl_surf_usage_flags_t
|
||||||
get_usage_flag_for_cmd_buffer(const struct anv_cmd_buffer *cmd_buffer,
|
get_usage_flag_for_cmd_buffer(const struct anv_cmd_buffer *cmd_buffer,
|
||||||
bool is_dest, bool protected)
|
bool is_dest, bool is_depth, bool protected)
|
||||||
{
|
{
|
||||||
isl_surf_usage_flags_t usage;
|
isl_surf_usage_flags_t usage;
|
||||||
|
|
||||||
switch (cmd_buffer->queue_family->engine_class) {
|
switch (cmd_buffer->queue_family->engine_class) {
|
||||||
case INTEL_ENGINE_CLASS_RENDER:
|
case INTEL_ENGINE_CLASS_RENDER:
|
||||||
usage = is_dest ? ISL_SURF_USAGE_RENDER_TARGET_BIT :
|
if (is_dest) {
|
||||||
ISL_SURF_USAGE_TEXTURE_BIT;
|
/* Make the blorp operation match the MOCS used in
|
||||||
|
* cmd_buffer_emit_depth_stencil()
|
||||||
|
*/
|
||||||
|
if (is_depth)
|
||||||
|
usage = ISL_SURF_USAGE_DEPTH_BIT;
|
||||||
|
else
|
||||||
|
usage = ISL_SURF_USAGE_RENDER_TARGET_BIT;
|
||||||
|
} else {
|
||||||
|
usage = ISL_SURF_USAGE_TEXTURE_BIT;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case INTEL_ENGINE_CLASS_COMPUTE:
|
case INTEL_ENGINE_CLASS_COMPUTE:
|
||||||
usage = is_dest ? ISL_SURF_USAGE_STORAGE_BIT :
|
usage = is_dest ? ISL_SURF_USAGE_STORAGE_BIT :
|
||||||
|
|
@ -208,7 +217,7 @@ get_blorp_surf_for_anv_address(struct anv_cmd_buffer *cmd_buffer,
|
||||||
{
|
{
|
||||||
bool ok UNUSED;
|
bool ok UNUSED;
|
||||||
isl_surf_usage_flags_t usage =
|
isl_surf_usage_flags_t usage =
|
||||||
get_usage_flag_for_cmd_buffer(cmd_buffer, is_dest, protected);
|
get_usage_flag_for_cmd_buffer(cmd_buffer, is_dest, false, protected);
|
||||||
|
|
||||||
*blorp_surf = (struct blorp_surf) {
|
*blorp_surf = (struct blorp_surf) {
|
||||||
.surf = isl_surf,
|
.surf = isl_surf,
|
||||||
|
|
@ -287,6 +296,7 @@ get_blorp_surf_for_anv_image(const struct anv_cmd_buffer *cmd_buffer,
|
||||||
const bool is_dest = usage & VK_IMAGE_USAGE_TRANSFER_DST_BIT;
|
const bool is_dest = usage & VK_IMAGE_USAGE_TRANSFER_DST_BIT;
|
||||||
isl_surf_usage_flags_t isl_usage =
|
isl_surf_usage_flags_t isl_usage =
|
||||||
get_usage_flag_for_cmd_buffer(cmd_buffer, is_dest,
|
get_usage_flag_for_cmd_buffer(cmd_buffer, is_dest,
|
||||||
|
aspect & VK_IMAGE_ASPECT_DEPTH_BIT,
|
||||||
anv_image_is_protected(image));
|
anv_image_is_protected(image));
|
||||||
const struct anv_surface *surface = &image->planes[plane].primary_surface;
|
const struct anv_surface *surface = &image->planes[plane].primary_surface;
|
||||||
const struct anv_address address =
|
const struct anv_address address =
|
||||||
|
|
@ -1175,6 +1185,7 @@ anv_cmd_buffer_update_addr(
|
||||||
.mocs = anv_mocs(cmd_buffer->device, NULL,
|
.mocs = anv_mocs(cmd_buffer->device, NULL,
|
||||||
get_usage_flag_for_cmd_buffer(cmd_buffer,
|
get_usage_flag_for_cmd_buffer(cmd_buffer,
|
||||||
false /* is_dest */,
|
false /* is_dest */,
|
||||||
|
false /* is_depth */,
|
||||||
false /* protected */)),
|
false /* protected */)),
|
||||||
};
|
};
|
||||||
struct blorp_address dst = {
|
struct blorp_address dst = {
|
||||||
|
|
@ -1184,6 +1195,7 @@ anv_cmd_buffer_update_addr(
|
||||||
get_usage_flag_for_cmd_buffer(
|
get_usage_flag_for_cmd_buffer(
|
||||||
cmd_buffer,
|
cmd_buffer,
|
||||||
true /* is_dest */,
|
true /* is_dest */,
|
||||||
|
false /* is_depth */,
|
||||||
is_protected)),
|
is_protected)),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue