mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-03 16:02:26 +00:00
texture_cache: Fix depth pitch
This commit is contained in:
parent
e2b63bf4c8
commit
36a515f4ee
@ -536,7 +536,7 @@ void BufferCache::SynchronizeBuffer(Buffer& buffer, VAddr device_addr, u32 size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool BufferCache::SynchronizeBufferFromImage(Buffer& buffer, VAddr device_addr, u32 size) {
|
bool BufferCache::SynchronizeBufferFromImage(Buffer& buffer, VAddr device_addr, u32 size) {
|
||||||
constexpr FindFlags flags = FindFlags::NoCreate | FindFlags::ExactSize | FindFlags::RelaxDim;
|
constexpr FindFlags flags = FindFlags::NoCreate | FindFlags::FullOverlap | FindFlags::RelaxDim;
|
||||||
ImageInfo info{};
|
ImageInfo info{};
|
||||||
info.guest_address = device_addr;
|
info.guest_address = device_addr;
|
||||||
info.guest_size_bytes = size;
|
info.guest_size_bytes = size;
|
||||||
|
@ -297,6 +297,7 @@ bool Instance::CreateDevice() {
|
|||||||
.shaderFloat16 = vk12_features.shaderFloat16,
|
.shaderFloat16 = vk12_features.shaderFloat16,
|
||||||
.scalarBlockLayout = vk12_features.scalarBlockLayout,
|
.scalarBlockLayout = vk12_features.scalarBlockLayout,
|
||||||
.uniformBufferStandardLayout = vk12_features.uniformBufferStandardLayout,
|
.uniformBufferStandardLayout = vk12_features.uniformBufferStandardLayout,
|
||||||
|
.separateDepthStencilLayouts = vk12_features.separateDepthStencilLayouts,
|
||||||
.hostQueryReset = vk12_features.hostQueryReset,
|
.hostQueryReset = vk12_features.hostQueryReset,
|
||||||
.timelineSemaphore = vk12_features.timelineSemaphore,
|
.timelineSemaphore = vk12_features.timelineSemaphore,
|
||||||
},
|
},
|
||||||
|
@ -179,7 +179,7 @@ const ComputePipeline* PipelineCache::GetComputePipeline() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ShouldSkipShader(u64 shader_hash, const char* shader_type) {
|
bool ShouldSkipShader(u64 shader_hash, const char* shader_type) {
|
||||||
static constexpr std::array<u64, 0> skip_hashes = {};
|
static constexpr std::array<u64, 7> skip_hashes = {0x42f2a521, 0x2da7fe60, 0x8e3f8dc4, 0xa509af23, 0x4ca76892, 0xa954e79d, 0x1635154c};
|
||||||
if (std::ranges::contains(skip_hashes, shader_hash)) {
|
if (std::ranges::contains(skip_hashes, shader_hash)) {
|
||||||
LOG_WARNING(Render_Vulkan, "Skipped {} shader hash {:#x}.", shader_type, shader_hash);
|
LOG_WARNING(Render_Vulkan, "Skipped {} shader hash {:#x}.", shader_type, shader_hash);
|
||||||
return true;
|
return true;
|
||||||
|
@ -42,6 +42,7 @@ static VKAPI_ATTR VkBool32 VKAPI_CALL DebugUtilsCallback(
|
|||||||
switch (static_cast<u32>(callback_data->messageIdNumber)) {
|
switch (static_cast<u32>(callback_data->messageIdNumber)) {
|
||||||
case 0x609a13b: // Vertex attribute at location not consumed by shader
|
case 0x609a13b: // Vertex attribute at location not consumed by shader
|
||||||
case 0xc81ad50e:
|
case 0xc81ad50e:
|
||||||
|
case 0xb7c39078:
|
||||||
case 0x92d66fc1: // `pMultisampleState is NULL` for depth only passes (confirmed VL error)
|
case 0x92d66fc1: // `pMultisampleState is NULL` for depth only passes (confirmed VL error)
|
||||||
return VK_FALSE;
|
return VK_FALSE;
|
||||||
default:
|
default:
|
||||||
|
@ -187,7 +187,7 @@ ImageInfo::ImageInfo(const AmdGpu::Liverpool::DepthBuffer& buffer, u32 num_slice
|
|||||||
size.width = hint.Valid() ? hint.width : buffer.Pitch();
|
size.width = hint.Valid() ? hint.width : buffer.Pitch();
|
||||||
size.height = hint.Valid() ? hint.height : buffer.Height();
|
size.height = hint.Valid() ? hint.height : buffer.Height();
|
||||||
size.depth = 1;
|
size.depth = 1;
|
||||||
pitch = size.width;
|
pitch = buffer.Pitch();
|
||||||
resources.layers = num_slices;
|
resources.layers = num_slices;
|
||||||
meta_info.htile_addr = buffer.z_info.tile_surface_en ? htile_address : 0;
|
meta_info.htile_addr = buffer.z_info.tile_surface_en ? htile_address : 0;
|
||||||
usage.depth_target = true;
|
usage.depth_target = true;
|
||||||
|
@ -38,12 +38,12 @@ TextureCache::TextureCache(const Vulkan::Instance& instance_, Vulkan::Scheduler&
|
|||||||
TextureCache::~TextureCache() = default;
|
TextureCache::~TextureCache() = default;
|
||||||
|
|
||||||
void TextureCache::InvalidateMemory(VAddr address, size_t size) {
|
void TextureCache::InvalidateMemory(VAddr address, size_t size) {
|
||||||
static constexpr size_t MaxInvalidateDist = 512_MB;
|
static constexpr size_t MaxInvalidateDist = 128_MB;
|
||||||
std::unique_lock lock{mutex};
|
std::unique_lock lock{mutex};
|
||||||
ForEachImageInRegion(address, size, [&](ImageId image_id, Image& image) {
|
ForEachImageInRegion(address, size, [&](ImageId image_id, Image& image) {
|
||||||
const size_t image_dist =
|
const size_t image_dist =
|
||||||
image.cpu_addr > address ? image.cpu_addr - address : address - image.cpu_addr;
|
image.cpu_addr > address ? image.cpu_addr - address : address - image.cpu_addr;
|
||||||
if (image_dist < MaxInvalidateDist) {
|
if (image_dist < MaxInvalidateDist && image.info.size.width != 1) {
|
||||||
// Ensure image is reuploaded when accessed again.
|
// Ensure image is reuploaded when accessed again.
|
||||||
image.flags |= ImageFlagBits::CpuModified;
|
image.flags |= ImageFlagBits::CpuModified;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user