mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 05:38:49 +00:00
Avoid clearing HTILE when shader contains address calculation (#3252)
* resource_tracking: Mark image as written when its used with atomics * texture_cache: Remove meta registered flag Mostly useless and it is possible for images to switch metas * vk_rasterizer: Use xor as heuristic for HTILE clear
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <limits>
|
||||
#include "common/bit_field.h"
|
||||
#include "shader_recompiler/frontend/opcodes.h"
|
||||
|
||||
namespace Shader::Gcn {
|
||||
|
||||
@@ -222,6 +222,7 @@ struct Info {
|
||||
VAddr pgm_base;
|
||||
bool has_storage_images{};
|
||||
bool has_discard{};
|
||||
bool has_bitwise_xor{};
|
||||
bool has_image_gather{};
|
||||
bool has_image_query{};
|
||||
bool uses_buffer_atomic_float_min_max{};
|
||||
|
||||
@@ -455,11 +455,12 @@ void PatchImageSharp(IR::Block& block, IR::Inst& inst, Info& info, Descriptors&
|
||||
// Read image sharp.
|
||||
const auto tsharp = TrackSharp(tsharp_handle, info);
|
||||
const auto inst_info = inst.Flags<IR::TextureInstInfo>();
|
||||
const bool is_written = inst.GetOpcode() == IR::Opcode::ImageWrite;
|
||||
const bool is_atomic = IsImageAtomicInstruction(inst);
|
||||
const bool is_written = inst.GetOpcode() == IR::Opcode::ImageWrite || is_atomic;
|
||||
const ImageResource image_res = {
|
||||
.sharp_idx = tsharp,
|
||||
.is_depth = bool(inst_info.is_depth),
|
||||
.is_atomic = IsImageAtomicInstruction(inst),
|
||||
.is_atomic = is_atomic,
|
||||
.is_array = bool(inst_info.is_array),
|
||||
.is_written = is_written,
|
||||
.is_r128 = bool(inst_info.is_r128),
|
||||
|
||||
@@ -95,6 +95,9 @@ void Visit(Info& info, const IR::Inst& inst) {
|
||||
case IR::Opcode::DiscardCond:
|
||||
info.has_discard = true;
|
||||
break;
|
||||
case IR::Opcode::BitwiseXor32:
|
||||
info.has_bitwise_xor = true;
|
||||
break;
|
||||
case IR::Opcode::ImageGather:
|
||||
case IR::Opcode::ImageGatherDref:
|
||||
info.has_image_gather = true;
|
||||
|
||||
Reference in New Issue
Block a user