Browse Source

Fixing bugs. Restarting tessellation work

Panagiotis Christopoulos Charitos 11 years ago
parent
commit
71e63bf43a

+ 0 - 7
CMakeLists.txt

@@ -83,13 +83,6 @@ endif()
 
 
 set(ANKI_WINDOW_BACKEND "${_WIN_BACKEND}" CACHE STRING "The window backend (GLXX11 or EGLX11 or EGLFBDEV or ANDROID or SDL or DUMMY)")
 set(ANKI_WINDOW_BACKEND "${_WIN_BACKEND}" CACHE STRING "The window backend (GLXX11 or EGLX11 or EGLFBDEV or ANDROID or SDL or DUMMY)")
 
 
-option(ANKI_GCC_TO_STRING_WORKAROUND "Enable workaround for C++11 GCC bug" OFF)
-if(ANKI_GCC_TO_STRING_WORKAROUND)
-	set(_ANKI_GCC_TO_STRING_WORKAROUND 1)
-else()
-	set(_ANKI_GCC_TO_STRING_WORKAROUND 0)
-endif()
-
 # Extra directories
 # Extra directories
 set(ANKI_EXTRA_INCLUDE_DIRS CACHE STRING "Some extra include paths (Needed for some weird builds)")
 set(ANKI_EXTRA_INCLUDE_DIRS CACHE STRING "Some extra include paths (Needed for some weird builds)")
 set(ANKI_EXTRA_LIB_DIRS CACHE STRING "Some extra lib paths (Needed for some weird builds)")
 set(ANKI_EXTRA_LIB_DIRS CACHE STRING "Some extra lib paths (Needed for some weird builds)")

+ 0 - 33
include/anki/Config.h.cmake

@@ -161,37 +161,4 @@
 
 
 /// @}
 /// @}
 
 
-// Workaround some GCC C++11 problems
-#if ${_ANKI_GCC_TO_STRING_WORKAROUND}
-#	include <sstream>
-
-namespace std {
-
-template<typename T>
-std::string to_string(const T x)
-{
-	stringstream ss;
-	ss << x;
-	return ss.str();
-}
-
-inline float stof(const string& str)
-{
-	stringstream ss(str);
-	float f;
-	ss >> f;
-	return f;
-}
-
-inline int stoi(const string& str)
-{
-	stringstream ss(str);
-	int i;
-	ss >> i;
-	return i;
-}
-
-} // end namespace std
-#endif
-
 #endif
 #endif

+ 1 - 1
shaders/IsCommon.glsl

@@ -51,7 +51,7 @@ struct Lights
 };
 };
 
 
 // Common uniforms between lights
 // Common uniforms between lights
-layout(std140, row_major, binding = 0) readonly buffer commonBlock
+layout(std140, row_major, binding = 0) uniform commonBlock
 {
 {
 	vec4 uProjectionParams;
 	vec4 uProjectionParams;
 	vec4 uSceneAmbientColor;
 	vec4 uSceneAmbientColor;

+ 44 - 44
shaders/MsCommonTessc.glsl

@@ -8,24 +8,24 @@
 layout(vertices = 3) out;
 layout(vertices = 3) out;
 
 
 #define IID gl_InvocationID
 #define IID gl_InvocationID
+#define IN_POS(i_) gl_in[i_].gl_Position
+#define OUT_POS(i_) gl_out[i_].gl_Position
 
 
 // In
 // In
-in vec3 vPosition[];
-in vec2 vTexCoords[];
-in mediump vec3 vNormal[];
+layout(location = 0) in vec2 inTexCoords[];
+layout(location = 1) in mediump vec3 inNormal[];
 #if PASS_COLOR
 #if PASS_COLOR
-in mediump vec4 vTangent[];
+layout(location = 2) in mediump vec4 inTangent[];
 #endif
 #endif
 #if INSTANCE_ID_FRAGMENT_SHADER
 #if INSTANCE_ID_FRAGMENT_SHADER
-flat in uint vInstanceId[];
+layout(location = 3) flat in uint inInstanceId[];
 #endif
 #endif
 
 
 // Out
 // Out
-out vec3 tcPosition[];
-out vec2 tcTexCoord[];
-out vec3 tcNormal[];
+layout(location = 0) out vec2 outTexCoord[];
+layout(location = 1) out vec3 outNormal[];
 #if PASS_COLOR
 #if PASS_COLOR
-out vec4 tcTangent[];
+layout(location = 2) out vec4 outTangent[];
 #endif
 #endif
 
 
 #if INSTANCE_ID_FRAGMENT_SHADER
 #if INSTANCE_ID_FRAGMENT_SHADER
@@ -46,9 +46,9 @@ struct PNPatch
 	vec3 pos111;
 	vec3 pos111;
 };
 };
 
 
