Panagiotis Christopoulos Charitos 4 years ago
parent
commit
bbe100ea1f

+ 1 - 1
AnKi/Renderer/DownscaleBlur.cpp

@@ -74,7 +74,7 @@ Error DownscaleBlur::initInternal(const ConfigSet&)
 	}
 	else
 	{
-		ANKI_CHECK(getResourceManager().loadResource("Shaders/DownscaleBlur.ankiprog", m_prog));
+		ANKI_CHECK(getResourceManager().loadResource("Shaders/DownscaleBlurRaster.ankiprog", m_prog));
 		m_prog->getOrCreateVariant(variant);
 	}
 	m_grProg = variant->getProgram();

+ 0 - 0
AnKi/Shaders/DownscaleBlur.ankiprog → AnKi/Shaders/DownscaleBlurRaster.ankiprog


+ 14 - 14
AnKi/Shaders/FinalComposite.ankiprog

@@ -24,31 +24,31 @@ layout(set = 0, binding = 0) uniform sampler u_nearestAnyClampSampler;
 layout(set = 0, binding = 1) uniform sampler u_linearAnyClampSampler;
 layout(set = 0, binding = 2) uniform sampler u_trilinearRepeatSampler;
 
-layout(set = 0, binding = 3) uniform texture2D u_lightShadingRt;
-layout(set = 0, binding = 4) uniform texture2D u_ppsBloomLfRt;
-layout(set = 0, binding = 5) uniform texture3D u_lut;
-layout(set = 0, binding = 6) uniform texture2D u_blueNoise;
+layout(set = 0, binding = 3) uniform ANKI_RP texture2D u_lightShadingRt;
+layout(set = 0, binding = 4) uniform ANKI_RP texture2D u_ppsBloomLfRt;
+layout(set = 0, binding = 5) uniform ANKI_RP texture3D u_lut;
+layout(set = 0, binding = 6) uniform ANKI_RP texture2D u_blueNoise;
 layout(set = 0, binding = 7) uniform texture2D u_motionVectorsRt;
 layout(set = 0, binding = 8) uniform texture2D u_depthRt;
 #if DBG_ENABLED
-layout(set = 0, binding = 9) uniform texture2D u_dbgOutlineRt;
+layout(set = 0, binding = 9) uniform ANKI_RP texture2D u_dbgOutlineRt;
 #endif
 
-layout(push_constant, row_major, std430) uniform pc_
+layout(push_constant, row_major, std430) uniform b_pc
 {
 	UVec4 u_frameCountPad3;
 };
 
 layout(location = 0) in Vec2 in_uv;
-layout(location = 0) out Vec3 out_color;
+layout(location = 0) out ANKI_RP Vec3 out_color;
 
-Vec3 colorGrading(Vec3 color)
+ANKI_RP Vec3 colorGrading(ANKI_RP Vec3 color)
 {
-	const Vec3 LUT_SCALE = Vec3((F32(LUT_SIZE) - 1.0) / F32(LUT_SIZE));
-	const Vec3 LUT_OFFSET = Vec3(1.0 / (2.0 * F32(LUT_SIZE)));
+	const ANKI_RP Vec3 LUT_SCALE = Vec3((F32(LUT_SIZE) - 1.0) / F32(LUT_SIZE));
+	const ANKI_RP Vec3 LUT_OFFSET = Vec3(1.0 / (2.0 * F32(LUT_SIZE)));
 
 	color = min(color, Vec3(1.0));
-	const Vec3 lutCoords = color * LUT_SCALE + LUT_OFFSET;
+	const ANKI_RP Vec3 lutCoords = color * LUT_SCALE + LUT_OFFSET;
 	return textureLod(u_lut, u_trilinearRepeatSampler, lutCoords, 0.0).rgb;
 }
 
@@ -67,7 +67,7 @@ void main()
 	}
 
 #if BLOOM_ENABLED
-	const Vec3 bloom = textureLod(u_ppsBloomLfRt, u_linearAnyClampSampler, uv, 0.0).rgb;
+	const ANKI_RP Vec3 bloom = textureLod(u_ppsBloomLfRt, u_linearAnyClampSampler, uv, 0.0).rgb;
 	out_color += bloom;
 #endif
 
@@ -75,7 +75,7 @@ void main()
 
 #if BLUE_NOISE
 	const Vec2 bnUvw = Vec2(FB_SIZE) / Vec2(64.0) * uv;
