mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-01-22 14:31:39 +00:00
hot-fix: downgrade Nx1 2D render targets to 1D
This commit is contained in:
parent
f26df42b18
commit
363fbe7a83
|
@ -268,10 +268,10 @@ ImageInfo::ImageInfo(const AmdGpu::Liverpool::ColorBuffer& buffer,
|
||||||
pixel_format = LiverpoolToVK::SurfaceFormat(buffer.info.format, buffer.NumFormat());
|
pixel_format = LiverpoolToVK::SurfaceFormat(buffer.info.format, buffer.NumFormat());
|
||||||
num_samples = 1 << buffer.attrib.num_fragments_log2;
|
num_samples = 1 << buffer.attrib.num_fragments_log2;
|
||||||
num_bits = NumBits(buffer.info.format);
|
num_bits = NumBits(buffer.info.format);
|
||||||
type = vk::ImageType::e2D;
|
|
||||||
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;
|
||||||
|
type = size.height == 1 ? vk::ImageType::e1D : vk::ImageType::e2D;
|
||||||
pitch = buffer.Pitch();
|
pitch = buffer.Pitch();
|
||||||
resources.layers = buffer.NumSlices();
|
resources.layers = buffer.NumSlices();
|
||||||
meta_info.cmask_addr = buffer.info.fast_clear ? buffer.CmaskAddress() : 0;
|
meta_info.cmask_addr = buffer.info.fast_clear ? buffer.CmaskAddress() : 0;
|
||||||
|
|
|
@ -137,7 +137,7 @@ ImageViewInfo::ImageViewInfo(const AmdGpu::Liverpool::ColorBuffer& col_buffer) n
|
||||||
|
|
||||||
ImageViewInfo::ImageViewInfo(const AmdGpu::Liverpool::DepthBuffer& depth_buffer,
|
ImageViewInfo::ImageViewInfo(const AmdGpu::Liverpool::DepthBuffer& depth_buffer,
|
||||||
AmdGpu::Liverpool::DepthView view,
|
AmdGpu::Liverpool::DepthView view,
|
||||||
AmdGpu::Liverpool::DepthControl ctl) {
|
AmdGpu::Liverpool::DepthControl ctl) noexcept {
|
||||||
format = Vulkan::LiverpoolToVK::DepthFormat(depth_buffer.z_info.format,
|
format = Vulkan::LiverpoolToVK::DepthFormat(depth_buffer.z_info.format,
|
||||||
depth_buffer.stencil_info.format);
|
depth_buffer.stencil_info.format);
|
||||||
is_storage = ctl.depth_write_enable;
|
is_storage = ctl.depth_write_enable;
|
||||||
|
|
|
@ -21,7 +21,7 @@ struct ImageViewInfo {
|
||||||
ImageViewInfo(const AmdGpu::Image& image, const Shader::ImageResource& desc) noexcept;
|
ImageViewInfo(const AmdGpu::Image& image, const Shader::ImageResource& desc) noexcept;
|
||||||
ImageViewInfo(const AmdGpu::Liverpool::ColorBuffer& col_buffer) noexcept;
|
ImageViewInfo(const AmdGpu::Liverpool::ColorBuffer& col_buffer) noexcept;
|
||||||
ImageViewInfo(const AmdGpu::Liverpool::DepthBuffer& depth_buffer,
|
ImageViewInfo(const AmdGpu::Liverpool::DepthBuffer& depth_buffer,
|
||||||
AmdGpu::Liverpool::DepthView view, AmdGpu::Liverpool::DepthControl ctl);
|
AmdGpu::Liverpool::DepthView view, AmdGpu::Liverpool::DepthControl ctl) noexcept;
|
||||||
|
|
||||||
vk::ImageViewType type = vk::ImageViewType::e2D;
|
vk::ImageViewType type = vk::ImageViewType::e2D;
|
||||||
vk::Format format = vk::Format::eR8G8B8A8Unorm;
|
vk::Format format = vk::Format::eR8G8B8A8Unorm;
|
||||||
|
|
|
@ -71,7 +71,12 @@ public:
|
||||||
struct RenderTargetDesc : public BaseDesc {
|
struct RenderTargetDesc : public BaseDesc {
|
||||||
RenderTargetDesc(const AmdGpu::Liverpool::ColorBuffer& buffer,
|
RenderTargetDesc(const AmdGpu::Liverpool::ColorBuffer& buffer,
|
||||||
const AmdGpu::Liverpool::CbDbExtent& hint = {})
|
const AmdGpu::Liverpool::CbDbExtent& hint = {})
|
||||||
: BaseDesc{BindingType::RenderTarget, ImageInfo{buffer, hint}, ImageViewInfo{buffer}} {}
|
: BaseDesc{BindingType::RenderTarget, ImageInfo{buffer, hint}, ImageViewInfo{buffer}} {
|
||||||
|
if (info.size.height == 1) {
|
||||||
|
view_info.type = vk::ImageViewType::e1D;
|
||||||
|
ASSERT(info.resources.levels == 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DepthTargetDesc : public BaseDesc {
|
struct DepthTargetDesc : public BaseDesc {
|
||||||
|
|
|
@ -187,6 +187,7 @@ vk::Format DemoteImageFormatForDetiling(vk::Format format) {
|
||||||
case vk::Format::eR32Uint:
|
case vk::Format::eR32Uint:
|
||||||
case vk::Format::eR16G16Sfloat:
|
case vk::Format::eR16G16Sfloat:
|
||||||
case vk::Format::eR16G16Unorm:
|
case vk::Format::eR16G16Unorm:
|
||||||
|
case vk::Format::eR16G16Snorm:
|
||||||
case vk::Format::eB10G11R11UfloatPack32:
|
case vk::Format::eB10G11R11UfloatPack32:
|
||||||
return vk::Format::eR32Uint;
|
return vk::Format::eR32Uint;
|
||||||
case vk::Format::eBc1RgbaSrgbBlock:
|
case vk::Format::eBc1RgbaSrgbBlock:
|
||||||
|
|
Loading…
Reference in a new issue