-#define pos030 tcPosition[0]
-#define pos003 tcPosition[1]
-#define pos300 tcPosition[2]
+#define pos030 OUT_POS(0)
+#define pos003 OUT_POS(1)
+#define pos300 OUT_POS(2)
 
 
 struct PhongPatch
 struct PhongPatch
 {
 {
@@ -74,9 +74,9 @@ vec3 projectToPlane(vec3 point, vec3 planePoint, vec3 planeNormal)
 void calcPositions()
 void calcPositions()
 {
 {
 	// The original vertices stay the same
 	// The original vertices stay the same
-	pos030 = vPosition[0];
-	pos003 = vPosition[1];
-	pos300 = vPosition[2];
+	pos030 = IN_POS(0);
+	pos003 = IN_POS(1);
+	pos300 = IN_POS(2);
 
 
 	// edges are names according to the opposing vertex
 	// edges are names according to the opposing vertex
 	vec3 edgeB300 = pos003 - pos030;
 	vec3 edgeB300 = pos003 - pos030;
@@ -92,17 +92,17 @@ void calcPositions()
 	pnPatch.pos120 = pos300 + edgeB003 * 2.0 / 3.0;
 	pnPatch.pos120 = pos300 + edgeB003 * 2.0 / 3.0;
 
 
 	pnPatch.pos021 = projectToPlane(
 	pnPatch.pos021 = projectToPlane(
-		pnPatch.pos021, pos030, tcNormal[0]);
+		pnPatch.pos021, pos030, outNormal[0]);
 	pnPatch.pos012 = projectToPlane(
 	pnPatch.pos012 = projectToPlane(
-		pnPatch.pos012, pos003, tcNormal[1]);
+		pnPatch.pos012, pos003, outNormal[1]);
 	pnPatch.pos102 = projectToPlane(
 	pnPatch.pos102 = projectToPlane(
-		pnPatch.pos102, pos003, tcNormal[1]);
+		pnPatch.pos102, pos003, outNormal[1]);
 	pnPatch.pos201 = projectToPlane(
 	pnPatch.pos201 = projectToPlane(
-		pnPatch.pos201, pos300, tcNormal[2]);
+		pnPatch.pos201, pos300, outNormal[2]);
 	pnPatch.pos210 = projectToPlane(
 	pnPatch.pos210 = projectToPlane(
-		pnPatch.pos210, pos300, tcNormal[2]);
+		pnPatch.pos210, pos300, outNormal[2]);
 	pnPatch.pos120 = projectToPlane(
 	pnPatch.pos120 = projectToPlane(
-		pnPatch.pos120, pos030, tcNormal[0]);
+		pnPatch.pos120, pos030, outNormal[0]);
 
 
 	// Handle the center
 	// Handle the center
 	vec3 center = (pos003 + pos030 + pos300) / 3.0;
 	vec3 center = (pos003 + pos030 + pos300) / 3.0;
@@ -161,7 +161,7 @@ void setSilhouetteTessLevels(in mat3 normalMat, in float maxTessLevel)
 	vec3 nv[3];
 	vec3 nv[3];
 	for(int i = 0; i < 3; i++)
 	for(int i = 0; i < 3; i++)
 	{
 	{
-		nv[i] = normalMat * vNormal[i];
+		nv[i] = normalMat * inNormal[i];
 	}
 	}
 
 
 	gl_TessLevelOuter[0] = calcEdgeTessLevel(nv[1], nv[2], maxTessLevel);
 	gl_TessLevelOuter[0] = calcEdgeTessLevel(nv[1], nv[2], maxTessLevel);
@@ -194,7 +194,7 @@ bool isFaceVisible(in mat4 mvp)
 	vec2 clip[3];
 	vec2 clip[3];
 	for(int i = 0 ; i < 3 ; i++) 
 	for(int i = 0 ; i < 3 ; i++) 
 	{
 	{
-		vec4 v = mvp * vec4(vPosition[i], 1.0);
+		vec4 v = mvp * vec4(IN_POS(i), 1.0);
 		clip[i] = v.xy / abs(v.w);
 		clip[i] = v.xy / abs(v.w);
 	}
 	}
 
 
@@ -204,8 +204,8 @@ bool isFaceVisible(in mat4 mvp)
 
 
 float calcPhongTerm(int ivId, int i, vec3 q)
 float calcPhongTerm(int ivId, int i, vec3 q)
 {
 {
-	vec3 qMinusP = q - vPosition[i];
-	return q[ivId] - dot(qMinusP, vNormal[i]) * vNormal[i][ivId];
+	vec3 qMinusP = q - IN_POS(i);
+	return q[ivId] - dot(qMinusP, inNormal[i]) * inNormal[i][ivId];
 }
 }
 
 
 // This function is part of the point-normal tessellation method
 // This function is part of the point-normal tessellation method
@@ -218,7 +218,7 @@ void tessellatePNPositionNormalTangentTexCoord(
 	float tessLevel = 0.0;
 	float tessLevel = 0.0;
 
 
 	// Calculate the face normal in view space
 	// Calculate the face normal in view space
-	vec3 faceNorm = calcFaceNormal(vPosition[0], vPosition[1], vPosition[2]);
+	vec3 faceNorm = calcFaceNormal(IN_POS(0), IN_POS(1), IN_POS(2));
 	faceNorm = (normalMat * faceNorm);
 	faceNorm = (normalMat * faceNorm);
 
 
 	if(faceNorm.z >= 0.0)
 	if(faceNorm.z >= 0.0)
@@ -227,10 +227,10 @@ void tessellatePNPositionNormalTangentTexCoord(
 
 
 		for(int i = 0 ; i < 3 ; i++) 
 		for(int i = 0 ; i < 3 ; i++) 
 		{		
 		{		
-			tcTexCoord[i] = vTexCoords[i];
-			tcNormal[i] = vNormal[i];
+			outTexCoord[i] = inTexCoords[i];
+			outNormal[i] = inNormal[i];
 #if PASS_COLOR
 #if PASS_COLOR
-			tcTangent[i] = vTangent[i];
+			outTangent[i] = inTangent[i];
 #endif
 #endif
 		}
 		}
 
 
@@ -266,24 +266,24 @@ void tessellatePhongPositionNormalTangentTexCoord(
 		}
 		}
 	}
 	}
 
 
-	tcPosition[IID] = vPosition[IID]; // Do that here to trick the barrier
+	OUT_POS(IID) = IN_POS(IID); // Do that here to trick the barrier
 
 
 	barrier();
 	barrier();
 
 
 	if(gl_TessLevelOuter[0] > 0.0)
 	if(gl_TessLevelOuter[0] > 0.0)
 	{
 	{
-		tcTexCoord[IID] = vTexCoords[IID];
-		tcNormal[IID] = vNormal[IID];
+		outTexCoord[IID] = inTexCoords[IID];
+		outNormal[IID] = inNormal[IID];
 #if PASS_COLOR
 #if PASS_COLOR
-		tcTangent[IID] = vTangent[IID];
+		outTangent[IID] = inTangent[IID];
 #endif
 #endif
 
 
-		phongPatch.terms[IID][0] = calcPhongTerm(IID, 0, vPosition[1]) 
-			+ calcPhongTerm(IID, 1, vPosition[0]);
-		phongPatch.terms[IID][1] = calcPhongTerm(IID, 1, vPosition[2]) 
-			+ calcPhongTerm(IID, 2, vPosition[1]);
-		phongPatch.terms[IID][2] = calcPhongTerm(IID, 2, vPosition[0]) 
-			+ calcPhongTerm(IID, 0, vPosition[2]);
+		phongPatch.terms[IID][0] = calcPhongTerm(IID, 0, IN_POS(1)) 
+			+ calcPhongTerm(IID, 1, IN_POS(0));
+		phongPatch.terms[IID][1] = calcPhongTerm(IID, 1, IN_POS(2)) 
+			+ calcPhongTerm(IID, 2, IN_POS(1));
+		phongPatch.terms[IID][2] = calcPhongTerm(IID, 2, IN_POS(0)) 
+			+ calcPhongTerm(IID, 0, IN_POS(2));
 	}
 	}
 }
 }
 
 
@@ -300,7 +300,7 @@ void tessellateDispMapPositionNormalTangentTexCoord(
 			setSilhouetteTessLevels(normalMat, maxTessLevel);
 			setSilhouetteTessLevels(normalMat, maxTessLevel);
 
 
 #if INSTANCE_ID_FRAGMENT_SHADER
 #if INSTANCE_ID_FRAGMENT_SHADER
-			commonPatch.instanceId = vInstanceId[0];
+			commonPatch.instanceId = inInstanceId[0];
 #endif
 #endif
 		}
 		}
 		else
 		else
