Browse Source

[vk] Remove forced stencil format handling in TextureCacheRuntime

eds-true-adreno-fixes
CamilleLaVey 4 weeks ago
committed by Caio Oliveira
parent
commit
0e6a271e40
No known key found for this signature in database GPG Key ID: AAAE6C7FD4186B0C
  1. 16
      src/video_core/renderer_vulkan/vk_texture_cache.cpp
  2. 1
      src/video_core/texture_cache/texture_cache.h

16
src/video_core/renderer_vulkan/vk_texture_cache.cpp

@ -886,15 +886,6 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched
view_formats[index_a].push_back(view_info.format); view_formats[index_a].push_back(view_info.format);
} }
} }
if (VideoCore::Surface::GetFormatType(image_format) ==
VideoCore::Surface::SurfaceType::DepthStencil) {
const auto stencil_info = MaxwellToVK::SurfaceFormat(
device, FormatType::Optimal, true, PixelFormat::S8_UINT);
auto& formats = view_formats[index_a];
if (std::ranges::find(formats, stencil_info.format) == formats.end()) {
formats.push_back(stencil_info.format);
}
}
} }
} }
@ -2212,12 +2203,7 @@ VkImageView ImageView::StencilView() {
if (stencil_view) { if (stencil_view) {
return *stencil_view; return *stencil_view;
} }
PixelFormat view_format = format;
if (VideoCore::Surface::GetFormatType(format) ==
VideoCore::Surface::SurfaceType::DepthStencil) {
view_format = PixelFormat::S8_UINT;
}
const auto& info = MaxwellToVK::SurfaceFormat(*device, FormatType::Optimal, true, view_format);
const auto& info = MaxwellToVK::SurfaceFormat(*device, FormatType::Optimal, true, format);
stencil_view = MakeView(info.format, VK_IMAGE_ASPECT_STENCIL_BIT); stencil_view = MakeView(info.format, VK_IMAGE_ASPECT_STENCIL_BIT);
return *stencil_view; return *stencil_view;
} }

1
src/video_core/texture_cache/texture_cache.h

@ -2423,6 +2423,7 @@ void TextureCache<P>::SynchronizeAliases(ImageId image_id) {
template <class P> template <class P>
void TextureCache<P>::PrepareImage(ImageId image_id, bool is_modification, bool invalidate) { void TextureCache<P>::PrepareImage(ImageId image_id, bool is_modification, bool invalidate) {
Image& image = slot_images[image_id]; Image& image = slot_images[image_id];
runtime.TransitionImageLayout(image);
if (invalidate) { if (invalidate) {
image.flags &= ~(ImageFlagBits::CpuModified | ImageFlagBits::GpuModified); image.flags &= ~(ImageFlagBits::CpuModified | ImageFlagBits::GpuModified);
if (False(image.flags & ImageFlagBits::Tracked)) { if (False(image.flags & ImageFlagBits::Tracked)) {

Loading…
Cancel
Save