mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2025-02-20 19:02:05 +00:00
r_rtColorFormat is now a UNORM format, fixed shader data for PIX debugging
This commit is contained in:
parent
e52133ea5d
commit
e009dce47a
6 changed files with 15 additions and 10 deletions
|
@ -260,7 +260,7 @@ void GRP::Init()
|
||||||
renderTargetFormat = TextureFormat::R10G10B10A2_UNorm;
|
renderTargetFormat = TextureFormat::R10G10B10A2_UNorm;
|
||||||
break;
|
break;
|
||||||
case RTCF_R16G16B16A16:
|
case RTCF_R16G16B16A16:
|
||||||
renderTargetFormat = TextureFormat::RGBA64_Float;
|
renderTargetFormat = TextureFormat::RGBA64_UNorm;
|
||||||
break;
|
break;
|
||||||
case RTCF_R8G8B8A8:
|
case RTCF_R8G8B8A8:
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -73,8 +73,7 @@ SamplerState sampler0 : register(s0);
|
||||||
|
|
||||||
float4 ps(VOut input) : SV_Target
|
float4 ps(VOut input) : SV_Target
|
||||||
{
|
{
|
||||||
float3 raw = texture0.Sample(sampler0, input.texCoords).rgb;
|
float3 base = texture0.Sample(sampler0, input.texCoords).rgb;
|
||||||
float3 base = saturate(raw); // can have negative values in the float render target
|
|
||||||
float3 gc = pow(base, invGamma) * brightness;
|
float3 gc = pow(base, invGamma) * brightness;
|
||||||
|
|
||||||
return MakeGreyscale(float4(gc.rgb, 1.0), greyscale);
|
return MakeGreyscale(float4(gc.rgb, 1.0), greyscale);
|
||||||
|
|
|
@ -62,8 +62,7 @@ SamplerState sampler0 : register(s0);
|
||||||
|
|
||||||
float4 ps(VOut input) : SV_Target
|
float4 ps(VOut input) : SV_Target
|
||||||
{
|
{
|
||||||
float3 raw = texture0.Sample(sampler0, input.texCoords).rgb;
|
float3 base = texture0.Sample(sampler0, input.texCoords).rgb;
|
||||||
float3 base = saturate(raw); // can have negative values in the float render target
|
|
||||||
float3 linearSpace = pow(base * invBrightness, gamma);
|
float3 linearSpace = pow(base * invBrightness, gamma);
|
||||||
|
|
||||||
return float4(linearSpace, 1.0f);
|
return float4(linearSpace, 1.0f);
|
||||||
|
|
|
@ -1497,6 +1497,7 @@ namespace RHI
|
||||||
switch(format)
|
switch(format)
|
||||||
{
|
{
|
||||||
case TextureFormat::RGBA32_UNorm: return DXGI_FORMAT_R8G8B8A8_UNORM;
|
case TextureFormat::RGBA32_UNorm: return DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||||
|
case TextureFormat::RGBA64_UNorm: return DXGI_FORMAT_R16G16B16A16_UNORM;
|
||||||
case TextureFormat::RGBA64_Float: return DXGI_FORMAT_R16G16B16A16_FLOAT;
|
case TextureFormat::RGBA64_Float: return DXGI_FORMAT_R16G16B16A16_FLOAT;
|
||||||
case TextureFormat::Depth32_Float: return DXGI_FORMAT_D32_FLOAT;
|
case TextureFormat::Depth32_Float: return DXGI_FORMAT_D32_FLOAT;
|
||||||
case TextureFormat::Depth24_Stencil8: return DXGI_FORMAT_D24_UNORM_S8_UINT;
|
case TextureFormat::Depth24_Stencil8: return DXGI_FORMAT_D24_UNORM_S8_UINT;
|
||||||
|
@ -3809,14 +3810,17 @@ namespace RHI
|
||||||
PushArg(entryPointW);
|
PushArg(entryPointW);
|
||||||
PushArg(L"-T");
|
PushArg(L"-T");
|
||||||
PushArg(targetW);
|
PushArg(targetW);
|
||||||
PushArg(DXC_ARG_WARNINGS_ARE_ERRORS);
|
PushArg(DXC_ARG_WARNINGS_ARE_ERRORS); // -WX
|
||||||
#if defined(D3D_DEBUG)
|
#if defined(D3D_DEBUG)
|
||||||
PushArg(DXC_ARG_DEBUG);
|
PushArg(DXC_ARG_DEBUG); // -Zi embeds debug info
|
||||||
PushArg(DXC_ARG_SKIP_OPTIMIZATIONS);
|
PushArg(DXC_ARG_SKIP_OPTIMIZATIONS); // -Od disables optimizations
|
||||||
|
PushArg(DXC_ARG_ENABLE_STRICTNESS); // -Ges enables strict mode
|
||||||
|
PushArg(DXC_ARG_IEEE_STRICTNESS); // -Gis forces IEEE strictness
|
||||||
|
PushArg(L"-Qembed_debug"); // -Qembed_debug embeds debug info in shader container
|
||||||
#else
|
#else
|
||||||
PushArg(L"-Qstrip_debug");
|
PushArg(L"-Qstrip_debug");
|
||||||
PushArg(L"-Qstrip_reflect");
|
PushArg(L"-Qstrip_reflect");
|
||||||
PushArg(DXC_ARG_OPTIMIZATION_LEVEL3);
|
PushArg(DXC_ARG_OPTIMIZATION_LEVEL3); // -O3
|
||||||
#endif
|
#endif
|
||||||
PushArg(L"-D");
|
PushArg(L"-D");
|
||||||
PushArg(desc.stage == ShaderStage::Vertex ? L"VERTEX_SHADER=1" : L"VERTEX_SHADER=0");
|
PushArg(desc.stage == ShaderStage::Vertex ? L"VERTEX_SHADER=1" : L"VERTEX_SHADER=0");
|
||||||
|
|
|
@ -158,6 +158,7 @@ namespace RHI
|
||||||
enum Id
|
enum Id
|
||||||
{
|
{
|
||||||
RGBA32_UNorm,
|
RGBA32_UNorm,
|
||||||
|
RGBA64_UNorm,
|
||||||
RGBA64_Float,
|
RGBA64_Float,
|
||||||
Depth32_Float,
|
Depth32_Float,
|
||||||
RG16_UNorm,
|
RG16_UNorm,
|
||||||
|
|
|
@ -51,7 +51,9 @@ void CompileShader(const ShaderArgs& args, int extraCount = 0, const char** extr
|
||||||
|
|
||||||
// -Ges: Enable strict mode
|
// -Ges: Enable strict mode
|
||||||
// -Gis: Force IEEE strictness
|
// -Gis: Force IEEE strictness
|
||||||
strcpy(temp, va("dxc.exe -Fh %s -E %s -T %s -WX -Ges -Gis",
|
// -Zi: Embed debug info
|
||||||
|
// -Qembed_debug: Embed debug info in shader container
|
||||||
|
strcpy(temp, va("dxc.exe -Fh %s -E %s -T %s -WX -Ges -Gis -Zi -Qembed_debug",
|
||||||
args.headerPath, args.entryPoint, args.targetProfile));
|
args.headerPath, args.entryPoint, args.targetProfile));
|
||||||
|
|
||||||
for(int i = 0; i < extraCount; ++i)
|
for(int i = 0; i < extraCount; ++i)
|
||||||
|
|
Loading…
Reference in a new issue