Selaa lähdekoodia

Removing the workaround for glsang issue 304

Panagiotis Christopoulos Charitos 9 vuotta sitten
vanhempi
sitoutus
23ed446349
5 muutettua tiedostoa jossa 7 lisäystä ja 44 poistoa
  1. 2 6
      shaders/FsCommonFrag.glsl
  2. 3 9
      shaders/Is.frag.glsl
  3. 0 20
      shaders/IsFsCommon.glsl
  4. 1 8
      shaders/LfSpritePass.vert.glsl
  5. 1 1
      thirdparty

+ 2 - 6
shaders/FsCommonFrag.glsl

@@ -147,9 +147,7 @@ vec3 computeLightColor(vec3 diffCol)
 	uint count = u_lightIndices[idxOffset++];
 	while(count-- != 0)
 	{
-		PointLight light;
-		COPY_POINT_LIGHT(u_pointLights[u_lightIndices[idxOffset]], light);
-		++idxOffset;
+		PointLight light = u_pointLights[u_lightIndices[idxOffset++]];
 
 		vec3 diffC = computeDiffuseColor(diffCol, light.diffuseColorShadowmapId.rgb);
 
@@ -175,9 +173,7 @@ vec3 computeLightColor(vec3 diffCol)
 	count = u_lightIndices[idxOffset++];
 	while(count-- != 0)
 	{
-		SpotLight light;
-		COPY_SPOT_LIGHT(u_spotLights[u_lightIndices[idxOffset]], light);
-		++idxOffset;
+		SpotLight light = u_spotLights[u_lightIndices[idxOffset++]];
 
 		vec3 diffC = computeDiffuseColor(diffCol, light.diffuseColorShadowmapId.rgb);
 

+ 3 - 9
shaders/Is.frag.glsl

@@ -75,9 +75,7 @@ void readIndirect(in uint idxOffset,
 	uint count = u_lightIndices[idxOffset++];
 	while(count-- != 0)
 	{
-		ReflectionProbe probe;
-		COPY_REFLECTION_PROBE(u_reflectionProbes[u_lightIndices[idxOffset]], probe);
-		++idxOffset;
+		ReflectionProbe probe = u_reflectionProbes[u_lightIndices[idxOffset++]];
 
 		float R2 = probe.positionRadiusSq.w;
 		vec3 center = probe.positionRadiusSq.xyz;
@@ -154,9 +152,7 @@ void main()
 	uint count = u_lightIndices[idxOffset++];
 	while(count-- != 0)
 	{
-		PointLight light;
-		COPY_POINT_LIGHT(u_pointLights[u_lightIndices[idxOffset]], light);
-		++idxOffset;
+		PointLight light = u_pointLights[u_lightIndices[idxOffset++]];
 
 		LIGHTING_COMMON_BRDF();
 
@@ -177,9 +173,7 @@ void main()
 	count = u_lightIndices[idxOffset++];
 	while(count-- != 0)
 	{
-		SpotLight light;
-		COPY_SPOT_LIGHT(u_spotLights[u_lightIndices[idxOffset]], light);
-		++idxOffset;
+		SpotLight light = u_spotLights[u_lightIndices[idxOffset++]];
 
 		LIGHTING_COMMON_BRDF();
 

+ 0 - 20
shaders/IsFsCommon.glsl

@@ -27,12 +27,6 @@ struct PointLight
 	vec4 specularColorTexId; // xyz: spec color, w: diffuse tex ID
 };
 
-// WORKAROUND: See glslang issue 304
-#define COPY_POINT_LIGHT(src_, dst_)                                                                                   \
-	dst_.posRadius = src_.posRadius;                                                                                   \
-	dst_.diffuseColorShadowmapId = src_.diffuseColorShadowmapId;                                                       \
-	dst_.specularColorTexId = src_.specularColorTexId
-
 // Spot light
 struct SpotLight
 {
@@ -44,15 +38,6 @@ struct SpotLight
 	mat4 texProjectionMat;
 };
 
-// WORKAROUND: See glslang issue 304
-#define COPY_SPOT_LIGHT(src_, dst_)                                                                                    \
-	dst_.posRadius = src_.posRadius;                                                                                   \
-	dst_.diffuseColorShadowmapId = src_.diffuseColorShadowmapId;                                                       \
-	dst_.specularColorTexId = src_.specularColorTexId;                                                                 \
-	dst_.lightDir = src_.lightDir;                                                                                     \
-	dst_.outerCosInnerCos = src_.outerCosInnerCos;                                                                     \
-	dst_.texProjectionMat = src_.texProjectionMat
-
 // Representation of a reflection probe
 struct ReflectionProbe
 {
@@ -63,11 +48,6 @@ struct ReflectionProbe
 	vec4 cubemapIndexPad3;
 };
 
-// WORKAROUND: See glslang issue 304
-#define COPY_REFLECTION_PROBE(src_, dst_)                                                                              \
-	dst_.positionRadiusSq = src_.positionRadiusSq;                                                                     \
-	dst_.cubemapIndexPad3.x = src_.cubemapIndexPad3.x
-
 layout(ANKI_UBO_BINDING(LIGHT_SET, LIGHT_UBO_BINDING), std140, row_major) uniform u0_
 {
 	LightingUniforms u_lightingUniforms;

+ 1 - 8
shaders/LfSpritePass.vert.glsl

@@ -15,12 +15,6 @@ struct Sprite
 	vec4 depthPad3;
 };
 
-// WORKAROUND: See glslang issue 304
-#define COPY_SPRITE(src_, dst_)                                                                                        \
-	dst_.posScale = src_.posScale;                                                                                     \
-	dst_.color = src_.color;                                                                                           \
-	dst_.depthPad3.x = src_.depthPad3.x
-
 // The block contains data for all flares
 layout(std140, ANKI_UBO_BINDING(0, 0)) uniform _blk
 {
@@ -41,8 +35,7 @@ void main()
 
 	vec2 position = POSITIONS[gl_VertexID];
 
-	Sprite sprite;
-	COPY_SPRITE(u_sprites[gl_InstanceID], sprite);
+	Sprite sprite = u_sprites[gl_InstanceID];
 
 	// Write tex coords of the 2D array texture
 	out_uv = vec3((position * 0.5) + 0.5, sprite.depthPad3.x);

+ 1 - 1
thirdparty

@@ -1 +1 @@
-Subproject commit fbe40db19e871634fb9b526ac861559493d99dcd
+Subproject commit 02151a1c529bc76d28e23b0d6e471acfce1485d3