@@ -309,10 +309,10 @@ void tessellateDispMapPositionNormalTangentTexCoord(
 		}
 		}
 	}
 	}
 
 
-	tcPosition[IID] = vPosition[IID];
-	tcTexCoord[IID] = vTexCoords[IID];
-	tcNormal[IID] = vNormal[IID];
+	OUT_POS(IID) = IN_POS(IID);
+	outTexCoord[IID] = inTexCoords[IID];
+	outNormal[IID] = inNormal[IID];
 #if PASS_COLOR
 #if PASS_COLOR
-	tcTangent[IID] = vTangent[IID];
+	outTangent[IID] = inTangent[IID];
 #endif
 #endif
 }
 }

+ 27 - 26
shaders/MsCommonTesse.glsl

@@ -16,9 +16,11 @@ struct PNPatch
 	vec3 pos111;
 	vec3 pos111;
 };
 };
 
 
-#define pos030 tcPosition[0]
-#define pos003 tcPosition[1]
-#define pos300 tcPosition[2]
+#define IN_POS(i_) gl_in[i_].gl_Position
+
+#define pos030 IN_POS(0)
+#define pos003 IN_POS(1)
+#define pos300 IN_POS(2)
 
 
 struct PhongPatch
 struct PhongPatch
 {
 {
@@ -38,18 +40,17 @@ in patch PhongPatch phongPatch;
 in patch CommonPatch commonPatch;
 in patch CommonPatch commonPatch;
 #endif
 #endif
 
 
-in vec3 tcPosition[];
-in vec2 tcTexCoord[];
-in vec3 tcNormal[];
+layout(location = 0) in vec2 inTexCoord[];
+layout(location = 1) in vec3 inNormal[];
 #if PASS_COLOR
 #if PASS_COLOR
-in vec4 tcTangent[];
+layout(location = 2) in vec4 inTangent[];
 #endif
 #endif
 
 
 // Varyings out
 // Varyings out
-out highp vec2 teTexCoords;
+layout(location = 0) out highp vec2 outTexCoords;
 #if PASS_COLOR
 #if PASS_COLOR
-out mediump vec3 teNormal;
-out mediump vec4 teTangent;
+layout(location = 1) out mediump vec3 outNormal;
+layout(location = 2) out mediump vec4 outTangent;
 #endif
 #endif
 
 
 #define INTERPOLATE(x_) (x_[0] * gl_TessCoord.x + x_[1] * gl_TessCoord.y + x_[2] * gl_TessCoord.z)
 #define INTERPOLATE(x_) (x_[0] * gl_TessCoord.x + x_[1] * gl_TessCoord.y + x_[2] * gl_TessCoord.z)
@@ -59,12 +60,12 @@ out mediump vec4 teTangent;
 void tessellatePNPositionNormalTangentTexCoord(in mat4 mvp, in mat3 normalMat)
 void tessellatePNPositionNormalTangentTexCoord(in mat4 mvp, in mat3 normalMat)
 {
 {
 #if PASS_COLOR
 #if PASS_COLOR
-	teNormal = normalize(normalMat * INTERPOLATE(tcNormal));
-	teTangent = INTERPOLATE(tcTangent);
-	teTangent.xyz = normalize(normalMat * teTangent.xyz);
+	outNormal = normalize(normalMat * INTERPOLATE(inNormal));
+	outTangent = INTERPOLATE(inTangent);
+	outTangent.xyz = normalize(normalMat * outTangent.xyz);
 #endif
 #endif
 
 
-	teTexCoords = INTERPOLATE(tcTexCoord);
+	outTexCoords = INTERPOLATE(inTexCoord);
 
 
 	float u = gl_TessCoord.x;
 	float u = gl_TessCoord.x;
 	float v = gl_TessCoord.y;
 	float v = gl_TessCoord.y;
@@ -97,12 +98,12 @@ void tessellatePhongPositionNormalTangentTexCoord(
 	in mat4 mvp, in mat3 normalMat)
 	in mat4 mvp, in mat3 normalMat)
 {
 {
 #if PASS_COLOR
 #if PASS_COLOR
-	teNormal = normalize(normalMat * INTERPOLATE(tcNormal));
-	teTangent = INTERPOLATE(tcTangent);
-	teTangent.xyz = normalize(normalMat * teTangent.xyz);
+	outNormal = normalize(normalMat * INTERPOLATE(inNormal));
+	outTangent = INTERPOLATE(inTangent);
+	outTangent.xyz = normalize(normalMat * outTangent.xyz);
 #endif
 #endif
 
 
-	teTexCoords = INTERPOLATE(tcTexCoord);
+	outTexCoords = INTERPOLATE(inTexCoord);
 
 
 	// interpolated position
 	// interpolated position
 	vec3 barPos = INTERPOLATE(tcPosition);
 	vec3 barPos = INTERPOLATE(tcPosition);
@@ -132,8 +133,8 @@ void tessellatePhongPositionNormalTangentTexCoord(
 		 + gl_TessCoord[1] * gl_TessCoord[2] * termJK
 		 + gl_TessCoord[1] * gl_TessCoord[2] * termJK
 		 + gl_TessCoord[2] * gl_TessCoord[0] * termIK;
 		 + gl_TessCoord[2] * gl_TessCoord[0] * termIK;
 
 
-	float uTessAlpha = 1.0;
-	vec3 finalPos = (1.0 - uTessAlpha) * barPos + uTessAlpha * phongPos;
+	float tessAlpha = 1.0;
+	vec3 finalPos = (1.0 - tessAlpha) * barPos + tessAlpha * phongPos;
 	gl_Position = mvp * vec4(finalPos, 1.0);
 	gl_Position = mvp * vec4(finalPos, 1.0);
 }
 }
 
 
@@ -141,16 +142,16 @@ void tessellatePhongPositionNormalTangentTexCoord(
 void tessellateDispMapPositionNormalTangentTexCoord(
 void tessellateDispMapPositionNormalTangentTexCoord(
 	in mat4 mvp, in mat3 normalMat, in sampler2D dispMap)
 	in mat4 mvp, in mat3 normalMat, in sampler2D dispMap)
 {
 {
-	vec3 norm = INTERPOLATE(tcNormal);
+	vec3 norm = INTERPOLATE(inNormal);
 #if PASS_COLOR
 #if PASS_COLOR
-	teNormal = normalize(normalMat * norm);
-	teTangent = INTERPOLATE(tcTangent);
-	teTangent.xyz = normalize(normalMat * teTangent.xyz);
+	outNormal = normalize(normalMat * norm);
+	outTangent = INTERPOLATE(inTangent);
+	outTangent.xyz = normalize(normalMat * outTangent.xyz);
 #endif
 #endif
 
 
-	teTexCoords = INTERPOLATE(tcTexCoord);
+	outTexCoords = INTERPOLATE(inTexCoord);
 
 
-	float height = texture(dispMap, teTexCoords).r;
+	float height = texture(dispMap, outTexCoords).r;
 	height = height * 0.7 - 0.35;
 	height = height * 0.7 - 0.35;
 
 
 	vec3 pos = INTERPOLATE(tcPosition) + norm * height;
 	vec3 pos = INTERPOLATE(tcPosition) + norm * height;

+ 1 - 1
shaders/PpsHdr.frag.glsl

@@ -10,7 +10,7 @@
 
 
 layout(binding = 0) uniform lowp sampler2D tex; ///< Its the IS RT
 layout(binding = 0) uniform lowp sampler2D tex; ///< Its the IS RT
 
 
-layout(std140) readonly buffer commonBlock
+layout(std140) uniform commonBlock
 {
 {
 	vec4 inExposureComp;
 	vec4 inExposureComp;
 };
 };

+ 1 - 1
shaders/PpsLfSpritePass.vert.glsl

@@ -14,7 +14,7 @@ struct Flare
 };
 };
 
 
 // The block contains data for all flares
 // The block contains data for all flares
-layout(std140) readonly buffer bFlares
+layout(std140) uniform bFlares
 {
 {
 	Flare uFlares[MAX_FLARES];
 	Flare uFlares[MAX_FLARES];
 };
 };

+ 1 - 1
src/renderer/Hdr.cpp

@@ -59,7 +59,7 @@ void Hdr::initInternal(const ConfigSet& initializer)
 	GlDevice& gl = getGlDevice();
 	GlDevice& gl = getGlDevice();
 	GlCommandBufferHandle jobs(&gl);
 	GlCommandBufferHandle jobs(&gl);
 
 
-	m_commonBuff = GlBufferHandle(jobs, GL_SHADER_STORAGE_BUFFER, 
+	m_commonBuff = GlBufferHandle(jobs, GL_UNIFORM_BUFFER, 
 		sizeof(Vec4), GL_DYNAMIC_STORAGE_BIT);
 		sizeof(Vec4), GL_DYNAMIC_STORAGE_BIT);
 
 
 	updateDefaultBlock(jobs);
 	updateDefaultBlock(jobs);

+ 1 - 1
src/renderer/Is.cpp

@@ -493,7 +493,7 @@ void Is::initInternal(const ConfigSet& config)
 	//
 	//
 	const GLbitfield bufferBits = GL_DYNAMIC_STORAGE_BIT;
 	const GLbitfield bufferBits = GL_DYNAMIC_STORAGE_BIT;
 
 
-	m_commonBuff = GlBufferHandle(cmdBuff, GL_SHADER_STORAGE_BUFFER, 
+	m_commonBuff = GlBufferHandle(cmdBuff, GL_UNIFORM_BUFFER, 
 		sizeof(shader::CommonUniforms), bufferBits);
 		sizeof(shader::CommonUniforms), bufferBits);
 
 
 	m_lightsBuff = GlBufferHandle(cmdBuff, GL_SHADER_STORAGE_BUFFER, 
 	m_lightsBuff = GlBufferHandle(cmdBuff, GL_SHADER_STORAGE_BUFFER, 

+ 1 - 1
src/renderer/Lf.cpp

@@ -116,7 +116,7 @@ void Lf::initInternal(const ConfigSet& config)
 
 
 	// Init buffer
 	// Init buffer
 	m_flareDataBuff = GlBufferHandle(
 	m_flareDataBuff = GlBufferHandle(
-		cmdBuff, GL_SHADER_STORAGE_BUFFER, blockSize, GL_DYNAMIC_STORAGE_BIT);
+		cmdBuff, GL_UNIFORM_BUFFER, blockSize, GL_DYNAMIC_STORAGE_BIT);
 
 
 	// Create the render target
 	// Create the render target
 	m_r->createRenderTarget(m_r->getPps().getHdr()._getRt().getWidth(), 
 	m_r->createRenderTarget(m_r->getPps().getHdr()._getRt().getWidth(), 

+ 21 - 21
src/resource/MaterialProgramCreator.cpp

@@ -41,34 +41,34 @@ static void getShaderInfo(
 	GLbitfield& bit,
 	GLbitfield& bit,
 	U& idx)
 	U& idx)
 {
 {
-	if(str == "vert"_cstr)
+	if(str == "vert")
 	{
 	{
 		type = GL_VERTEX_SHADER;
 		type = GL_VERTEX_SHADER;
 		bit = GL_VERTEX_SHADER_BIT;
 		bit = GL_VERTEX_SHADER_BIT;
 		idx = 0;
 		idx = 0;
 	}
 	}
-	else if(str == "tesc"_cstr)
+	else if(str == "tesc")
 	{
 	{
 		type = GL_TESS_CONTROL_SHADER;
 		type = GL_TESS_CONTROL_SHADER;
 		bit = GL_TESS_CONTROL_SHADER_BIT;
 		bit = GL_TESS_CONTROL_SHADER_BIT;
 		idx = 1;
 		idx = 1;
 	}
 	}
-	else if(str == "tese"_cstr)
+	else if(str == "tese")
 	{
 	{
 		type = GL_TESS_EVALUATION_SHADER;
 		type = GL_TESS_EVALUATION_SHADER;
 		bit = GL_TESS_EVALUATION_SHADER_BIT;
 		bit = GL_TESS_EVALUATION_SHADER_BIT;
 		idx = 2;
 		idx = 2;
 	}
 	}
-	else if(str == "geom"_cstr)
+	else if(str == "geom")
 	{
 	{
 		type = GL_GEOMETRY_SHADER;
 		type = GL_GEOMETRY_SHADER;
 		bit = GL_GEOMETRY_SHADER_BIT;
 		bit = GL_GEOMETRY_SHADER_BIT;
 		idx = 3;
 		idx = 3;
 	}
 	}
-	else if(str == "frag"_cstr)
+	else if(str == "frag")
 	{
 	{
-		type = GL_GEOMETRY_SHADER;
-		bit = GL_GEOMETRY_SHADER_BIT;
+		type = GL_FRAGMENT_SHADER;
+		bit = GL_FRAGMENT_SHADER_BIT;
 		idx = 4;
 		idx = 4;
 	}
 	}
 	else
 	else
@@ -101,12 +101,12 @@ void MaterialProgramCreator::parseProgramsTag(const XmlElement& el)
 	//
 	//
 	// First gather all the inputs
 	// First gather all the inputs
 	//
 	//
-	XmlElement programEl = el.getChildElement("program"_cstr);
+	XmlElement programEl = el.getChildElement("program");
 	do
 	do
 	{
 	{
 		parseInputsTag(programEl);
 		parseInputsTag(programEl);
 
 
-		programEl = programEl.getNextSiblingElement("program"_cstr);
+		programEl = programEl.getNextSiblingElement("program");
 	} while(programEl);
 	} while(programEl);
 
 
 	// Sort them by name to decrease the change of creating unique shaders
 	// Sort them by name to decrease the change of creating unique shaders
@@ -115,12 +115,12 @@ void MaterialProgramCreator::parseProgramsTag(const XmlElement& el)
 	//
 	//
 	// Then parse the includes, operations and other parts of the program
 	// Then parse the includes, operations and other parts of the program
 	//
 	//
-	programEl = el.getChildElement("program"_cstr);
+	programEl = el.getChildElement("program");
 	do
 	do
 	{
 	{
 		parseProgramTag(programEl);
 		parseProgramTag(programEl);
 
 
-		programEl = programEl.getNextSiblingElement("program"_cstr);
+		programEl = programEl.getNextSiblingElement("program");
 	} while(programEl);
 	} while(programEl);
 
 
 	//
 	//
@@ -143,7 +143,7 @@ void MaterialProgramCreator::parseProgramTag(
 	const XmlElement& programEl)
 	const XmlElement& programEl)
 {
 {
 	// <type>
 	// <type>
-	CString type = programEl.getChildElement("type"_cstr).getText();
+	CString type = programEl.getChildElement("type").getText();
 	GLbitfield glshaderbit;
 	GLbitfield glshaderbit;
 	GLenum glshader;
 	GLenum glshader;
 	U shaderidx;
 	U shaderidx;
@@ -151,7 +151,7 @@ void MaterialProgramCreator::parseProgramTag(
 
 
 	m_source[shaderidx] = MPStringList(m_alloc);
 	m_source[shaderidx] = MPStringList(m_alloc);
 	auto& lines = m_source[shaderidx];
 	auto& lines = m_source[shaderidx];
-	lines.push_back(ANKI_STRL("#pragma anki type "_cstr) + type);
+	lines.push_back(ANKI_STRL("#pragma anki type ") + type);
 
 
 	if(glshader == GL_TESS_CONTROL_SHADER 
 	if(glshader == GL_TESS_CONTROL_SHADER 
 		|| glshader == GL_TESS_EVALUATION_SHADER)
 		|| glshader == GL_TESS_EVALUATION_SHADER)
@@ -160,27 +160,27 @@ void MaterialProgramCreator::parseProgramTag(
 	}
 	}
 
 
 	// <includes></includes>
 	// <includes></includes>
-	XmlElement includesEl = programEl.getChildElement("includes"_cstr);
-	XmlElement includeEl = includesEl.getChildElement("include"_cstr);
+	XmlElement includesEl = programEl.getChildElement("includes");
+	XmlElement includeEl = includesEl.getChildElement("include");
 
 
 	do
 	do
 	{
 	{
 		MPString fname(includeEl.getText(), m_alloc);
 		MPString fname(includeEl.getText(), m_alloc);
 		lines.push_back(
 		lines.push_back(
-			ANKI_STRL("#pragma anki include \""_cstr) + fname + "\""_cstr);
+			ANKI_STRL("#pragma anki include \"") + fname + "\"");
 
 
-		includeEl = includeEl.getNextSiblingElement("include"_cstr);
+		includeEl = includeEl.getNextSiblingElement("include");
 	} while(includeEl);
 	} while(includeEl);
 
 
 	// Inputs
 	// Inputs
 
 
 	// Block
 	// Block
 	if(m_uniformBlock.size() > 0 
 	if(m_uniformBlock.size() > 0 
-		&& (m_uniformBlockReferencedMask | glshaderbit))
+		&& (m_uniformBlockReferencedMask & glshaderbit))
 	{
 	{
 		// TODO Make block SSB when driver bug is fixed
 		// TODO Make block SSB when driver bug is fixed
 		lines.push_back(ANKI_STRL(
 		lines.push_back(ANKI_STRL(
-			"\nlayout(binding = 0, std140) uniform bDefaultBlock\n{"_cstr));
+			"\nlayout(binding = 0, std140) uniform bDefaultBlock\n{"));
 
 
 		lines.insert(
 		lines.insert(
 			lines.end(), m_uniformBlock.begin(), m_uniformBlock.end());
 			lines.end(), m_uniformBlock.begin(), m_uniformBlock.end());
@@ -191,7 +191,7 @@ void MaterialProgramCreator::parseProgramTag(
 	// Other variables
 	// Other variables
 	for(Input& in : m_inputs)
 	for(Input& in : m_inputs)
 	{
 	{
-		if(!in.m_inBlock && (in.m_shaderDefinedMask | glshaderbit))
+		if(!in.m_inBlock && (in.m_shaderDefinedMask & glshaderbit))
 		{
 		{
 			lines.push_back(in.m_line);
 			lines.push_back(in.m_line);
 		}
 		}
@@ -423,7 +423,7 @@ void MaterialProgramCreator::parseOperationTag(
 				if(in.m_name == arg)
 				if(in.m_name == arg)
 				{
 				{
 					input = &in;
 					input = &in;
-					in.m_shaderReferencedMask = glshaderbit;
+					in.m_shaderReferencedMask |= glshaderbit;
 					break;
 					break;
 				}
 				}
 			}
 			}

+ 1 - 1
testapp/Main.cpp

@@ -510,7 +510,7 @@ void initSubsystems(int argc, char* argv[])
 	config.set("tilesXCount", 16);
 	config.set("tilesXCount", 16);
 	config.set("tilesYCount", 16);
 	config.set("tilesYCount", 16);
 
 
-	config.set("fullscreenDesktopResolution", false);
+	config.set("fullscreenDesktopResolution", true);
 	config.set("debugContext", false);
 	config.set("debugContext", false);
 
 
 	app = new App(config, allocAligned, nullptr);
 	app = new App(config, allocAligned, nullptr);