Fix various shader warnings
This commit is contained in:
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -238,7 +238,7 @@ float cubic_basis_shaper
|
||||
if ((x > knots[0]) && (x < knots[4]))
|
||||
{
|
||||
float knot_coord = (x - knots[0]) * 4.0 / w;
|
||||
int j = knot_coord;
|
||||
int j = (int)knot_coord;
|
||||
float t = knot_coord - j;
|
||||
|
||||
float monomials[4] = { t*t*t, t*t, t, 1.0 };
|
||||
@@ -338,7 +338,7 @@ float segmented_spline_c5_fwd( float x )
|
||||
else if (( logx > log10(C.minPoint.x) ) && ( logx < log10(C.midPoint.x) ))
|
||||
{
|
||||
float knot_coord = (N_KNOTS_LOW-1) * (logx-log10(C.minPoint.x))/(log10(C.midPoint.x)-log10(C.minPoint.x));
|
||||
int j = knot_coord;
|
||||
int j = (int)knot_coord;
|
||||
float t = knot_coord - j;
|
||||
|
||||
float3 cf = { C.coefsLow[ j], C.coefsLow[ j + 1], C.coefsLow[ j + 2]};
|
||||
@@ -349,7 +349,7 @@ float segmented_spline_c5_fwd( float x )
|
||||
else if (( logx >= log10(C.midPoint.x) ) && ( logx < log10(C.maxPoint.x) ))
|
||||
{
|
||||
float knot_coord = (N_KNOTS_HIGH-1) * (logx-log10(C.midPoint.x))/(log10(C.maxPoint.x)-log10(C.midPoint.x));
|
||||
int j = knot_coord;
|
||||
int j = (int)knot_coord;
|
||||
float t = knot_coord - j;
|
||||
|
||||
float3 cf = { C.coefsHigh[ j], C.coefsHigh[ j + 1], C.coefsHigh[ j + 2]};
|
||||
@@ -486,7 +486,7 @@ float segmented_spline_c9_fwd( float x, const SegmentedSplineParams_c9 C )
|
||||
else if ((logx > log10(C.minPoint.x)) && (logx < log10(C.midPoint.x)))
|
||||
{
|
||||
float knot_coord = (N_KNOTS_LOW - 1) * (logx - log10(C.minPoint.x)) / (log10(C.midPoint.x) - log10(C.minPoint.x));
|
||||
int j = knot_coord;
|
||||
int j = (int)knot_coord;
|
||||
float t = knot_coord - j;
|
||||
|
||||
float3 cf = { C.coefsLow[j], C.coefsLow[j + 1], C.coefsLow[j + 2] };
|
||||
@@ -497,7 +497,7 @@ float segmented_spline_c9_fwd( float x, const SegmentedSplineParams_c9 C )
|
||||
else if ((logx >= log10(C.midPoint.x)) && (logx < log10(C.maxPoint.x)))
|
||||
{
|
||||
float knot_coord = (N_KNOTS_HIGH - 1) * (logx - log10(C.midPoint.x)) / (log10(C.maxPoint.x) - log10(C.midPoint.x));
|
||||
int j = knot_coord;
|
||||
int j = (int)knot_coord;
|
||||
float t = knot_coord - j;
|
||||
|
||||
float3 cf = { C.coefsHigh[j], C.coefsHigh[j + 1], C.coefsHigh[j + 2] };
|
||||
|
||||
@@ -296,24 +296,17 @@ void CS_Classify(uint3 DispatchThreadId : SV_DispatchThreadID)
|
||||
#endif
|
||||
{
|
||||
#if DDGI_PROBE_RELOCATE_FIND_BEST
|
||||
// Sample Global SDF around the probe base location
|
||||
// Sample Global SDF around the probe base location and select the best probe offset
|
||||
uint sdfCascade = GetGlobalSDFCascade(GlobalSDF, probeBasePosition);
|
||||
float4 CachedProbeOffsets[64];
|
||||
float4 bestOffset = float4(0, 0, 0, 0);
|
||||
for (uint x = 0; x < 4; x++)
|
||||
for (uint y = 0; y < 4; y++)
|
||||
for (uint z = 0; z < 4; z++)
|
||||
{
|
||||
float3 offset = Remap(float3(x, y, z), 0, 3, -0.707f, 0.707f) * relocateLimit;
|
||||
float offsetSdf = SampleGlobalSDFCascade(GlobalSDF, GlobalSDFTex, probeBasePosition + offset, sdfCascade);
|
||||
CachedProbeOffsets[x * 16 + y * 4 + z] = float4(offset, offsetSdf);
|
||||
}
|
||||
|
||||
// Select the best probe location around the base position
|
||||
float4 bestOffset = CachedProbeOffsets[0];
|
||||
for (uint i = 1; i < 64; i++)
|
||||
{
|
||||
if (CachedProbeOffsets[i].w > bestOffset.w)
|
||||
bestOffset = CachedProbeOffsets[i];
|
||||
if (offsetSdf > bestOffset.w)
|
||||
bestOffset = float4(offset, offsetSdf);
|
||||
}
|
||||
if (bestOffset.w <= voxelLimit)
|
||||
{
|
||||
|
||||
@@ -328,7 +328,7 @@ float4 PS_Debug(Quad_VS2PS input) : SV_Target
|
||||
if (hit.IsHit())
|
||||
{
|
||||
// Normalize step count back to default scale (higher precision is just for preview)
|
||||
hit.StepsCount *= stepScale;
|
||||
hit.StepsCount = (uint)(hit.StepsCount * stepScale);
|
||||
|
||||
#if 1
|
||||
float3 hitPosition = hit.GetHitPosition(trace);
|
||||
|
||||
@@ -171,7 +171,7 @@ float4 PS_Complexity(Quad_VS2PS input) : SV_Target0
|
||||
float4(1.0, 0.0, 0.5, 1.0),
|
||||
float4(1.0, 0.9, 0.9, 1.0)
|
||||
};
|
||||
return colors[min(complexity * colorsCount, colorsCount - 1)] * outline;
|
||||
return colors[min((uint)(complexity * colorsCount), colorsCount - 1)] * outline;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -610,6 +610,7 @@ float4 SMAADecodeDiagBilinearAccess(float4 e) {
|
||||
* These functions allows to perform diagonal pattern searches.
|
||||
*/
|
||||
float2 SMAASearchDiag1(SMAATexture2D(edgesTex), float2 texcoord, float2 dir, out float2 e) {
|
||||
e = float2(0, 0);
|
||||
float4 coord = float4(texcoord, -1.0, 1.0);
|
||||
float3 t = float3(SMAA_RT_METRICS.xy, 1.0);
|
||||
while (coord.z < float(SMAA_MAX_SEARCH_STEPS_DIAG - 1) &&
|
||||
@@ -622,6 +623,7 @@ float2 SMAASearchDiag1(SMAATexture2D(edgesTex), float2 texcoord, float2 dir, out
|
||||
}
|
||||
|
||||
float2 SMAASearchDiag2(SMAATexture2D(edgesTex), float2 texcoord, float2 dir, out float2 e) {
|
||||
e = float2(0, 0);
|
||||
float4 coord = float4(texcoord, -1.0, 1.0);
|
||||
coord.x += 0.25 * SMAA_RT_METRICS.x; // See @SearchDiag2Optimization
|
||||
float3 t = float3(SMAA_RT_METRICS.xy, 1.0);
|
||||
|
||||
@@ -89,7 +89,7 @@ float3 TraceScreenSpaceReflection(
|
||||
bool validHit = false;
|
||||
uint2 depthBufferSize;
|
||||
depthBuffer.GetDimensions(depthBufferSize.x, depthBufferSize.y);
|
||||
float3 hit = FFX_SSSR_HierarchicalRaymarch(depthBuffer, hzbMips, depthDiffError, uncertainHit, startUV, rayUV, depthBufferSize, 0, numSamples, validHit);
|
||||
float3 hit = FFX_SSSR_HierarchicalRaymarch(depthBuffer, hzbMips, depthDiffError, uncertainHit, startUV, rayUV, (float2)depthBufferSize, 0, (uint)numSamples, validHit);
|
||||
if (!validHit)
|
||||
return 0;
|
||||
currOffset = hit;
|
||||
|
||||
+3
-3
@@ -79,7 +79,7 @@ bool FFX_SSSR_AdvanceRay(float3 origin, float3 direction, float3 inv_direction,
|
||||
}
|
||||
|
||||
float2 FFX_SSSR_GetMipResolution(float2 screen_dimensions, int mip_level) {
|
||||
return screen_dimensions * pow(0.5, mip_level);
|
||||
return screen_dimensions * pow(0.5, (float)mip_level);
|
||||
}
|
||||
|
||||
// Requires origin and direction of the ray to be in screen space [0, 1] x [0, 1]
|
||||
@@ -95,11 +95,11 @@ float3 FFX_SSSR_HierarchicalRaymarch(Texture2D depthBuffer, uint hzbMips, float
|
||||
|
||||
// Offset to the bounding boxes uv space to intersect the ray with the center of the next pixel.
|
||||
// This means we ever so slightly over shoot into the next region.
|
||||
float2 uv_offset = 0.005 * exp2(most_detailed_mip) / screen_size;
|
||||
float2 uv_offset = 0.005 * exp2((float)most_detailed_mip) / screen_size;
|
||||
uv_offset = select(direction.xy < 0, -uv_offset, uv_offset);
|
||||
|
||||
// Offset applied depending on current mip resolution to move the boundary to the left/right upper/lower border depending on ray direction.
|
||||
float2 floor_offset = select(direction.xy < 0, 0, 1);
|
||||
float2 floor_offset = select(direction.xy < 0, float2(0, 0), float2(1, 1));
|
||||
|
||||
// Initially advance ray to avoid immediate self intersections.
|
||||
float current_t;
|
||||
|
||||
Reference in New Issue
Block a user