-	Vec3 blueNoise = textureLod(u_blueNoise, u_trilinearRepeatSampler, bnUvw, 0.0).rgb;
+	ANKI_RP Vec3 blueNoise = textureLod(u_blueNoise, u_trilinearRepeatSampler, bnUvw, 0.0).rgb;
 	blueNoise = animateBlueNoise(blueNoise, u_frameCountPad3.x);
 	blueNoise = blueNoise * 2.0 - 1.0;
 	blueNoise = sign(blueNoise) * (1.0 - sqrt(1.0 - abs(blueNoise)));
@@ -84,7 +84,7 @@ void main()
 #endif
 
 #if DBG_ENABLED
-	const Vec4 dbg = textureLod(u_dbgOutlineRt, u_linearAnyClampSampler, uv, 0.0);
+	const ANKI_RP Vec4 dbg = textureLod(u_dbgOutlineRt, u_linearAnyClampSampler, uv, 0.0);
 	out_color = mix(out_color, dbg.rgb, dbg.a);
 #endif
 }

+ 2 - 2
AnKi/Shaders/Fsr.ankiprog

@@ -11,8 +11,8 @@
 #include <AnKi/Shaders/Functions.glsl>
 
 layout(set = 0, binding = 0) uniform sampler u_linearAnyClampSampler;
-layout(set = 0, binding = 1) uniform texture2D u_tex;
-layout(set = 0, binding = 2) writeonly uniform image2D u_outImg;
+layout(set = 0, binding = 1) uniform ANKI_RP texture2D u_tex;
+layout(set = 0, binding = 2) writeonly uniform ANKI_RP image2D u_outImg;
 
 layout(push_constant, std430) uniform b_pc
 {

+ 6 - 6
AnKi/Shaders/GBufferCommon.glsl

@@ -38,9 +38,9 @@ out gl_PerVertex
 
 #	if ANKI_PASS == PASS_GB
 layout(location = 0) out Vec2 out_uv;
-layout(location = 1) out Vec3 out_normal;
-layout(location = 2) out Vec3 out_tangent;
-layout(location = 3) out Vec3 out_bitangent;
+layout(location = 1) out ANKI_RP Vec3 out_normal;
+layout(location = 2) out ANKI_RP Vec3 out_tangent;
+layout(location = 3) out ANKI_RP Vec3 out_bitangent;
 
 #		if REALLY_USING_PARALLAX
 layout(location = 4) out F32 out_distFromTheCamera;
@@ -59,9 +59,9 @@ layout(location = 7) out Vec2 out_velocity;
 //
 #if defined(ANKI_FRAGMENT_SHADER) && ANKI_PASS == PASS_GB
 layout(location = 0) in Vec2 in_uv;
-layout(location = 1) in Vec3 in_normal;
-layout(location = 2) in Vec3 in_tangent;
-layout(location = 3) in Vec3 in_bitangent;
+layout(location = 1) in ANKI_RP Vec3 in_normal;
+layout(location = 2) in ANKI_RP Vec3 in_tangent;
+layout(location = 3) in ANKI_RP Vec3 in_bitangent;
 
 #	if REALLY_USING_PARALLAX
 layout(location = 4) in F32 in_distFromTheCamera;

+ 3 - 3
AnKi/Shaders/MotionBlur.glsl

@@ -8,8 +8,8 @@
 #include <AnKi/Shaders/Common.glsl>
 
 // Perform motion blur.
-Vec3 motionBlur(texture2D motionVectorsRt, sampler motionVectorsRtSampler, texture2D toBlurRt, Vec2 toBlurRtSize,
-				sampler toBlurRtSampler, Vec2 uv, U32 maxSamples)
+Vec3 motionBlur(texture2D motionVectorsRt, sampler motionVectorsRtSampler, ANKI_RP texture2D toBlurRt,
+				Vec2 toBlurRtSize, sampler toBlurRtSampler, Vec2 uv, U32 maxSamples)
 {
 	// Compute velocity. Get the max velocity around the curent sample to avoid outlines. TAA's result and the motion
 	// vectors RT do not quite overlap
@@ -44,7 +44,7 @@ Vec3 motionBlur(texture2D motionVectorsRt, sampler motionVectorsRtSampler, textu
 	sampleCountf = round(sampleCountf);
 
 	// Sample
-	Vec3 outColor = textureLod(toBlurRt, toBlurRtSampler, uv, 0.0).rgb;
+	ANKI_RP Vec3 outColor = textureLod(toBlurRt, toBlurRtSampler, uv, 0.0).rgb;
 	ANKI_LOOP for(F32 s = 1.0; s < sampleCountf; s += 1.0)
 	{
 		const F32 f = s / sampleCountf;