mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-05 00:42:48 +00:00
sRGB hack removed
This commit is contained in:
parent
e347e3249c
commit
7bfb0e6a06
@ -652,7 +652,7 @@ vk::Format SurfaceFormat(AmdGpu::DataFormat data_format, AmdGpu::NumberFormat nu
|
|||||||
}
|
}
|
||||||
|
|
||||||
vk::Format AdjustColorBufferFormat(vk::Format base_format,
|
vk::Format AdjustColorBufferFormat(vk::Format base_format,
|
||||||
Liverpool::ColorBuffer::SwapMode comp_swap, bool is_vo_surface) {
|
Liverpool::ColorBuffer::SwapMode comp_swap) {
|
||||||
const bool comp_swap_alt = comp_swap == Liverpool::ColorBuffer::SwapMode::Alternate;
|
const bool comp_swap_alt = comp_swap == Liverpool::ColorBuffer::SwapMode::Alternate;
|
||||||
const bool comp_swap_reverse = comp_swap == Liverpool::ColorBuffer::SwapMode::StandardReverse;
|
const bool comp_swap_reverse = comp_swap == Liverpool::ColorBuffer::SwapMode::StandardReverse;
|
||||||
const bool comp_swap_alt_reverse =
|
const bool comp_swap_alt_reverse =
|
||||||
@ -664,9 +664,9 @@ vk::Format AdjustColorBufferFormat(vk::Format base_format,
|
|||||||
case vk::Format::eB8G8R8A8Unorm:
|
case vk::Format::eB8G8R8A8Unorm:
|
||||||
return vk::Format::eR8G8B8A8Unorm;
|
return vk::Format::eR8G8B8A8Unorm;
|
||||||
case vk::Format::eR8G8B8A8Srgb:
|
case vk::Format::eR8G8B8A8Srgb:
|
||||||
return is_vo_surface ? vk::Format::eB8G8R8A8Unorm : vk::Format::eB8G8R8A8Srgb;
|
return vk::Format::eB8G8R8A8Srgb;
|
||||||
case vk::Format::eB8G8R8A8Srgb:
|
case vk::Format::eB8G8R8A8Srgb:
|
||||||
return is_vo_surface ? vk::Format::eR8G8B8A8Unorm : vk::Format::eR8G8B8A8Srgb;
|
return vk::Format::eR8G8B8A8Srgb;
|
||||||
case vk::Format::eA2B10G10R10UnormPack32:
|
case vk::Format::eA2B10G10R10UnormPack32:
|
||||||
return vk::Format::eA2R10G10B10UnormPack32;
|
return vk::Format::eA2R10G10B10UnormPack32;
|
||||||
default:
|
default:
|
||||||
@ -677,20 +677,10 @@ vk::Format AdjustColorBufferFormat(vk::Format base_format,
|
|||||||
case vk::Format::eR8G8B8A8Unorm:
|
case vk::Format::eR8G8B8A8Unorm:
|
||||||
return vk::Format::eA8B8G8R8UnormPack32;
|
return vk::Format::eA8B8G8R8UnormPack32;
|
||||||
case vk::Format::eR8G8B8A8Srgb:
|
case vk::Format::eR8G8B8A8Srgb:
|
||||||
return is_vo_surface ? vk::Format::eA8B8G8R8UnormPack32
|
return vk::Format::eA8B8G8R8SrgbPack32;
|
||||||
: vk::Format::eA8B8G8R8SrgbPack32;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (comp_swap_alt_reverse) {
|
|
||||||
return base_format;
|
|
||||||
} else {
|
|
||||||
if (is_vo_surface && base_format == vk::Format::eR8G8B8A8Srgb) {
|
|
||||||
return vk::Format::eR8G8B8A8Unorm;
|
|
||||||
}
|
|
||||||
if (is_vo_surface && base_format == vk::Format::eB8G8R8A8Srgb) {
|
|
||||||
return vk::Format::eB8G8R8A8Unorm;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return base_format;
|
return base_format;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ std::span<const SurfaceFormatInfo> SurfaceFormats();
|
|||||||
vk::Format SurfaceFormat(AmdGpu::DataFormat data_format, AmdGpu::NumberFormat num_format);
|
vk::Format SurfaceFormat(AmdGpu::DataFormat data_format, AmdGpu::NumberFormat num_format);
|
||||||
|
|
||||||
vk::Format AdjustColorBufferFormat(vk::Format base_format,
|
vk::Format AdjustColorBufferFormat(vk::Format base_format,
|
||||||
Liverpool::ColorBuffer::SwapMode comp_swap, bool is_vo_surface);
|
Liverpool::ColorBuffer::SwapMode comp_swap);
|
||||||
|
|
||||||
struct DepthFormatInfo {
|
struct DepthFormatInfo {
|
||||||
Liverpool::DepthBuffer::ZFormat z_format;
|
Liverpool::DepthBuffer::ZFormat z_format;
|
||||||
|
@ -265,9 +265,8 @@ bool PipelineCache::RefreshGraphicsKey() {
|
|||||||
}
|
}
|
||||||
const auto base_format =
|
const auto base_format =
|
||||||
LiverpoolToVK::SurfaceFormat(col_buf.info.format, col_buf.NumFormat());
|
LiverpoolToVK::SurfaceFormat(col_buf.info.format, col_buf.NumFormat());
|
||||||
const bool is_vo_surface = presenter->IsVideoOutSurface(col_buf);
|
key.color_formats[remapped_cb] =
|
||||||
key.color_formats[remapped_cb] = LiverpoolToVK::AdjustColorBufferFormat(
|
LiverpoolToVK::AdjustColorBufferFormat(base_format, col_buf.info.comp_swap.Value());
|
||||||
base_format, col_buf.info.comp_swap.Value(), false /*is_vo_surface*/);
|
|
||||||
key.color_num_formats[remapped_cb] = col_buf.NumFormat();
|
key.color_num_formats[remapped_cb] = col_buf.NumFormat();
|
||||||
if (base_format == key.color_formats[remapped_cb]) {
|
if (base_format == key.color_formats[remapped_cb]) {
|
||||||
key.mrt_swizzles[remapped_cb] = col_buf.info.comp_swap.Value();
|
key.mrt_swizzles[remapped_cb] = col_buf.info.comp_swap.Value();
|
||||||
|
@ -271,7 +271,7 @@ void Rasterizer::BeginRendering(const GraphicsPipeline& pipeline) {
|
|||||||
|
|
||||||
const auto& hint = liverpool->last_cb_extent[col_buf_id];
|
const auto& hint = liverpool->last_cb_extent[col_buf_id];
|
||||||
VideoCore::ImageInfo image_info{col_buf, hint};
|
VideoCore::ImageInfo image_info{col_buf, hint};
|
||||||
VideoCore::ImageViewInfo view_info{col_buf, false /*!!image.info.usage.vo_buffer*/};
|
VideoCore::ImageViewInfo view_info{col_buf};
|
||||||
const auto& image_view = texture_cache.FindRenderTarget(image_info, view_info);
|
const auto& image_view = texture_cache.FindRenderTarget(image_info, view_info);
|
||||||
const auto& image = texture_cache.GetImage(image_view.image_id);
|
const auto& image = texture_cache.GetImage(image_view.image_id);
|
||||||
state.width = std::min<u32>(state.width, image.info.size.width);
|
state.width = std::min<u32>(state.width, image.info.size.width);
|
||||||
|
@ -125,15 +125,14 @@ ImageViewInfo::ImageViewInfo(const AmdGpu::Image& image, const Shader::ImageReso
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageViewInfo::ImageViewInfo(const AmdGpu::Liverpool::ColorBuffer& col_buffer,
|
ImageViewInfo::ImageViewInfo(const AmdGpu::Liverpool::ColorBuffer& col_buffer) noexcept {
|
||||||
bool is_vo_surface) noexcept {
|
|
||||||
const auto base_format =
|
const auto base_format =
|
||||||
Vulkan::LiverpoolToVK::SurfaceFormat(col_buffer.info.format, col_buffer.NumFormat());
|
Vulkan::LiverpoolToVK::SurfaceFormat(col_buffer.info.format, col_buffer.NumFormat());
|
||||||
range.base.layer = col_buffer.view.slice_start;
|
range.base.layer = col_buffer.view.slice_start;
|
||||||
range.extent.layers = col_buffer.NumSlices() - range.base.layer;
|
range.extent.layers = col_buffer.NumSlices() - range.base.layer;
|
||||||
type = range.extent.layers > 1 ? vk::ImageViewType::e2DArray : vk::ImageViewType::e2D;
|
type = range.extent.layers > 1 ? vk::ImageViewType::e2DArray : vk::ImageViewType::e2D;
|
||||||
format = Vulkan::LiverpoolToVK::AdjustColorBufferFormat(
|
format = Vulkan::LiverpoolToVK::AdjustColorBufferFormat(base_format,
|
||||||
base_format, col_buffer.info.comp_swap.Value(), is_vo_surface);
|
col_buffer.info.comp_swap.Value());
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageViewInfo::ImageViewInfo(const AmdGpu::Liverpool::DepthBuffer& depth_buffer,
|
ImageViewInfo::ImageViewInfo(const AmdGpu::Liverpool::DepthBuffer& depth_buffer,
|
||||||
|
@ -19,7 +19,7 @@ namespace VideoCore {
|
|||||||
struct ImageViewInfo {
|
struct ImageViewInfo {
|
||||||
ImageViewInfo() = default;
|
ImageViewInfo() = default;
|
||||||
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, bool is_vo_surface) 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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user