mirror of https://github.com/PCSX2/pcsx2.git
GS:HW: Rename FloatColor to HDRColor
It will soon be not a float
This commit is contained in:
parent
e8a021e1b0
commit
4a7539cd06
|
@ -84,7 +84,7 @@ u32 GSTexture::GetCompressedBytesPerBlock() const
|
|||
static constexpr u32 bytes_per_block[] = {
|
||||
1, // Invalid
|
||||
4, // Color/RGBA8
|
||||
16, // FloatColor/RGBA32F
|
||||
16, // HDRColor/RGBA32F
|
||||
32, // DepthStencil
|
||||
1, // UNorm8/R8
|
||||
2, // UInt16/R16UI
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
{
|
||||
Invalid = 0, ///< Used for initialization
|
||||
Color, ///< Standard (RGBA8) color texture
|
||||
FloatColor, ///< Float-based color texture for colclip emulation (RGBA32F)
|
||||
HDRColor, ///< Float-based color texture for colclip emulation (RGBA32F)
|
||||
DepthStencil, ///< Depth stencil texture
|
||||
UNorm8, ///< A8UNorm texture for paletted textures and the OSD font
|
||||
UInt16, ///< UInt16 texture for reading back 16-bit depth
|
||||
|
|
|
@ -465,7 +465,7 @@ GSTexture* GSDevice11::CreateSurface(GSTexture::Type type, int width, int height
|
|||
switch (format)
|
||||
{
|
||||
case GSTexture::Format::Color: dxformat = DXGI_FORMAT_R8G8B8A8_UNORM; break;
|
||||
case GSTexture::Format::FloatColor: dxformat = DXGI_FORMAT_R32G32B32A32_FLOAT; break;
|
||||
case GSTexture::Format::HDRColor: dxformat = DXGI_FORMAT_R32G32B32A32_FLOAT; break;
|
||||
case GSTexture::Format::DepthStencil: dxformat = DXGI_FORMAT_R32G8X24_TYPELESS; break;
|
||||
case GSTexture::Format::UNorm8: dxformat = DXGI_FORMAT_A8_UNORM; break;
|
||||
case GSTexture::Format::UInt16: dxformat = DXGI_FORMAT_R16_UINT; break;
|
||||
|
@ -1382,7 +1382,7 @@ void GSDevice11::RenderHW(GSHWDrawConfig& config)
|
|||
{
|
||||
const GSVector4 dRect(config.drawarea);
|
||||
const GSVector4 sRect = dRect / GSVector4(rtsize.x, rtsize.y).xyxy();
|
||||
hdr_rt = CreateRenderTarget(rtsize.x, rtsize.y, GSTexture::Format::FloatColor);
|
||||
hdr_rt = CreateRenderTarget(rtsize.x, rtsize.y, GSTexture::Format::HDRColor);
|
||||
// Warning: StretchRect must be called before BeginScene otherwise
|
||||
// vertices will be overwritten. Trust me you don't want to do that.
|
||||
StretchRect(config.rt, sRect, hdr_rt, dRect, ShaderConvert::HDR_INIT, false);
|
||||
|
|
|
@ -284,7 +284,7 @@ void GSDevice12::LookupNativeFormat(GSTexture::Format format, DXGI_FORMAT* d3d_f
|
|||
static constexpr std::array<std::array<DXGI_FORMAT, 4>, static_cast<int>(GSTexture::Format::BC7) + 1> s_format_mapping = {{
|
||||
{DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN}, // Invalid
|
||||
{DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_UNKNOWN}, // Color
|
||||
{DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN}, // FloatColor
|
||||
{DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN}, // HDRColor
|
||||
{DXGI_FORMAT_D32_FLOAT_S8X24_UINT, DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_D32_FLOAT_S8X24_UINT}, // DepthStencil
|
||||
{DXGI_FORMAT_A8_UNORM, DXGI_FORMAT_A8_UNORM, DXGI_FORMAT_A8_UNORM, DXGI_FORMAT_UNKNOWN}, // UNorm8
|
||||
{DXGI_FORMAT_R16_UINT, DXGI_FORMAT_R16_UINT, DXGI_FORMAT_R16_UINT, DXGI_FORMAT_UNKNOWN}, // UInt16
|
||||
|
@ -2488,7 +2488,7 @@ void GSDevice12::RenderHW(GSHWDrawConfig& config)
|
|||
EndRenderPass();
|
||||
|
||||
GL_PUSH_("HDR Render Target Setup");
|
||||
hdr_rt = static_cast<GSTexture12*>(CreateRenderTarget(rtsize.x, rtsize.y, GSTexture::Format::FloatColor, false));
|
||||
hdr_rt = static_cast<GSTexture12*>(CreateRenderTarget(rtsize.x, rtsize.y, GSTexture::Format::HDRColor, false));
|
||||
if (!hdr_rt)
|
||||
{
|
||||
Console.WriteLn("Failed to allocate HDR render target, aborting draw.");
|
||||
|
|
|
@ -374,7 +374,7 @@ static constexpr MTLPixelFormat ConvertPixelFormat(GSTexture::Format format)
|
|||
case GSTexture::Format::UInt16: return MTLPixelFormatR16Uint;
|
||||
case GSTexture::Format::UNorm8: return MTLPixelFormatA8Unorm;
|
||||
case GSTexture::Format::Color: return MTLPixelFormatRGBA8Unorm;
|
||||
case GSTexture::Format::FloatColor: return MTLPixelFormatRGBA32Float;
|
||||
case GSTexture::Format::HDRColor: return MTLPixelFormatRGBA32Float;
|
||||
case GSTexture::Format::DepthStencil: return MTLPixelFormatDepth32Float_Stencil8;
|
||||
case GSTexture::Format::Invalid: return MTLPixelFormatInvalid;
|
||||
case GSTexture::Format::BC1: return MTLPixelFormatBC1_RGBA;
|
||||
|
@ -772,7 +772,7 @@ bool GSDeviceMTL::Create()
|
|||
m_hdr_resolve_pipeline = MakePipeline(pdesc, fs_triangle, LoadShader(@"ps_hdr_resolve"), @"HDR Resolve");
|
||||
m_fxaa_pipeline = MakePipeline(pdesc, fs_triangle, LoadShader(@"ps_fxaa"), @"fxaa");
|
||||
m_shadeboost_pipeline = MakePipeline(pdesc, fs_triangle, LoadShader(@"ps_shadeboost"), @"shadeboost");
|
||||
pdesc.colorAttachments[0].pixelFormat = ConvertPixelFormat(GSTexture::Format::FloatColor);
|
||||
pdesc.colorAttachments[0].pixelFormat = ConvertPixelFormat(GSTexture::Format::HDRColor);
|
||||
m_hdr_init_pipeline = MakePipeline(pdesc, fs_triangle, LoadShader(@"ps_hdr_init"), @"HDR Init");
|
||||
pdesc.colorAttachments[0].pixelFormat = MTLPixelFormatInvalid;
|
||||
pdesc.stencilAttachmentPixelFormat = MTLPixelFormatDepth32Float_Stencil8;
|
||||
|
@ -853,7 +853,7 @@ bool GSDeviceMTL::Create()
|
|||
}
|
||||
pdesc.colorAttachments[0].pixelFormat = ConvertPixelFormat(GSTexture::Format::Color);
|
||||
m_convert_pipeline_copy[0] = MakePipeline(pdesc, vs_convert, ps_copy, @"copy_color");
|
||||
pdesc.colorAttachments[0].pixelFormat = ConvertPixelFormat(GSTexture::Format::FloatColor);
|
||||
pdesc.colorAttachments[0].pixelFormat = ConvertPixelFormat(GSTexture::Format::HDRColor);
|
||||
m_convert_pipeline_copy[1] = MakePipeline(pdesc, vs_convert, ps_copy, @"copy_hdr");
|
||||
|
||||
pdesc.colorAttachments[0].pixelFormat = MTLPixelFormatRGBA8Unorm;
|
||||
|
@ -1556,7 +1556,7 @@ void GSDeviceMTL::RenderHW(GSHWDrawConfig& config)
|
|||
if (config.ps.hdr)
|
||||
{
|
||||
GSVector2i size = config.rt->GetSize();
|
||||
hdr_rt = CreateRenderTarget(size.x, size.y, GSTexture::Format::FloatColor);
|
||||
hdr_rt = CreateRenderTarget(size.x, size.y, GSTexture::Format::HDRColor);
|
||||
BeginRenderPass(@"HDR Init", hdr_rt, MTLLoadActionDontCare, nullptr, MTLLoadActionDontCare);
|
||||
RenderCopy(config.rt, m_hdr_init_pipeline, config.drawarea);
|
||||
rt = hdr_rt;
|
||||
|
|
|
@ -1863,7 +1863,7 @@ void GSDeviceOGL::RenderHW(GSHWDrawConfig& config)
|
|||
GSTexture* draw_rt_clone = nullptr;
|
||||
if (config.ps.hdr)
|
||||
{
|
||||
hdr_rt = CreateRenderTarget(rtsize.x, rtsize.y, GSTexture::Format::FloatColor, false);
|
||||
hdr_rt = CreateRenderTarget(rtsize.x, rtsize.y, GSTexture::Format::HDRColor, false);
|
||||
OMSetRenderTargets(hdr_rt, config.ds, &config.scissor);
|
||||
|
||||
GSVector4 dRect(config.drawarea);
|
||||
|
|
|
@ -224,7 +224,7 @@ GSTextureOGL::GSTextureOGL(Type type, int width, int height, int levels, Format
|
|||
break;
|
||||
|
||||
// 4 channel float
|
||||
case Format::FloatColor:
|
||||
case Format::HDRColor:
|
||||
gl_fmt = GL_RGBA32F;
|
||||
m_int_format = GL_RGBA;
|
||||
m_int_type = GL_FLOAT;
|
||||
|
|
|
@ -378,7 +378,7 @@ VkFormat GSDeviceVK::LookupNativeFormat(GSTexture::Format format) const
|
|||
static constexpr std::array<VkFormat, static_cast<int>(GSTexture::Format::BC7) + 1> s_format_mapping = {{
|
||||
VK_FORMAT_UNDEFINED, // Invalid
|
||||
VK_FORMAT_R8G8B8A8_UNORM, // Color
|
||||
VK_FORMAT_R32G32B32A32_SFLOAT, // FloatColor
|
||||
VK_FORMAT_R32G32B32A32_SFLOAT, // HDRColor
|
||||
VK_FORMAT_D32_SFLOAT_S8_UINT, // DepthStencil
|
||||
VK_FORMAT_R8_UNORM, // UNorm8
|
||||
VK_FORMAT_R16_UINT, // UInt16
|
||||
|
@ -1244,7 +1244,7 @@ bool GSDeviceVK::CreateRenderPasses()
|
|||
} while (0)
|
||||
|
||||
const VkFormat rt_format = LookupNativeFormat(GSTexture::Format::Color);
|
||||
const VkFormat hdr_rt_format = LookupNativeFormat(GSTexture::Format::FloatColor);
|
||||
const VkFormat hdr_rt_format = LookupNativeFormat(GSTexture::Format::HDRColor);
|
||||
const VkFormat depth_format = LookupNativeFormat(GSTexture::Format::DepthStencil);
|
||||
|
||||
for (u32 rt = 0; rt < 2; rt++)
|
||||
|
@ -2926,7 +2926,7 @@ void GSDeviceVK::RenderHW(GSHWDrawConfig& config)
|
|||
EndRenderPass();
|
||||
|
||||
GL_PUSH_("HDR Render Target Setup");
|
||||
hdr_rt = static_cast<GSTextureVK*>(CreateRenderTarget(rtsize.x, rtsize.y, GSTexture::Format::FloatColor, false));
|
||||
hdr_rt = static_cast<GSTextureVK*>(CreateRenderTarget(rtsize.x, rtsize.y, GSTexture::Format::HDRColor, false));
|
||||
if (!hdr_rt)
|
||||
{
|
||||
Console.WriteLn("Failed to allocate HDR render target, aborting draw.");
|
||||
|
|
Loading…
Reference in New Issue