fix: 修复部分着色器的警告

This commit is contained in:
Xu Liu 2022-03-07 20:50:06 +08:00
commit aa890e941e
5 changed files with 8 additions and 2 deletions

View file

@ -148,6 +148,8 @@ SamplerState sam;
//!STYLE PS
//!IN INPUT
#pragma warning(disable: 3571) // X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them
#define FIX(c) max(abs(c), 1e-5)
#define PI 3.141592653589
#define TEX2D(c) dilate(INPUT.SampleLevel(sam, c, 0))

View file

@ -136,6 +136,8 @@ SamplerState sam;
//!STYLE PS
//!IN INPUT
#pragma warning(disable: 3571) // X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them
// Use the older, purely gaussian beam profile; uncomment for speed
// #define USEGAUSSIAN

View file

@ -121,6 +121,8 @@ SamplerState sam;
//!STYLE PS
//!IN INPUT
#pragma warning(disable: 3571) // X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them
#define GAMMA_IN(color) pow(color, float3(inputGamma, inputGamma, inputGamma))
#define GAMMA_OUT(color) pow(color, float3(1.0 / outputGamma, 1.0 / outputGamma, 1.0 / outputGamma))

View file

@ -33,7 +33,7 @@ SamplerState samplerLinearClamp;
#pragma warning(disable: 4714) // sum of temp registers and indexable temp registers times 256 threads exceeds the recommended total 16384. Performance may be reduced
#pragma warning(disable: 4714) // X4714: sum of temp registers and indexable temp registers times 256 threads exceeds the recommended total 16384. Performance may be reduced
#define kDetectRatio (2 * 1127.f / 1024.f)
#define kDetectThres (64.0f / 1024.0f)

View file

@ -1408,7 +1408,7 @@ cbuffer __CB2 : register(b1) {
}
if (!App::Get().GetDeviceResources().CompileShader(source, "__M", desc.passes[id].cso.put(),
fmt::format("Pass{}", id + 1).c_str(), &passInclude)
fmt::format("{}_Pass{}.hlsl", desc.name, id + 1).c_str(), &passInclude)
) {
Logger::Get().Error(fmt::format("编译 Pass{} 失败", id + 1));
}