瀏覽代碼

Some code style refactoring #6

Panagiotis Christopoulos Charitos 3 年之前
父節點
當前提交
5fca82a812

+ 5 - 5
AnKi/Gr/Common.cpp

@@ -9,10 +9,10 @@
 namespace anki {
 
 /// @warning Don't use Array because the compilers can't handle it for some reason.
-inline constexpr ShaderVariableDataTypeInfo SVD_INFOS[] = {
-#define ANKI_SVDT_MACRO(capital, type, baseType, rowCount, columnCount, isIntagralType) \
+inline constexpr ShaderVariableDataTypeInfo kShaderVariableDataTypeInfos[] = {
+#define ANKI_SVDT_MACRO(type, baseType, rowCount, columnCount, isIntagralType) \
 	{ANKI_STRINGIZE(type), sizeof(type), false, isIntagralType},
-#define ANKI_SVDT_MACRO_OPAQUE(capital, type) {ANKI_STRINGIZE(type), kMaxU32, true, false},
+#define ANKI_SVDT_MACRO_OPAQUE(constant, type) {ANKI_STRINGIZE(type), kMaxU32, true, false},
 #include <AnKi/Gr/ShaderVariableDataType.defs.h>
 #undef ANKI_SVDT_MACRO
 #undef ANKI_SVDT_MACRO_OPAQUE
@@ -20,8 +20,8 @@ inline constexpr ShaderVariableDataTypeInfo SVD_INFOS[] = {
 
 const ShaderVariableDataTypeInfo& getShaderVariableDataTypeInfo(ShaderVariableDataType type)
 {
-	ANKI_ASSERT(type > ShaderVariableDataType::NONE && type < ShaderVariableDataType::COUNT);
-	return SVD_INFOS[U32(type) - 1];
+	ANKI_ASSERT(type > ShaderVariableDataType::kNone && type < ShaderVariableDataType::kCount);
+	return kShaderVariableDataTypeInfos[U32(type) - 1];
 }
 
 FormatInfo getFormatInfo(Format fmt)

+ 20 - 20
AnKi/Gr/Common.h

@@ -549,37 +549,37 @@ ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(ShaderTypeBit)
 
 enum class ShaderVariableDataType : U8
 {
-	NONE,
+	kNone,
 
-#define ANKI_SVDT_MACRO(capital, type, baseType, rowCount, columnCount, isIntagralType) capital,
-#define ANKI_SVDT_MACRO_OPAQUE(capital, type) capital,
+#define ANKI_SVDT_MACRO(type, baseType, rowCount, columnCount, isIntagralType) k##type,
+#define ANKI_SVDT_MACRO_OPAQUE(constant, type) k##constant,
 #include <AnKi/Gr/ShaderVariableDataType.defs.h>
 #undef ANKI_SVDT_MACRO
 #undef ANKI_SVDT_MACRO_OPAQUE
 
 	// Derived
-	COUNT,
+	kCount,
 
-	NUMERICS_FIRST = I32,
-	NUMERICS_LAST = MAT4,
+	kNumericsFirst = kI32,
+	kNumericsLast = kMat4,
 
-	NUMERIC_1_COMPONENT_FIRST = I32,
-	NUMERIC_1_COMPONENT_LAST = F32,
-	NUMERIC_2_COMPONENT_FIRST = IVEC2,
-	NUMERIC_2_COMPONENT_LAST = VEC2,
-	NUMERIC_3_COMPONENT_FIRST = IVEC3,
-	NUMERIC_3_COMPONENT_LAST = VEC3,
-	NUMERIC_4_COMPONENT_FIRST = IVEC4,
-	NUMERIC_4_COMPONENT_LAST = VEC4,
+	kNumeric1ComponentFirst = kI32,
+	kNumeric1ComponentLast = kF32,
+	kNumeric2ComponentFirst = kIVec2,
+	kNumeric2ComponentLast = kVec2,
+	kNumeric3ComponentFirst = kIVec3,
+	kNumeric3ComponentLast = kVec3,
+	kNumeric4ComponentFirst = kIVec4,
+	kNumeric4ComponentLast = kVec4,
 
-	MATRIX_FIRST = MAT3,
-	MATRIX_LAST = MAT4,
+	kMatrixFirst = kMat3,
+	kMatrixLast = kMat4,
 
-	TEXTURE_FIRST = TEXTURE_1D,
-	TEXTURE_LAST = TEXTURE_CUBE_ARRAY,
+	kTextureFirst = kTexture1D,
+	kTextureLast = kTextureCubeArray,
 
-	IMAGE_FIRST = IMAGE_1D,
-	IMAGE_LAST = IMAGE_CUBE_ARRAY,
+	kImageFirst = kImage1D,
+	kImageLast = kImageCubeArray,
 };
 ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(ShaderVariableDataType)
 

+ 1 - 1
AnKi/Gr/Gl/ShaderProgramImpl.cpp

@@ -122,7 +122,7 @@ const ShaderProgramImplReflection& ShaderProgramImpl::getReflection()
 			}
 
 			// Set type
-			ShaderVariableDataType akType = ShaderVariableDataType::NONE;
+			ShaderVariableDataType akType = ShaderVariableDataType::kNone;
 			switch(type)
 			{
 			case GL_FLOAT_VEC4:

+ 4 - 4
AnKi/Gr/Shader.h

@@ -29,25 +29,25 @@ public:
 
 	ShaderSpecializationConstValue()
 		: m_int(0)
-		, m_dataType(ShaderVariableDataType::NONE)
+		, m_dataType(ShaderVariableDataType::kNone)
 	{
 	}
 
 	explicit ShaderSpecializationConstValue(F32 f)
 		: m_float(f)
-		, m_dataType(ShaderVariableDataType::F32)
+		, m_dataType(ShaderVariableDataType::kF32)
 	{
 	}
 
 	explicit ShaderSpecializationConstValue(I32 i)
 		: m_int(i)
-		, m_dataType(ShaderVariableDataType::I32)
+		, m_dataType(ShaderVariableDataType::kI32)
 	{
 	}
 
 	explicit ShaderSpecializationConstValue(U32 i)
 		: m_int(i)
-		, m_dataType(ShaderVariableDataType::U32)
+		, m_dataType(ShaderVariableDataType::kU32)
 	{
 	}
 

+ 54 - 54
AnKi/Gr/ShaderVariableDataType.defs.h

@@ -5,68 +5,68 @@
 
 // ShaderVariableDataType defines
 
-// ANKI_SVDT_MACRO(capital, varType, baseType, rowCount, columnCount, isIntegralType)
+// ANKI_SVDT_MACRO(const, varType, baseType, rowCount, columnCount, isIntegralType)
 #if defined(ANKI_SVDT_MACRO)
-ANKI_SVDT_MACRO(I8, I8, I8, 1, 1, true)
-ANKI_SVDT_MACRO(U8, U8, U8, 1, 1, true)
-ANKI_SVDT_MACRO(I16, I16, I16, 1, 1, true)
-ANKI_SVDT_MACRO(U16, U16, U16, 1, 1, true)
-ANKI_SVDT_MACRO(I32, I32, I32, 1, 1, true)
-ANKI_SVDT_MACRO(U32, U32, U32, 1, 1, true)
-ANKI_SVDT_MACRO(I64, I64, I64, 1, 1, true)
-ANKI_SVDT_MACRO(U64, U64, U64, 1, 1, true)
-ANKI_SVDT_MACRO(F16, F16, F16, 1, 1, false)
-ANKI_SVDT_MACRO(F32, F32, F32, 1, 1, false)
+ANKI_SVDT_MACRO(I8, I8, 1, 1, true)
+ANKI_SVDT_MACRO(U8, U8, 1, 1, true)
+ANKI_SVDT_MACRO(I16, I16, 1, 1, true)
+ANKI_SVDT_MACRO(U16, U16, 1, 1, true)
+ANKI_SVDT_MACRO(I32, I32, 1, 1, true)
+ANKI_SVDT_MACRO(U32, U32, 1, 1, true)
+ANKI_SVDT_MACRO(I64, I64, 1, 1, true)
+ANKI_SVDT_MACRO(U64, U64, 1, 1, true)
+ANKI_SVDT_MACRO(F16, F16, 1, 1, false)
+ANKI_SVDT_MACRO(F32, F32, 1, 1, false)
 
-ANKI_SVDT_MACRO(I8VEC2, I8Vec2, I8, 2, 1, true)
-ANKI_SVDT_MACRO(U8VEC2, U8Vec2, U8, 2, 1, true)
-ANKI_SVDT_MACRO(I16VEC2, I16Vec2, I16, 2, 1, true)
-ANKI_SVDT_MACRO(U16VEC2, U16Vec2, U16, 2, 1, true)
-ANKI_SVDT_MACRO(IVEC2, IVec2, I32, 2, 1, true)
-ANKI_SVDT_MACRO(UVEC2, UVec2, U32, 2, 1, true)
-ANKI_SVDT_MACRO(HVEC2, HVec2, F16, 2, 1, false)
-ANKI_SVDT_MACRO(VEC2, Vec2, F32, 2, 1, false)
+ANKI_SVDT_MACRO(I8Vec2, I8, 2, 1, true)
+ANKI_SVDT_MACRO(U8Vec2, U8, 2, 1, true)
+ANKI_SVDT_MACRO(I16Vec2, I16, 2, 1, true)
+ANKI_SVDT_MACRO(U16Vec2, U16, 2, 1, true)
+ANKI_SVDT_MACRO(IVec2, I32, 2, 1, true)
+ANKI_SVDT_MACRO(UVec2, U32, 2, 1, true)
+ANKI_SVDT_MACRO(HVec2, F16, 2, 1, false)
+ANKI_SVDT_MACRO(Vec2, F32, 2, 1, false)
 
-ANKI_SVDT_MACRO(I8VEC3, I8Vec3, I8, 3, 1, true)
-ANKI_SVDT_MACRO(U8VEC3, U8Vec3, U8, 3, 1, true)
-ANKI_SVDT_MACRO(I16VEC3, I16Vec3, I16, 3, 1, true)
-ANKI_SVDT_MACRO(U16VEC3, U16Vec3, U16, 3, 1, true)
-ANKI_SVDT_MACRO(IVEC3, IVec3, I32, 3, 1, true)
-ANKI_SVDT_MACRO(UVEC3, UVec3, U32, 3, 1, true)
-ANKI_SVDT_MACRO(HVEC3, HVec3, F16, 3, 1, false)
-ANKI_SVDT_MACRO(VEC3, Vec3, F32, 3, 1, false)
+ANKI_SVDT_MACRO(I8Vec3, I8, 3, 1, true)
+ANKI_SVDT_MACRO(U8Vec3, U8, 3, 1, true)
+ANKI_SVDT_MACRO(I16Vec3, I16, 3, 1, true)
+ANKI_SVDT_MACRO(U16Vec3, U16, 3, 1, true)
+ANKI_SVDT_MACRO(IVec3, I32, 3, 1, true)
+ANKI_SVDT_MACRO(UVec3, U32, 3, 1, true)
+ANKI_SVDT_MACRO(HVec3, F16, 3, 1, false)
+ANKI_SVDT_MACRO(Vec3, F32, 3, 1, false)
 
-ANKI_SVDT_MACRO(I8VEC4, I8Vec4, I8, 4, 1, true)
-ANKI_SVDT_MACRO(U8VEC4, U8Vec4, U8, 4, 1, true)
-ANKI_SVDT_MACRO(I16VEC4, I16Vec4, I16, 4, 1, true)
-ANKI_SVDT_MACRO(U16VEC4, U16Vec4, U16, 4, 1, true)
-ANKI_SVDT_MACRO(IVEC4, IVec4, I32, 4, 1, true)
-ANKI_SVDT_MACRO(UVEC4, UVec4, U32, 4, 1, true)
-ANKI_SVDT_MACRO(HVEC4, HVec4, F16, 4, 1, false)
-ANKI_SVDT_MACRO(VEC4, Vec4, F32, 4, 1, false)
+ANKI_SVDT_MACRO(I8Vec4, I8, 4, 1, true)
+ANKI_SVDT_MACRO(U8Vec4, U8, 4, 1, true)
+ANKI_SVDT_MACRO(I16Vec4, I16, 4, 1, true)
+ANKI_SVDT_MACRO(U16Vec4, U16, 4, 1, true)
+ANKI_SVDT_MACRO(IVec4, I32, 4, 1, true)
+ANKI_SVDT_MACRO(UVec4, U32, 4, 1, true)
+ANKI_SVDT_MACRO(HVec4, F16, 4, 1, false)
+ANKI_SVDT_MACRO(Vec4, F32, 4, 1, false)
 
-ANKI_SVDT_MACRO(MAT3, Mat3, F32, 3, 3, false)
-ANKI_SVDT_MACRO(MAT3X4, Mat3x4, F32, 3, 4, false)
-ANKI_SVDT_MACRO(MAT4, Mat4, F32, 4, 4, false)
+ANKI_SVDT_MACRO(Mat3, F32, 3, 3, false)
+ANKI_SVDT_MACRO(Mat3x4, F32, 3, 4, false)
+ANKI_SVDT_MACRO(Mat4, F32, 4, 4, false)
 #endif
 
-// ANKI_SVDT_MACRO_OPAQUE(capital, varType)
+// ANKI_SVDT_MACRO_OPAQUE(const, varType)
 #if defined(ANKI_SVDT_MACRO_OPAQUE)
-ANKI_SVDT_MACRO_OPAQUE(TEXTURE_1D, texture1D)
-ANKI_SVDT_MACRO_OPAQUE(TEXTURE_1D_ARRAY, texture1DArray)
-ANKI_SVDT_MACRO_OPAQUE(TEXTURE_2D, texture2D)
-ANKI_SVDT_MACRO_OPAQUE(TEXTURE_2D_ARRAY, texture2DArray)
-ANKI_SVDT_MACRO_OPAQUE(TEXTURE_3D, texture3D)
-ANKI_SVDT_MACRO_OPAQUE(TEXTURE_CUBE, textureCube)
-ANKI_SVDT_MACRO_OPAQUE(TEXTURE_CUBE_ARRAY, textureCubeArray)
+ANKI_SVDT_MACRO_OPAQUE(Texture1D, texture1D)
+ANKI_SVDT_MACRO_OPAQUE(Texture1DArray, texture1DArray)
+ANKI_SVDT_MACRO_OPAQUE(Texture2D, texture2D)
+ANKI_SVDT_MACRO_OPAQUE(Texture2DArray, texture2DArray)
+ANKI_SVDT_MACRO_OPAQUE(Texture3D, texture3D)
+ANKI_SVDT_MACRO_OPAQUE(TextureCube, textureCube)
+ANKI_SVDT_MACRO_OPAQUE(TextureCubeArray, textureCubeArray)
 
-ANKI_SVDT_MACRO_OPAQUE(IMAGE_1D, image1D)
-ANKI_SVDT_MACRO_OPAQUE(IMAGE_1D_ARRAY, image1DArray)
-ANKI_SVDT_MACRO_OPAQUE(IMAGE_2D, image2D)
-ANKI_SVDT_MACRO_OPAQUE(IMAGE_2D_ARRAY, image2DArray)
-ANKI_SVDT_MACRO_OPAQUE(IMAGE_3D, image3D)
-ANKI_SVDT_MACRO_OPAQUE(IMAGE_CUBE, imageCube)
-ANKI_SVDT_MACRO_OPAQUE(IMAGE_CUBE_ARRAY, imageCubeArray)
+ANKI_SVDT_MACRO_OPAQUE(Image1D, image1D)
+ANKI_SVDT_MACRO_OPAQUE(Image1DArray, image1DArray)
+ANKI_SVDT_MACRO_OPAQUE(Image2D, image2D)
+ANKI_SVDT_MACRO_OPAQUE(Image2DArray, image2DArray)
+ANKI_SVDT_MACRO_OPAQUE(Image3D, image3D)
+ANKI_SVDT_MACRO_OPAQUE(ImageCube, imageCube)
+ANKI_SVDT_MACRO_OPAQUE(ImageCubeArray, imageCubeArray)
 
-ANKI_SVDT_MACRO_OPAQUE(SAMPLER, sampler)
+ANKI_SVDT_MACRO_OPAQUE(Sampler, sampler)
 #endif

+ 6 - 6
AnKi/Gr/Utils/Functions.cpp

@@ -85,20 +85,20 @@ template<typename T>
 class IsShaderVarDataTypeAMatrix
 {
 public:
-	static constexpr Bool VALUE = false;
+	static constexpr Bool kValue = false;
 };
 
-#define ANKI_SVDT_MACRO(capital, type, baseType, rowCount, columnCount, isIntagralType) \
+#define ANKI_SVDT_MACRO(type, baseType, rowCount, columnCount, isIntagralType) \
 	template<> \
 	class IsShaderVarDataTypeAMatrix<type> \
 	{ \
 	public: \
-		static constexpr Bool VALUE = rowCount * columnCount > 4; \
+		static constexpr Bool kValue = rowCount * columnCount > 4; \
 	};
 #include <AnKi/Gr/ShaderVariableDataType.defs.h>
 #undef ANKI_SVDT_MACRO
 
-template<typename T, Bool isMatrix = IsShaderVarDataTypeAMatrix<T>::VALUE>
+template<typename T, Bool isMatrix = IsShaderVarDataTypeAMatrix<T>::kValue>
 class WriteShaderBlockMemory
 {
 public:
@@ -128,8 +128,8 @@ void writeShaderBlockMemory(ShaderVariableDataType type, const ShaderVariableBlo
 {
 	switch(type)
 	{
-#define ANKI_SVDT_MACRO(capital, type, baseType, rowCount, columnCount, isIntagralType) \
-	case ShaderVariableDataType::capital: \
+#define ANKI_SVDT_MACRO(type, baseType, rowCount, columnCount, isIntagralType) \
+	case ShaderVariableDataType::k##type: \
 		WriteShaderBlockMemory<type>()(varBlkInfo, elements, elementsCount, buffBegin, buffEnd); \
 		break;
 #include <AnKi/Gr/ShaderVariableDataType.defs.h>

+ 2 - 2
AnKi/Gr/Utils/Functions.h

@@ -31,11 +31,11 @@ inline Bool blendingDisabled(BlendFactor srcFactorRgb, BlendFactor dstFactorRgb,
 template<typename T>
 ShaderVariableDataType getShaderVariableTypeFromTypename();
 
-#define ANKI_SVDT_MACRO(capital, type, baseType, rowCount, columnCount, isIntagralType) \
+#define ANKI_SVDT_MACRO(type, baseType, rowCount, columnCount, isIntagralType) \
 	template<> \
 	inline ShaderVariableDataType getShaderVariableTypeFromTypename<type>() \
 	{ \
-		return ShaderVariableDataType::capital; \
+		return ShaderVariableDataType::k##type; \
 	}
 
 #include <AnKi/Gr/ShaderVariableDataType.defs.h>

+ 10 - 10
AnKi/Resource/MaterialResource.cpp

@@ -23,20 +23,20 @@ template<typename T>
 class IsShaderVarDataTypeAnArray
 {
 public:
-	static constexpr Bool VALUE = false;
+	static constexpr Bool kValue = false;
 };
 
-#define ANKI_SVDT_MACRO(capital, type, baseType, rowCount, columnCount, isIntagralType) \
+#define ANKI_SVDT_MACRO(type, baseType, rowCount, columnCount, isIntagralType) \
 	template<> \
 	class IsShaderVarDataTypeAnArray<type> \
 	{ \
 	public: \
-		static constexpr Bool VALUE = rowCount * columnCount > 1; \
+		static constexpr Bool kValue = rowCount * columnCount > 1; \
 	};
 #include <AnKi/Gr/ShaderVariableDataType.defs.h>
 #undef ANKI_SVDT_MACRO
 
-template<typename T, Bool isArray = IsShaderVarDataTypeAnArray<T>::VALUE>
+template<typename T, Bool isArray = IsShaderVarDataTypeAnArray<T>::kValue>
 class GetAttribute
 {
 public:
@@ -393,7 +393,7 @@ Error MaterialResource::createVars(Program& prog)
 		for(const ShaderProgramBinaryOpaqueInstance& instance : variant->getBinaryVariant().m_opaques)
 		{
 			const ShaderProgramBinaryOpaque& opaque = binary.m_opaques[instance.m_index];
-			if(opaque.m_type == ShaderVariableDataType::SAMPLER)
+			if(opaque.m_type == ShaderVariableDataType::kSampler)
 			{
 				continue;
 			}
@@ -702,7 +702,7 @@ Error MaterialResource::parseInput(XmlElement inputEl, Bool async, BitSet<128>&
 
 		m_textures.emplaceBack(getAllocator(), foundVar->m_image->getTexture());
 	}
-	else if(foundVar->m_dataType == ShaderVariableDataType::U32)
+	else if(foundVar->m_dataType == ShaderVariableDataType::kU32)
 	{
 		// U32 is a bit special. It might be a number or a bindless texture
 
@@ -736,8 +736,8 @@ Error MaterialResource::parseInput(XmlElement inputEl, Bool async, BitSet<128>&
 	{
 		switch(foundVar->m_dataType)
 		{
-#define ANKI_SVDT_MACRO(capital, type, baseType, rowCount, columnCount, isIntagralType) \
-	case ShaderVariableDataType::capital: \
+#define ANKI_SVDT_MACRO(type, baseType, rowCount, columnCount, isIntagralType) \
+	case ShaderVariableDataType::k##type: \
 		ANKI_CHECK(GetAttribute<type>()(inputEl, foundVar->ANKI_CONCATENATE(m_, type))); \
 		break;
 #include <AnKi/Gr/ShaderVariableDataType.defs.h>
@@ -770,8 +770,8 @@ void MaterialResource::prefillLocalUniforms()
 
 		switch(var.m_dataType)
 		{
-#define ANKI_SVDT_MACRO(capital, type, baseType, rowCount, columnCount, isIntagralType) \
-	case ShaderVariableDataType::capital: \
+#define ANKI_SVDT_MACRO(type, baseType, rowCount, columnCount, isIntagralType) \
+	case ShaderVariableDataType::k##type: \
 		ANKI_ASSERT(var.m_offsetInLocalUniforms + sizeof(type) <= m_localUniformsSize); \
 		memcpy(static_cast<U8*>(m_prefilledLocalUniforms) + var.m_offsetInLocalUniforms, &var.m_##type, sizeof(type)); \
 		break;

+ 12 - 12
AnKi/Resource/MaterialResource.h

@@ -76,13 +76,13 @@ public:
 
 	Bool isBoundableTexture() const
 	{
-		return m_dataType >= ShaderVariableDataType::TEXTURE_FIRST
-			   && m_dataType <= ShaderVariableDataType::TEXTURE_LAST;
+		return m_dataType >= ShaderVariableDataType::kTextureFirst
+			   && m_dataType <= ShaderVariableDataType::kTextureLast;
 	}
 
 	Bool isBindlessTexture() const
 	{
-		return m_dataType == ShaderVariableDataType::U32 && m_image.get();
+		return m_dataType == ShaderVariableDataType::kU32 && m_image.get();
 	}
 
 	Bool isUniform() const
@@ -92,7 +92,7 @@ public:
 
 	ShaderVariableDataType getDataType() const
 	{
-		ANKI_ASSERT(m_dataType != ShaderVariableDataType::NONE);
+		ANKI_ASSERT(m_dataType != ShaderVariableDataType::kNone);
 		return m_dataType;
 	}
 
@@ -113,13 +113,13 @@ protected:
 	String m_name;
 	U32 m_offsetInLocalUniforms = kMaxU32;
 	U32 m_opaqueBinding = kMaxU32; ///< Binding for textures and samplers.
-	ShaderVariableDataType m_dataType = ShaderVariableDataType::NONE;
+	ShaderVariableDataType m_dataType = ShaderVariableDataType::kNone;
 
 	/// Values
 	/// @{
 	union
 	{
-#define ANKI_SVDT_MACRO(capital, type, baseType, rowCount, columnCount, isIntagralType) type ANKI_CONCATENATE(m_, type);
+#define ANKI_SVDT_MACRO(type, baseType, rowCount, columnCount, isIntagralType) type ANKI_CONCATENATE(m_, type);
 #include <AnKi/Gr/ShaderVariableDataType.defs.h>
 #undef ANKI_SVDT_MACRO
 	};
@@ -129,16 +129,16 @@ protected:
 };
 
 // Specialize the MaterialVariable::getValue
-#define ANKI_SPECIALIZE_GET_VALUE(t_, var_, shaderType_) \
+#define ANKI_SPECIALIZE_GET_VALUE(type, member) \
 	template<> \
-	inline const t_& MaterialVariable::getValue<t_>() const \
+	inline const type& MaterialVariable::getValue<type>() const \
 	{ \
-		ANKI_ASSERT(m_dataType == ShaderVariableDataType::shaderType_); \
-		return var_; \
+		ANKI_ASSERT(m_dataType == ShaderVariableDataType::k##type); \
+		return member; \
 	}
 
-#define ANKI_SVDT_MACRO(capital, type, baseType, rowCount, columnCount, isIntagralType) \
-	ANKI_SPECIALIZE_GET_VALUE(type, ANKI_CONCATENATE(m_, type), capital)
+#define ANKI_SVDT_MACRO(type, baseType, rowCount, columnCount, isIntagralType) \
+	ANKI_SPECIALIZE_GET_VALUE(type, ANKI_CONCATENATE(m_, type))
 #include <AnKi/Gr/ShaderVariableDataType.defs.h>
 #undef ANKI_SVDT_MACRO
 

+ 22 - 21
AnKi/Resource/ShaderProgramResource.cpp

@@ -110,50 +110,50 @@ Error ShaderProgramResource::load(const ResourceFilename& filename, [[maybe_unus
 		}
 		else if(componentCount == 2)
 		{
-			if(c.m_type == ShaderVariableDataType::U32)
+			if(c.m_type == ShaderVariableDataType::kU32)
 			{
-				in.m_dataType = ShaderVariableDataType::UVEC2;
+				in.m_dataType = ShaderVariableDataType::kUVec2;
 			}
-			else if(c.m_type == ShaderVariableDataType::I32)
+			else if(c.m_type == ShaderVariableDataType::kI32)
 			{
-				in.m_dataType = ShaderVariableDataType::IVEC2;
+				in.m_dataType = ShaderVariableDataType::kIVec2;
 			}
 			else
 			{
-				ANKI_ASSERT(c.m_type == ShaderVariableDataType::F32);
-				in.m_dataType = ShaderVariableDataType::VEC2;
+				ANKI_ASSERT(c.m_type == ShaderVariableDataType::kF32);
+				in.m_dataType = ShaderVariableDataType::kVec2;
 			}
 		}
 		else if(componentCount == 3)
 		{
-			if(c.m_type == ShaderVariableDataType::U32)
+			if(c.m_type == ShaderVariableDataType::kU32)
 			{
-				in.m_dataType = ShaderVariableDataType::UVEC3;
+				in.m_dataType = ShaderVariableDataType::kUVec3;
 			}
-			else if(c.m_type == ShaderVariableDataType::I32)
+			else if(c.m_type == ShaderVariableDataType::kI32)
 			{
-				in.m_dataType = ShaderVariableDataType::IVEC3;
+				in.m_dataType = ShaderVariableDataType::kIVec3;
 			}
 			else
 			{
-				ANKI_ASSERT(c.m_type == ShaderVariableDataType::F32);
-				in.m_dataType = ShaderVariableDataType::VEC3;
+				ANKI_ASSERT(c.m_type == ShaderVariableDataType::kF32);
+				in.m_dataType = ShaderVariableDataType::kVec3;
 			}
 		}
 		else if(componentCount == 4)
 		{
-			if(c.m_type == ShaderVariableDataType::U32)
+			if(c.m_type == ShaderVariableDataType::kU32)
 			{
-				in.m_dataType = ShaderVariableDataType::UVEC4;
+				in.m_dataType = ShaderVariableDataType::kUVec4;
 			}
-			else if(c.m_type == ShaderVariableDataType::I32)
+			else if(c.m_type == ShaderVariableDataType::kI32)
 			{
-				in.m_dataType = ShaderVariableDataType::IVEC4;
+				in.m_dataType = ShaderVariableDataType::kIVec4;
 			}
 			else
 			{
-				ANKI_ASSERT(c.m_type == ShaderVariableDataType::F32);
-				in.m_dataType = ShaderVariableDataType::VEC4;
+				ANKI_ASSERT(c.m_type == ShaderVariableDataType::kF32);
+				in.m_dataType = ShaderVariableDataType::kVec4;
 			}
 		}
 		else
@@ -345,9 +345,10 @@ ShaderProgramResource::createNewVariant(const ShaderProgramResourceVariantInitIn
 				const U32 constIdx = m_constBinaryMapping[binaryConstIdx].m_constsIdx;
 				const U32 component = m_constBinaryMapping[binaryConstIdx].m_component;
 				[[maybe_unused]] const Const& c = m_consts[constIdx];
-				ANKI_ASSERT(c.m_dataType == ShaderVariableDataType::U32 || c.m_dataType == ShaderVariableDataType::UVEC2
-							|| c.m_dataType == ShaderVariableDataType::UVEC3
-							|| c.m_dataType == ShaderVariableDataType::UVEC4);
+				ANKI_ASSERT(c.m_dataType == ShaderVariableDataType::kU32
+							|| c.m_dataType == ShaderVariableDataType::kUVec2
+							|| c.m_dataType == ShaderVariableDataType::kUVec3
+							|| c.m_dataType == ShaderVariableDataType::kUVec4);
 
 				// Find the value
 				for(U32 i = 0; i < m_consts.getSize(); ++i)

+ 1 - 1
AnKi/Resource/ShaderProgramResource.h

@@ -55,7 +55,7 @@ class ShaderProgramResourceConstant
 {
 public:
 	String m_name;
-	ShaderVariableDataType m_dataType = ShaderVariableDataType::NONE;
+	ShaderVariableDataType m_dataType = ShaderVariableDataType::kNone;
 	U32 m_index = kMaxU32;
 };
 

+ 9 - 9
AnKi/Scene/Components/RenderComponent.cpp

@@ -66,40 +66,40 @@ void RenderComponent::allocateAndSetupUniforms(const MaterialResourcePtr& mtl, c
 	{
 		switch(mvar.getDataType())
 		{
-		case ShaderVariableDataType::U32:
+		case ShaderVariableDataType::kU32:
 		{
 			const U32 val = mvar.getValue<U32>();
 			memcpy(localUniformsBegin + mvar.getOffsetInLocalUniforms(), &val, sizeof(val));
 			break;
 		}
-		case ShaderVariableDataType::F32:
+		case ShaderVariableDataType::kF32:
 		{
 			const F32 val = mvar.getValue<F32>();
 			memcpy(localUniformsBegin + mvar.getOffsetInLocalUniforms(), &val, sizeof(val));
 			break;
 		}
-		case ShaderVariableDataType::VEC2:
+		case ShaderVariableDataType::kVec2:
 		{
 			const Vec2 val = mvar.getValue<Vec2>();
 			memcpy(localUniformsBegin + mvar.getOffsetInLocalUniforms(), &val, sizeof(val));
 			break;
 		}
-		case ShaderVariableDataType::VEC3:
+		case ShaderVariableDataType::kVec3:
 		{
 			const Vec3 val = mvar.getValue<Vec3>();
 			memcpy(localUniformsBegin + mvar.getOffsetInLocalUniforms(), &val, sizeof(val));
 			break;
 		}
-		case ShaderVariableDataType::VEC4:
+		case ShaderVariableDataType::kVec4:
 		{
 			const Vec4 val = mvar.getValue<Vec4>();
 			memcpy(localUniformsBegin + mvar.getOffsetInLocalUniforms(), &val, sizeof(val));
 			break;
 		}
-		case ShaderVariableDataType::TEXTURE_2D:
-		case ShaderVariableDataType::TEXTURE_2D_ARRAY:
-		case ShaderVariableDataType::TEXTURE_3D:
-		case ShaderVariableDataType::TEXTURE_CUBE:
+		case ShaderVariableDataType::kTexture2D:
+		case ShaderVariableDataType::kTexture2DArray:
+		case ShaderVariableDataType::kTexture3D:
+		case ShaderVariableDataType::kTextureCube:
 		{
 			cmdb->bindTexture(set, mvar.getTextureBinding(), mvar.getValue<ImageResourcePtr>()->getTextureView());
 			break;

+ 5 - 5
AnKi/ShaderCompiler/ShaderProgramBinary.h

@@ -17,7 +17,7 @@ class ShaderProgramBinaryVariable
 {
 public:
 	Array<char, MAX_SHADER_BINARY_NAME_LENGTH + 1> m_name = {};
-	ShaderVariableDataType m_type = ShaderVariableDataType::NONE;
+	ShaderVariableDataType m_type = ShaderVariableDataType::kNone;
 
 	template<typename TSerializer, typename TClass>
 	static void serializeCommon(TSerializer& s, TClass self)
@@ -136,7 +136,7 @@ class ShaderProgramBinaryOpaque
 {
 public:
 	Array<char, MAX_SHADER_BINARY_NAME_LENGTH + 1> m_name = {};
-	ShaderVariableDataType m_type = ShaderVariableDataType::NONE;
+	ShaderVariableDataType m_type = ShaderVariableDataType::kNone;
 	U32 m_binding = kMaxU32;
 	U32 m_set = kMaxU32;
 
@@ -196,7 +196,7 @@ class ShaderProgramBinaryConstant
 {
 public:
 	Array<char, MAX_SHADER_BINARY_NAME_LENGTH + 1> m_name;
-	ShaderVariableDataType m_type = ShaderVariableDataType::NONE;
+	ShaderVariableDataType m_type = ShaderVariableDataType::kNone;
 	U32 m_constantId = kMaxU32;
 
 	template<typename TSerializer, typename TClass>
@@ -252,8 +252,8 @@ class ShaderProgramBinaryStructMember
 public:
 	Array<char, MAX_SHADER_BINARY_NAME_LENGTH + 1> m_name = {};
 
-	/// If the value is ShaderVariableDataType::NONE then it's a struct.
-	ShaderVariableDataType m_type = ShaderVariableDataType::NONE;
+	/// If the value is ShaderVariableDataType::kNone then it's a struct.
+	ShaderVariableDataType m_type = ShaderVariableDataType::kNone;
 
 	/// If the type is another struct then this points to ShaderProgramBinary::m_structs.
 	U32 m_structIndex = kMaxU32;

+ 4 - 4
AnKi/ShaderCompiler/ShaderProgramBinary.xml

@@ -9,7 +9,7 @@
 		<class name="ShaderProgramBinaryVariable" comment="Storage or uniform variable">
 			<members>
 				<member name="m_name" type="char" array_size="MAX_SHADER_BINARY_NAME_LENGTH + 1" constructor="= {}" />
-				<member name="m_type" type="ShaderVariableDataType" constructor="= ShaderVariableDataType::NONE" />
+				<member name="m_type" type="ShaderVariableDataType" constructor="= ShaderVariableDataType::kNone" />
 			</members>
 		</class>
 
@@ -40,7 +40,7 @@
 		<class name="ShaderProgramBinaryOpaque" comment="Sampler or texture or image">
 			<members>
 				<member name="m_name" type="char" array_size="MAX_SHADER_BINARY_NAME_LENGTH + 1" constructor="= {}" />
-				<member name="m_type" type="ShaderVariableDataType" constructor="= ShaderVariableDataType::NONE" />
+				<member name="m_type" type="ShaderVariableDataType" constructor="= ShaderVariableDataType::kNone" />
 				<member name="m_binding" type="U32" constructor="= kMaxU32" />
 				<member name="m_set" type="U32" constructor="= kMaxU32" />
 			</members>
@@ -56,7 +56,7 @@
 		<class name="ShaderProgramBinaryConstant" comment="Specialization constant">
 			<members>
 				<member name="m_name" type="char" array_size="MAX_SHADER_BINARY_NAME_LENGTH + 1" />
-				<member name="m_type" type="ShaderVariableDataType" constructor="= ShaderVariableDataType::NONE" />
+				<member name="m_type" type="ShaderVariableDataType" constructor="= ShaderVariableDataType::kNone" />
 				<member name="m_constantId" type="U32" constructor="= kMaxU32"/>
 			</members>
 		</class>
@@ -70,7 +70,7 @@
 		<class name="ShaderProgramBinaryStructMember" comment="A member of a ShaderProgramBinaryStruct">
 			<members>
 				<member name="m_name" type="char" array_size="MAX_SHADER_BINARY_NAME_LENGTH + 1" constructor="= {}" />
-				<member name="m_type" type="ShaderVariableDataType" constructor="= ShaderVariableDataType::NONE" comment="If the value is ShaderVariableDataType::NONE then it's a struct" />
+				<member name="m_type" type="ShaderVariableDataType" constructor="= ShaderVariableDataType::kNone" comment="If the value is ShaderVariableDataType::kNone then it's a struct" />
 				<member name="m_structIndex" type="U32" constructor="= kMaxU32" comment="If the type is another struct then this points to ShaderProgramBinary::m_structs" />
 				<member name="m_dependentMutator" type="U32" constructor="= kMaxU32" comment="It points to a ShaderProgramBinary::m_mutators. This mutator will turn on or off this member" />
 				<member name="m_dependentMutatorValue" type="MutatorValue" constructor="= 0" comment="The value of the m_dependentMutator" />

+ 1 - 1
AnKi/ShaderCompiler/ShaderProgramCompiler.cpp

@@ -629,7 +629,7 @@ public:
 			ANKI_CHECK(setName(memberName, member.m_name));
 			member.m_type = type;
 
-			if(type == ShaderVariableDataType::NONE)
+			if(type == ShaderVariableDataType::kNone)
 			{
 				// Type is a struct, find the right index
 

+ 1 - 1
AnKi/ShaderCompiler/ShaderProgramDump.cpp

@@ -150,7 +150,7 @@ void dumpShaderProgramBinary(const ShaderProgramBinary& binary, StringAuto& huma
 
 			for(const ShaderProgramBinaryStructMember& member : s.m_members)
 			{
-				const CString typeStr = (member.m_type == ShaderVariableDataType::NONE)
+				const CString typeStr = (member.m_type == ShaderVariableDataType::kNone)
 											? &binary.m_structs[member.m_structIndex].m_name[0]
 											: getShaderVariableDataTypeInfo(member.m_type).m_name;
 				const CString dependentMutator = (member.m_dependentMutator != kMaxU32)

+ 7 - 7
AnKi/ShaderCompiler/ShaderProgramParser.cpp

@@ -859,29 +859,29 @@ Error ShaderProgramParser::parsePragmaMember(const StringAuto* begin, const Stri
 	}
 
 	const CString typeStr = *begin;
-	member.m_type = ShaderVariableDataType::NONE;
+	member.m_type = ShaderVariableDataType::kNone;
 	if(typeStr == "F32")
 	{
-		member.m_type = ShaderVariableDataType::F32;
+		member.m_type = ShaderVariableDataType::kF32;
 	}
 	else if(typeStr == "Vec2")
 	{
-		member.m_type = ShaderVariableDataType::VEC2;
+		member.m_type = ShaderVariableDataType::kVec2;
 	}
 	else if(typeStr == "Vec3")
 	{
-		member.m_type = ShaderVariableDataType::VEC3;
+		member.m_type = ShaderVariableDataType::kVec3;
 	}
 	else if(typeStr == "Vec4")
 	{
-		member.m_type = ShaderVariableDataType::VEC4;
+		member.m_type = ShaderVariableDataType::kVec4;
 	}
 	else if(typeStr == "U32")
 	{
-		member.m_type = ShaderVariableDataType::U32;
+		member.m_type = ShaderVariableDataType::kU32;
 	}
 
-	if(member.m_type == ShaderVariableDataType::NONE)
+	if(member.m_type == ShaderVariableDataType::kNone)
 	{
 		ANKI_PP_ERROR_MALFORMED_MSG("Unrecognized type");
 	}

+ 39 - 39
AnKi/ShaderCompiler/ShaderProgramReflection.cpp

@@ -11,39 +11,39 @@ namespace anki {
 
 static ShaderVariableDataType spirvcrossBaseTypeToAnki(spirv_cross::SPIRType::BaseType cross)
 {
-	ShaderVariableDataType out = ShaderVariableDataType::NONE;
+	ShaderVariableDataType out = ShaderVariableDataType::kNone;
 
 	switch(cross)
 	{
 	case spirv_cross::SPIRType::SByte:
-		out = ShaderVariableDataType::I8;
+		out = ShaderVariableDataType::kI8;
 		break;
 	case spirv_cross::SPIRType::UByte:
-		out = ShaderVariableDataType::U8;
+		out = ShaderVariableDataType::kU8;
 		break;
 	case spirv_cross::SPIRType::Short:
-		out = ShaderVariableDataType::I16;
+		out = ShaderVariableDataType::kI16;
 		break;
 	case spirv_cross::SPIRType::UShort:
-		out = ShaderVariableDataType::U16;
+		out = ShaderVariableDataType::kU16;
 		break;
 	case spirv_cross::SPIRType::Int:
-		out = ShaderVariableDataType::I32;
+		out = ShaderVariableDataType::kI32;
 		break;
 	case spirv_cross::SPIRType::UInt:
-		out = ShaderVariableDataType::U32;
+		out = ShaderVariableDataType::kU32;
 		break;
 	case spirv_cross::SPIRType::Int64:
-		out = ShaderVariableDataType::I64;
+		out = ShaderVariableDataType::kI64;
 		break;
 	case spirv_cross::SPIRType::UInt64:
-		out = ShaderVariableDataType::U64;
+		out = ShaderVariableDataType::kU64;
 		break;
 	case spirv_cross::SPIRType::Half:
-		out = ShaderVariableDataType::F16;
+		out = ShaderVariableDataType::kF16;
 		break;
 	case spirv_cross::SPIRType::Float:
-		out = ShaderVariableDataType::F32;
+		out = ShaderVariableDataType::kF32;
 		break;
 	default:
 		break;
@@ -74,7 +74,7 @@ private:
 	public:
 		StringAuto m_name;
 		ShaderVariableBlockInfo m_blockInfo;
-		ShaderVariableDataType m_type = ShaderVariableDataType::NONE;
+		ShaderVariableDataType m_type = ShaderVariableDataType::kNone;
 
 		Var(const GenericMemoryPoolAllocator<U8>& alloc)
 			: m_name(alloc)
@@ -102,7 +102,7 @@ private:
 	{
 	public:
 		StringAuto m_name;
-		ShaderVariableDataType m_type = ShaderVariableDataType::NONE;
+		ShaderVariableDataType m_type = ShaderVariableDataType::kNone;
 		U32 m_binding = kMaxU32;
 		U32 m_set = kMaxU32;
 		U32 m_arraySize = kMaxU32;
@@ -117,7 +117,7 @@ private:
 	{
 	public:
 		StringAuto m_name;
-		ShaderVariableDataType m_type = ShaderVariableDataType::NONE;
+		ShaderVariableDataType m_type = ShaderVariableDataType::kNone;
 		U32 m_constantId = kMaxU32;
 
 		Const(const GenericMemoryPoolAllocator<U8>& alloc)
@@ -130,7 +130,7 @@ private:
 	{
 	public:
 		StringAuto m_name;
-		ShaderVariableDataType m_type = ShaderVariableDataType::NONE;
+		ShaderVariableDataType m_type = ShaderVariableDataType::kNone;
 		U32 m_structIndex = kMaxU32; ///< The member is actually a struct.
 		U32 m_offset = kMaxU32;
 		U32 m_arraySize = kMaxU32;
@@ -280,8 +280,8 @@ Error SpirvReflector::structReflection(uint32_t id, const spirv_cross::SPIRType&
 
 		// Type
 		const ShaderVariableDataType baseType = spirvcrossBaseTypeToAnki(memberType.basetype);
-		const Bool isNumeric = baseType != ShaderVariableDataType::NONE;
-		ShaderVariableDataType actualType = ShaderVariableDataType::NONE;
+		const Bool isNumeric = baseType != ShaderVariableDataType::kNone;
+		ShaderVariableDataType actualType = ShaderVariableDataType::kNone;
 		U32 memberSize = 0;
 		U32 memberAlignment = 0;
 
@@ -292,17 +292,17 @@ Error SpirvReflector::structReflection(uint32_t id, const spirv_cross::SPIRType&
 			if(0)
 			{
 			}
-#define ANKI_SVDT_MACRO(capital, type, baseType_, rowCount, columnCount, isIntagralType) \
-	else if(ShaderVariableDataType::baseType_ == baseType && isMatrix && memberType.vecsize == rowCount \
+#define ANKI_SVDT_MACRO(type, baseType_, rowCount, columnCount, isIntagralType) \
+	else if(ShaderVariableDataType::k##baseType_ == baseType && isMatrix && memberType.vecsize == rowCount \
 			&& memberType.columns == columnCount) \
 	{ \
-		actualType = ShaderVariableDataType::capital; \
+		actualType = ShaderVariableDataType::k##type; \
 		memberSize = sizeof(type); \
 		memberAlignment = alignof(baseType_); \
 	} \
-	else if(ShaderVariableDataType::baseType_ == baseType && !isMatrix && memberType.vecsize == rowCount) \
+	else if(ShaderVariableDataType::k##baseType_ == baseType && !isMatrix && memberType.vecsize == rowCount) \
 	{ \
-		actualType = ShaderVariableDataType::capital; \
+		actualType = ShaderVariableDataType::k##type; \
 		memberSize = sizeof(type); \
 		memberAlignment = alignof(baseType_); \
 	}
@@ -469,7 +469,7 @@ Error SpirvReflector::blockVariableReflection(const spirv_cross::SPIRType& type,
 		}
 
 		const ShaderVariableDataType baseType = spirvcrossBaseTypeToAnki(memberType.basetype);
-		const Bool isNumeric = baseType != ShaderVariableDataType::NONE;
+		const Bool isNumeric = baseType != ShaderVariableDataType::kNone;
 
 		if(memberType.basetype == spirv_cross::SPIRType::Struct)
 		{
@@ -495,25 +495,25 @@ Error SpirvReflector::blockVariableReflection(const spirv_cross::SPIRType& type,
 			if(0)
 			{
 			}
-#define ANKI_SVDT_MACRO(capital, type_, baseType_, rowCount, columnCount, isIntagralType) \
-	else if(ShaderVariableDataType::baseType_ == baseType && isMatrix && memberType.vecsize == rowCount \
+#define ANKI_SVDT_MACRO(type_, baseType_, rowCount, columnCount, isIntagralType) \
+	else if(ShaderVariableDataType::k##baseType_ == baseType && isMatrix && memberType.vecsize == rowCount \
 			&& memberType.columns == columnCount) \
 	{ \
-		var.m_type = ShaderVariableDataType::capital; \
+		var.m_type = ShaderVariableDataType::k##type_; \
 		auto it = ir.meta.find(type.self); \
 		ANKI_ASSERT(it != ir.meta.end()); \
 		const spirv_cross::Vector<spirv_cross::Meta::Decoration>& memberDecorations = it->second.members; \
 		ANKI_ASSERT(i < memberDecorations.size()); \
 		var.m_blockInfo.m_matrixStride = I16(memberDecorations[i].matrix_stride); \
 	} \
-	else if(ShaderVariableDataType::baseType_ == baseType && !isMatrix && memberType.vecsize == rowCount) \
+	else if(ShaderVariableDataType::k##baseType_ == baseType && !isMatrix && memberType.vecsize == rowCount) \
 	{ \
-		var.m_type = ShaderVariableDataType::capital; \
+		var.m_type = ShaderVariableDataType::k##type_; \
 	}
 #include <AnKi/Gr/ShaderVariableDataType.defs.h>
 #undef ANKI_SVDT_MACRO
 
-			if(var.m_type == ShaderVariableDataType::NONE)
+			if(var.m_type == ShaderVariableDataType::kNone)
 			{
 				ANKI_SHADER_COMPILER_LOGE("Unhandled numeric member: %s", var.m_name.cstr());
 				return Error::kFunctionFailed;
@@ -526,7 +526,7 @@ Error SpirvReflector::blockVariableReflection(const spirv_cross::SPIRType& type,
 		}
 
 		// Store the member if it's no struct
-		if(var.m_type != ShaderVariableDataType::NONE)
+		if(var.m_type != ShaderVariableDataType::kNone)
 		{
 			vars.emplaceBack(std::move(var));
 		}
@@ -635,17 +635,17 @@ Error SpirvReflector::spirvTypeToAnki(const spirv_cross::SPIRType& type, ShaderV
 		switch(type.image.dim)
 		{
 		case spv::Dim1D:
-			out = (type.image.arrayed) ? ShaderVariableDataType::TEXTURE_1D_ARRAY : ShaderVariableDataType::TEXTURE_1D;
+			out = (type.image.arrayed) ? ShaderVariableDataType::kTexture1DArray : ShaderVariableDataType::kTexture1D;
 			break;
 		case spv::Dim2D:
-			out = (type.image.arrayed) ? ShaderVariableDataType::TEXTURE_2D_ARRAY : ShaderVariableDataType::TEXTURE_2D;
+			out = (type.image.arrayed) ? ShaderVariableDataType::kTexture2DArray : ShaderVariableDataType::kTexture2D;
 			break;
 		case spv::Dim3D:
-			out = ShaderVariableDataType::TEXTURE_3D;
+			out = ShaderVariableDataType::kTexture3D;
 			break;
 		case spv::DimCube:
-			out = (type.image.arrayed) ? ShaderVariableDataType::TEXTURE_CUBE_ARRAY
-									   : ShaderVariableDataType::TEXTURE_CUBE;
+			out =
+				(type.image.arrayed) ? ShaderVariableDataType::kTextureCubeArray : ShaderVariableDataType::kTextureCube;
 			break;
 		default:
 			ANKI_ASSERT(0);
@@ -654,7 +654,7 @@ Error SpirvReflector::spirvTypeToAnki(const spirv_cross::SPIRType& type, ShaderV
 		break;
 	}
 	case spirv_cross::SPIRType::Sampler:
-		out = ShaderVariableDataType::SAMPLER;
+		out = ShaderVariableDataType::kSampler;
 		break;
 	default:
 		ANKI_SHADER_COMPILER_LOGE("Can't determine the type");
@@ -770,13 +770,13 @@ Error SpirvReflector::constsReflection(DynamicArrayAuto<Const>& consts) const
 		switch(type.basetype)
 		{
 		case spirv_cross::SPIRType::UInt:
-			newConst.m_type = ShaderVariableDataType::U32;
+			newConst.m_type = ShaderVariableDataType::kU32;
 			break;
 		case spirv_cross::SPIRType::Int:
-			newConst.m_type = ShaderVariableDataType::I32;
+			newConst.m_type = ShaderVariableDataType::kI32;
 			break;
 		case spirv_cross::SPIRType::Float:
-			newConst.m_type = ShaderVariableDataType::F32;
+			newConst.m_type = ShaderVariableDataType::kF32;
 			break;
 		default:
 			ANKI_SHADER_COMPILER_LOGE("Can't determine the type of the spec constant: %s", name.c_str());