Sfoglia il codice sorgente

Feature: Added a way to specify a feature-set when defining a BSL shader file
- Also updated IrradianceEvaluate shader so it does not require structured buffer support

BearishSun 8 anni fa
parent
commit
ae820eb3c3
54 ha cambiato i file con 204 aggiunte e 267 eliminazioni
  1. BIN
      Data/Engine/Includes/ForwardLighting.bslinc.asset
  2. BIN
      Data/Engine/Shaders/IrradianceComputeSH.bsl.asset
  3. BIN
      Data/Engine/Shaders/IrradianceEvaluate.bsl.asset
  4. BIN
      Data/Engine/Shaders/IrradianceReduceSH.bsl.asset
  5. BIN
      Data/Engine/Shaders/LightGridLLCreation.bsl.asset
  6. BIN
      Data/Engine/Shaders/LightGridLLReduction.bsl.asset
  7. BIN
      Data/Engine/Shaders/PPCreateTonemapLUT.bsl.asset
  8. BIN
      Data/Engine/Shaders/PPEyeAdaptHistogram.bsl.asset
  9. BIN
      Data/Engine/Shaders/TiledDeferredImageBasedLighting.bsl.asset
  10. BIN
      Data/Engine/Shaders/TiledDeferredLighting.bsl.asset
  11. BIN
      Data/Engine/Shaders/Transparent.bsl.asset
  12. 2 0
      Data/Raw/Engine/Includes/ForwardLighting.bslinc
  13. 2 0
      Data/Raw/Engine/Shaders/IrradianceComputeSH.bsl
  14. 48 5
      Data/Raw/Engine/Shaders/IrradianceEvaluate.bsl
  15. 2 0
      Data/Raw/Engine/Shaders/IrradianceReduceSH.bsl
  16. 2 0
      Data/Raw/Engine/Shaders/LightGridLLCreation.bsl
  17. 2 0
      Data/Raw/Engine/Shaders/LightGridLLReduction.bsl
  18. 2 1
      Data/Raw/Engine/Shaders/PPCreateTonemapLUT.bsl
  19. 2 0
      Data/Raw/Engine/Shaders/PPEyeAdaptHistogram.bsl
  20. 2 0
      Data/Raw/Engine/Shaders/TiledDeferredImageBasedLighting.bsl
  21. 2 0
      Data/Raw/Engine/Shaders/TiledDeferredLighting.bsl
  22. 0 3
      Source/BansheeCore/BsCorePrerequisites.h
  23. 18 21
      Source/BansheeCore/Managers/BsGpuProgramManager.cpp
  24. 8 11
      Source/BansheeCore/Managers/BsGpuProgramManager.h
  25. 21 27
      Source/BansheeCore/Material/BsTechnique.cpp
  26. 12 19
      Source/BansheeCore/Material/BsTechnique.h
  27. 1 1
      Source/BansheeCore/RTTI/BsTechniqueRTTI.h
  28. 0 7
      Source/BansheeCore/RenderAPI/BsRenderAPI.h
  29. 0 4
      Source/BansheeCore/Utility/BsCommonTypes.h
  30. 0 6
      Source/BansheeD3D11RenderAPI/BsD3D11GpuBuffer.cpp
  31. 0 25
      Source/BansheeD3D11RenderAPI/BsD3D11GpuBufferView.cpp
  32. 10 5
      Source/BansheeD3D11RenderAPI/BsD3D11GpuProgram.cpp
  33. 6 15
      Source/BansheeD3D11RenderAPI/BsD3D11HLSLProgramFactory.cpp
  34. 0 3
      Source/BansheeD3D11RenderAPI/BsD3D11HLSLProgramFactory.h
  35. 1 7
      Source/BansheeD3D11RenderAPI/BsD3D11RenderAPI.cpp
  36. 0 3
      Source/BansheeD3D11RenderAPI/BsD3D11RenderAPI.h
  37. 1 1
      Source/BansheeGLRenderAPI/BsGLGpuBuffer.cpp
  38. 16 12
      Source/BansheeGLRenderAPI/BsGLRenderAPI.cpp
  39. 0 3
      Source/BansheeGLRenderAPI/BsGLRenderAPI.h
  40. 0 3
      Source/BansheeGLRenderAPI/GLSL/BsGLSLGpuProgram.cpp
  41. 0 7
      Source/BansheeGLRenderAPI/GLSL/BsGLSLProgramFactory.cpp
  42. 0 3
      Source/BansheeGLRenderAPI/GLSL/BsGLSLProgramFactory.h
  43. 1 1
      Source/BansheeSL/BsASTFX.c
  44. 1 1
      Source/BansheeSL/BsASTFX.h
  45. 1 1
      Source/BansheeSL/BsLexerFX.l
  46. 5 5
      Source/BansheeSL/BsParserFX.y
  47. 12 25
      Source/BansheeSL/BsSLFXCompiler.cpp
  48. 8 11
      Source/BansheeSL/BsSLFXCompiler.h
  49. 1 1
      Source/BansheeUtility/Math/BsMath.h
  50. 1 7
      Source/BansheeVulkanRenderAPI/BsVulkanRenderAPI.cpp
  51. 0 3
      Source/BansheeVulkanRenderAPI/BsVulkanRenderAPI.h
  52. 2 9
      Source/BansheeVulkanRenderAPI/Managers/BsVulkanGLSLProgramFactory.cpp
  53. 0 3
      Source/BansheeVulkanRenderAPI/Managers/BsVulkanGLSLProgramFactory.h
  54. 12 8
      Source/RenderBeast/BsLightProbes.cpp

BIN
Data/Engine/Includes/ForwardLighting.bslinc.asset


BIN
Data/Engine/Shaders/IrradianceComputeSH.bsl.asset


BIN
Data/Engine/Shaders/IrradianceEvaluate.bsl.asset


BIN
Data/Engine/Shaders/IrradianceReduceSH.bsl.asset


BIN
Data/Engine/Shaders/LightGridLLCreation.bsl.asset


BIN
Data/Engine/Shaders/LightGridLLReduction.bsl.asset


BIN
Data/Engine/Shaders/PPCreateTonemapLUT.bsl.asset


BIN
Data/Engine/Shaders/PPEyeAdaptHistogram.bsl.asset


BIN
Data/Engine/Shaders/TiledDeferredImageBasedLighting.bsl.asset


BIN
Data/Engine/Shaders/TiledDeferredLighting.bsl.asset


BIN
Data/Engine/Shaders/Transparent.bsl.asset


+ 2 - 0
Data/Raw/Engine/Includes/ForwardLighting.bslinc

@@ -14,6 +14,8 @@ mixin ForwardLighting
 	mixin LightGridCommon;
 	mixin LightGridCommon;
 	mixin LightAccumulatorIndexed;
 	mixin LightAccumulatorIndexed;
 	mixin ReflProbeAccumulatorIndexed;
 	mixin ReflProbeAccumulatorIndexed;
+	
+	featureset = HighEnd;
 	#else
 	#else
 	mixin LightAccumulatorDirect;
 	mixin LightAccumulatorDirect;
 	mixin ReflProbeAccumulatorDirect;
 	mixin ReflProbeAccumulatorDirect;

+ 2 - 0
Data/Raw/Engine/Shaders/IrradianceComputeSH.bsl

@@ -6,6 +6,8 @@ technique IrradianceComputeSH
 	mixin ReflectionCubemapCommon;
 	mixin ReflectionCubemapCommon;
 	mixin SHCommon;
 	mixin SHCommon;
 
 
+	featureset = HighEnd;
+	
 	variations
 	variations
 	{
 	{
 		SH_ORDER = { 3, 5 };
 		SH_ORDER = { 3, 5 };

+ 48 - 5
Data/Raw/Engine/Shaders/IrradianceEvaluate.bsl

@@ -57,8 +57,8 @@ technique IrradianceEvaluate
 		};		
 		};		
 		
 		
 		Texture2D gSHCoeffs;
 		Texture2D gSHCoeffs;
-		StructuredBuffer<Tetrahedron> gTetrahedra;
-		StructuredBuffer<TetrahedronFace> gTetFaces;
+		Buffer<uint4> gTetrahedra;
+		Buffer<float4> gTetFaces;
 		
 		
 		TextureCube gSkyIrradianceTex;
 		TextureCube gSkyIrradianceTex;
 		Texture2D gAmbientOcclusionTex;
 		Texture2D gAmbientOcclusionTex;
@@ -68,7 +68,50 @@ technique IrradianceEvaluate
 		{
 		{
 			float gSkyBrightness;
 			float gSkyBrightness;
 			uint gNumTetrahedra;
 			uint gNumTetrahedra;
-		}				
+		}
+		
+		Tetrahedron getTetrahedron(uint idx)
+		{
+			Tetrahedron output;
+			
+			uint4 data[6];
+			
+			[unroll]
+			for(int i = 0; i < 6; i++)
+				data[i] = gTetrahedra.Load(idx * 6 + i);
+			
+			output.indices = data[0];
+			output.offsets[0] = data[1].xy;
+			output.offsets[1] = data[1].zw;
+			output.offsets[2] = data[2].xy;
+			output.offsets[3] = data[2].zw;
+			output.transform = float3x4(asfloat(data[3]), asfloat(data[4]), asfloat(data[5]));
+			
+			return output;
+		}
+		
+		TetrahedronFace getTetrahedronFace(uint idx)
+		{
+			TetrahedronFace output;
+			
+			float4 data[7];
+			
+			[unroll]
+			for(int i = 0; i < 7; i++)
+				data[i] = gTetFaces.Load(idx * 7 + i);
+			
+			[unroll]
+			for(int i = 0; i < 3; i++)
+			{
+				output.corners[i] = data[i];
+				output.normals[i] = data[3 + i];
+				output.padding[i] = 0;
+			}
+			
+			output.isQuadratic = asuint(data[6].x);
+			
+			return output;		
+		}
 		
 		
 		float3 getSkyIndirectDiffuse(float3 dir)
 		float3 getSkyIndirectDiffuse(float3 dir)
 		{
 		{
@@ -211,7 +254,7 @@ technique IrradianceEvaluate
 					irradiance = gSkyIrradianceTex.SampleLevel(gLinearSamp, surfaceData.worldNormal, 0).rgb * gSkyBrightness;
 					irradiance = gSkyIrradianceTex.SampleLevel(gLinearSamp, surfaceData.worldNormal, 0).rgb * gSkyBrightness;
 				else
 				else
 				{
 				{
-					Tetrahedron volume = gTetrahedra[volumeIdx];
+					Tetrahedron volume = getTetrahedron(volumeIdx);
 					
 					
 					float3 P = NDCToWorld(input.screenPos, surfaceData.depth);
 					float3 P = NDCToWorld(input.screenPos, surfaceData.depth);
 					
 					
@@ -220,7 +263,7 @@ technique IrradianceEvaluate
 					if(volumeIdx >= gNumTetrahedra)
 					if(volumeIdx >= gNumTetrahedra)
 					{
 					{
 						uint faceIdx = volumeIdx - gNumTetrahedra;
 						uint faceIdx = volumeIdx - gNumTetrahedra;
-						TetrahedronFace face = gTetFaces[faceIdx];
+						TetrahedronFace face = getTetrahedronFace(faceIdx);
 					
 					
 						float3 factors = mul(volume.transform, float4(P, 1.0f));
 						float3 factors = mul(volume.transform, float4(P, 1.0f));
 						float A = factors.x;
 						float A = factors.x;

+ 2 - 0
Data/Raw/Engine/Shaders/IrradianceReduceSH.bsl

@@ -6,6 +6,8 @@ technique IrradianceReduceSH
 	mixin ReflectionCubemapCommon;
 	mixin ReflectionCubemapCommon;
 	mixin SHCommon;
 	mixin SHCommon;
 
 
+	featureset = HighEnd;
+	
 	variations
 	variations
 	{
 	{
 		SH_ORDER = { 3, 5 };
 		SH_ORDER = { 3, 5 };

+ 2 - 0
Data/Raw/Engine/Shaders/LightGridLLCreation.bsl

@@ -11,6 +11,8 @@ technique LightGridLLCreation
 	mixin LightGridCommon;
 	mixin LightGridCommon;
 	mixin ImageBasedLighting;
 	mixin ImageBasedLighting;
 
 
+	featureset = HighEnd;
+	
 	code
 	code
 	{
 	{
 		StructuredBuffer<LightData> gLights;
 		StructuredBuffer<LightData> gLights;

+ 2 - 0
Data/Raw/Engine/Shaders/LightGridLLReduction.bsl

@@ -6,6 +6,8 @@ technique LightGridLLReduction
 	mixin PerCameraData;
 	mixin PerCameraData;
 	mixin LightGridCommon; 
 	mixin LightGridCommon; 
 
 
+	featureset = HighEnd;
+	
 	code
 	code
 	{
 	{
 		Buffer<uint> gLightsLLHeads;
 		Buffer<uint> gLightsLLHeads;

+ 2 - 1
Data/Raw/Engine/Shaders/PPCreateTonemapLUT.bsl

@@ -8,10 +8,11 @@ technique PPCreateTonemapLUT
 	mixin PPWhiteBalance;
 	mixin PPWhiteBalance;
 	
 	
 	#if VOLUME_LUT
 	#if VOLUME_LUT
+	featureset = HighEnd;
 	#else
 	#else
 	mixin PPBase;
 	mixin PPBase;
 	#endif
 	#endif
-	
+		
 	variations
 	variations
 	{
 	{
 		VOLUME_LUT = { true, false };
 		VOLUME_LUT = { true, false };

+ 2 - 0
Data/Raw/Engine/Shaders/PPEyeAdaptHistogram.bsl

@@ -2,6 +2,8 @@
 
 
 technique PPEyeAdaptHistogram
 technique PPEyeAdaptHistogram
 {
 {
+	featureset = HighEnd;
+
 	code
 	code
 	{	
 	{	
 		[internal]
 		[internal]

+ 2 - 0
Data/Raw/Engine/Shaders/TiledDeferredImageBasedLighting.bsl

@@ -14,6 +14,8 @@ technique TiledDeferredImageBasedLighting
 	mixin ImageBasedLighting;
 	mixin ImageBasedLighting;
 	mixin ReflProbeAccumulatorIndexed;
 	mixin ReflProbeAccumulatorIndexed;
 
 
+	featureset = HighEnd;
+	
 	variations
 	variations
 	{
 	{
 		MSAA_COUNT = { 1, 2, 4, 8 };
 		MSAA_COUNT = { 1, 2, 4, 8 };

+ 2 - 0
Data/Raw/Engine/Shaders/TiledDeferredLighting.bsl

@@ -14,6 +14,8 @@ technique TiledDeferredLighting
 	mixin ReflectionCubemapCommon;
 	mixin ReflectionCubemapCommon;
 	mixin ImageBasedLighting;
 	mixin ImageBasedLighting;
 
 
+	featureset = HighEnd;
+	
 	variations
 	variations
 	{
 	{
 		MSAA_COUNT = { 1, 2, 4, 8 };
 		MSAA_COUNT = { 1, 2, 4, 8 };

+ 0 - 3
Source/BansheeCore/BsCorePrerequisites.h

@@ -213,9 +213,6 @@
 
 
 namespace bs 
 namespace bs 
 {
 {
-	static const StringID RenderAPIAny = "AnyRenderAPI";
-	static const StringID RendererAny = "AnyRenderer";
-
 	class Color;
 	class Color;
 	class GpuProgram;
 	class GpuProgram;
 	class GpuProgramManager;
 	class GpuProgramManager;

+ 18 - 21
Source/BansheeCore/Managers/BsGpuProgramManager.cpp

@@ -58,11 +58,6 @@ namespace bs
 		NullProgramFactory() {}
 		NullProgramFactory() {}
 		~NullProgramFactory() {}
 		~NullProgramFactory() {}
 
 
-		const String& getLanguage() const override
-		{ 
-			return sNullLang;
-		}
-
 		SPtr<GpuProgram> create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask) override
 		SPtr<GpuProgram> create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask) override
 		{
 		{
 			SPtr<NullProgram> ret = bs_shared_ptr_new<NullProgram>();
 			SPtr<NullProgram> ret = bs_shared_ptr_new<NullProgram>();
@@ -83,7 +78,7 @@ namespace bs
 	GpuProgramManager::GpuProgramManager()
 	GpuProgramManager::GpuProgramManager()
 	{
 	{
 		mNullFactory = bs_new<NullProgramFactory>();
 		mNullFactory = bs_new<NullProgramFactory>();
-		addFactory(mNullFactory);
+		addFactory(sNullLang, mNullFactory);
 	}
 	}
 
 
 	GpuProgramManager::~GpuProgramManager()
 	GpuProgramManager::~GpuProgramManager()
@@ -91,35 +86,37 @@ namespace bs
 		bs_delete((NullProgramFactory*)mNullFactory);
 		bs_delete((NullProgramFactory*)mNullFactory);
 	}
 	}
 
 
-	void GpuProgramManager::addFactory(GpuProgramFactory* factory)
+	void GpuProgramManager::addFactory(const String& language, GpuProgramFactory* factory)
 	{
 	{
-		mFactories[factory->getLanguage()] = factory;
+		Lock(mMutex);
+
+		mFactories[language] = factory;
 	}
 	}
 
 
-	void GpuProgramManager::removeFactory(GpuProgramFactory* factory)
+	void GpuProgramManager::removeFactory(const String& language)
 	{
 	{
-		FactoryMap::iterator it = mFactories.find(factory->getLanguage());
-		if (it != mFactories.end() && it->second == factory)
-		{
-			mFactories.erase(it);
-		}
+		Lock(mMutex);
+
+		auto iter = mFactories.find(language);
+		if (iter != mFactories.end())
+			mFactories.erase(iter);
 	}
 	}
 
 
 	GpuProgramFactory* GpuProgramManager::getFactory(const String& language)
 	GpuProgramFactory* GpuProgramManager::getFactory(const String& language)
 	{
 	{
-		FactoryMap::iterator i = mFactories.find(language);
-
-		if (i == mFactories.end())
-			i = mFactories.find(sNullLang);
+		auto iter = mFactories.find(language);
+		if (iter == mFactories.end())
+			iter = mFactories.find(sNullLang);
 
 
-		return i->second;
+		return iter->second;
 	}
 	}
 
 
 	bool GpuProgramManager::isLanguageSupported(const String& lang)
 	bool GpuProgramManager::isLanguageSupported(const String& lang)
 	{
 	{
-		FactoryMap::iterator i = mFactories.find(lang);
+		Lock(mMutex);
 
 
-		return i != mFactories.end();
+		auto iter = mFactories.find(lang);
+		return iter != mFactories.end();
 	}
 	}
 
 
 	SPtr<GpuProgram> GpuProgramManager::create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask)
 	SPtr<GpuProgram> GpuProgramManager::create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask)

+ 8 - 11
Source/BansheeCore/Managers/BsGpuProgramManager.h

@@ -38,12 +38,9 @@ namespace bs
 	class BS_CORE_EXPORT GpuProgramFactory
 	class BS_CORE_EXPORT GpuProgramFactory
 	{
 	{
 	public:
 	public:
-        GpuProgramFactory() {}
+		GpuProgramFactory() {}
 		virtual ~GpuProgramFactory() { }
 		virtual ~GpuProgramFactory() { }
 
 
-		/**	Returns GPU program language this factory is capable creating GPU programs from. */
-		virtual const String& getLanguage() const = 0;
-
 		/** @copydoc GpuProgram::create */
 		/** @copydoc GpuProgram::create */
 		virtual SPtr<GpuProgram> create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask = GDF_DEFAULT) = 0;
 		virtual SPtr<GpuProgram> create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask = GDF_DEFAULT) = 0;
 
 
@@ -55,7 +52,7 @@ namespace bs
 	 * Manager responsible for creating GPU programs. It will automatically	try to find the appropriate handler for a 
 	 * Manager responsible for creating GPU programs. It will automatically	try to find the appropriate handler for a 
 	 * specific GPU program language and create the program if possible.
 	 * specific GPU program language and create the program if possible.
 	 *
 	 *
-	 * @note	Core thread only.
+	 * @note	Core thread only unless otherwise specified.
 	 */
 	 */
 	class BS_CORE_EXPORT GpuProgramManager : public Module<GpuProgramManager>
 	class BS_CORE_EXPORT GpuProgramManager : public Module<GpuProgramManager>
 	{
 	{
@@ -67,16 +64,16 @@ namespace bs
 		 * Registers a new factory that is able to create GPU programs for a certain language. If any other factory for the
 		 * Registers a new factory that is able to create GPU programs for a certain language. If any other factory for the
 		 * same language exists, it will overwrite it.
 		 * same language exists, it will overwrite it.
 		 */
 		 */
-		void addFactory(GpuProgramFactory* factory);
+		void addFactory(const String& language, GpuProgramFactory* factory);
 
 
 		/**
 		/**
 		 * Unregisters a GPU program factory, essentially making it not possible to create GPU programs using the language 
 		 * Unregisters a GPU program factory, essentially making it not possible to create GPU programs using the language 
 		 * the factory supported.
 		 * the factory supported.
 		 */
 		 */
-		void removeFactory(GpuProgramFactory* factory);
+		void removeFactory(const String& language);
 
 
-		/** Query if a GPU program language is supported (for example "hlsl", "glsl"). */
-		bool isLanguageSupported(const String& lang);
+		/** Query if a GPU program language is supported (for example "hlsl", "glsl"). Thread safe. */
+		bool isLanguageSupported(const String& language);
 
 
 		/** @copydoc GpuProgram::create */
 		/** @copydoc GpuProgram::create */
 		SPtr<GpuProgram> create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask = GDF_DEFAULT);
 		SPtr<GpuProgram> create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask = GDF_DEFAULT);
@@ -95,9 +92,9 @@ namespace bs
 		GpuProgramFactory* getFactory(const String& language);
 		GpuProgramFactory* getFactory(const String& language);
 
 
 	protected:
 	protected:
-		typedef Map<String, GpuProgramFactory*> FactoryMap;
+		Mutex mMutex;
 
 
-		FactoryMap mFactories;
+		UnorderedMap<String, GpuProgramFactory*> mFactories;
 		GpuProgramFactory* mNullFactory; /**< Factory for dealing with GPU programs that can't be created. */
 		GpuProgramFactory* mNullFactory; /**< Factory for dealing with GPU programs that can't be created. */
 	};
 	};
 	}
 	}

+ 21 - 27
Source/BansheeCore/Material/BsTechnique.cpp

@@ -6,25 +6,21 @@
 #include "Renderer/BsRendererManager.h"
 #include "Renderer/BsRendererManager.h"
 #include "Material/BsPass.h"
 #include "Material/BsPass.h"
 #include "Renderer/BsRenderer.h"
 #include "Renderer/BsRenderer.h"
+#include "Managers/BsGpuProgramManager.h"
 #include "RTTI/BsTechniqueRTTI.h"
 #include "RTTI/BsTechniqueRTTI.h"
 
 
 namespace bs
 namespace bs
 {
 {
-	TechniqueBase::TechniqueBase(const String& language, const StringID& renderer, const Vector<StringID>& tags, 
-		const ShaderVariation& variation)
-		:mLanguage(language), mRenderer(renderer), mTags(tags), mVariation(variation)
+	TechniqueBase::TechniqueBase(const String& language, const Vector<StringID>& tags, const ShaderVariation& variation)
+		:mLanguage(language), mTags(tags), mVariation(variation)
 	{
 	{
 
 
 	}
 	}
 
 
 	bool TechniqueBase::isSupported() const
 	bool TechniqueBase::isSupported() const
 	{
 	{
-		if ((ct::RenderAPI::instancePtr()->getShadingLanguageName() == mLanguage || mLanguage == "Any") &&
-			(RendererManager::instance().getActive()->getName() == mRenderer ||
-			RendererAny == mRenderer))
-		{
+		if (ct::GpuProgramManager::instance().isLanguageSupported(mLanguage) || mLanguage == "Any")
 			return true;
 			return true;
-		}
 
 
 		return false;
 		return false;
 	}
 	}
@@ -41,14 +37,14 @@ namespace bs
 	}
 	}
 
 
 	template<bool Core>
 	template<bool Core>
-	TTechnique<Core>::TTechnique(const String& language, const StringID& renderer, const Vector<StringID>& tags,
+	TTechnique<Core>::TTechnique(const String& language, const Vector<StringID>& tags,
 		const ShaderVariation& variation, const Vector<SPtr<PassType>>& passes)
 		const ShaderVariation& variation, const Vector<SPtr<PassType>>& passes)
-		: TechniqueBase(language, renderer, tags, variation), mPasses(passes)
+		: TechniqueBase(language, tags, variation), mPasses(passes)
 	{ }
 	{ }
 
 
 	template<bool Core>
 	template<bool Core>
 	TTechnique<Core>::TTechnique()
 	TTechnique<Core>::TTechnique()
-		: TechniqueBase("", "", {}, ShaderVariation())
+		: TechniqueBase("", {}, ShaderVariation())
 	{ }
 	{ }
 
 
 	template<bool Core>
 	template<bool Core>
@@ -63,9 +59,9 @@ namespace bs
 	template class TTechnique < false > ;
 	template class TTechnique < false > ;
 	template class TTechnique < true >;
 	template class TTechnique < true >;
 
 
-	Technique::Technique(const String& language, const StringID& renderer, const Vector<StringID>& tags,
+	Technique::Technique(const String& language, const Vector<StringID>& tags,
 		const ShaderVariation& variation, const Vector<SPtr<Pass>>& passes)
 		const ShaderVariation& variation, const Vector<SPtr<Pass>>& passes)
-		:TTechnique(language, renderer, tags, variation, passes)
+		:TTechnique(language, tags, variation, passes)
 	{ }
 	{ }
 
 
 	Technique::Technique()
 	Technique::Technique()
@@ -85,7 +81,6 @@ namespace bs
 
 
 		ct::Technique* technique = new(bs_alloc<ct::Technique>()) ct::Technique(
 		ct::Technique* technique = new(bs_alloc<ct::Technique>()) ct::Technique(
 			mLanguage,
 			mLanguage,
-			mRenderer,
 			mTags,
 			mTags,
 			mVariation,
 			mVariation,
 			passes);
 			passes);
@@ -102,9 +97,9 @@ namespace bs
 			dependencies.push_back(pass.get());
 			dependencies.push_back(pass.get());
 	}
 	}
 
 
-	SPtr<Technique> Technique::create(const String& language, const StringID& renderer, const Vector<SPtr<Pass>>& passes)
+	SPtr<Technique> Technique::create(const String& language, const Vector<SPtr<Pass>>& passes)
 	{
 	{
-		Technique* technique = new (bs_alloc<Technique>()) Technique(language, renderer, {}, ShaderVariation(), passes);
+		Technique* technique = new (bs_alloc<Technique>()) Technique(language, {}, ShaderVariation(), passes);
 		SPtr<Technique> techniquePtr = bs_core_ptr<Technique>(technique);
 		SPtr<Technique> techniquePtr = bs_core_ptr<Technique>(technique);
 		techniquePtr->_setThisPtr(techniquePtr);
 		techniquePtr->_setThisPtr(techniquePtr);
 		techniquePtr->initialize();
 		techniquePtr->initialize();
@@ -112,10 +107,10 @@ namespace bs
 		return techniquePtr;
 		return techniquePtr;
 	}
 	}
 
 
-	SPtr<Technique> Technique::create(const String& language, const StringID& renderer, const Vector<StringID>& tags,
+	SPtr<Technique> Technique::create(const String& language, const Vector<StringID>& tags,
 		const ShaderVariation& variation, const Vector<SPtr<Pass>>& passes)
 		const ShaderVariation& variation, const Vector<SPtr<Pass>>& passes)
 	{
 	{
-		Technique* technique = new (bs_alloc<Technique>()) Technique(language, renderer, tags, variation, passes);
+		Technique* technique = new (bs_alloc<Technique>()) Technique(language, tags, variation, passes);
 		SPtr<Technique> techniquePtr = bs_core_ptr<Technique>(technique);
 		SPtr<Technique> techniquePtr = bs_core_ptr<Technique>(technique);
 		techniquePtr->_setThisPtr(techniquePtr);
 		techniquePtr->_setThisPtr(techniquePtr);
 		techniquePtr->initialize();
 		techniquePtr->initialize();
@@ -144,15 +139,14 @@ namespace bs
 
 
 	namespace ct
 	namespace ct
 	{
 	{
-	Technique::Technique(const String& language, const StringID& renderer, const Vector<StringID>& tags,
-		const ShaderVariation& variation, const Vector<SPtr<Pass>>& passes)
-		:TTechnique(language, renderer, tags, variation, passes)
+	Technique::Technique(const String& language, const Vector<StringID>& tags, const ShaderVariation& variation, 
+		const Vector<SPtr<Pass>>& passes)
+		:TTechnique(language, tags, variation, passes)
 	{ }
 	{ }
 
 
-	SPtr<Technique> Technique::create(const String& language, const StringID& renderer,
-		const Vector<SPtr<Pass>>& passes)
+	SPtr<Technique> Technique::create(const String& language, const Vector<SPtr<Pass>>& passes)
 	{
 	{
-		Technique* technique = new (bs_alloc<Technique>()) Technique(language, renderer, {}, ShaderVariation(), passes);
+		Technique* technique = new (bs_alloc<Technique>()) Technique(language, {}, ShaderVariation(), passes);
 		SPtr<Technique> techniquePtr = bs_shared_ptr<Technique>(technique);
 		SPtr<Technique> techniquePtr = bs_shared_ptr<Technique>(technique);
 		techniquePtr->_setThisPtr(techniquePtr);
 		techniquePtr->_setThisPtr(techniquePtr);
 		techniquePtr->initialize();
 		techniquePtr->initialize();
@@ -160,10 +154,10 @@ namespace bs
 		return techniquePtr;
 		return techniquePtr;
 	}
 	}
 
 
-	SPtr<Technique> Technique::create(const String& language, const StringID& renderer,
-		const Vector<StringID>& tags, const ShaderVariation& variation, const Vector<SPtr<Pass>>& passes)
+	SPtr<Technique> Technique::create(const String& language, const Vector<StringID>& tags, 
+		const ShaderVariation& variation, const Vector<SPtr<Pass>>& passes)
 	{
 	{
-		Technique* technique = new (bs_alloc<Technique>()) Technique(language, renderer, tags, variation, passes);
+		Technique* technique = new (bs_alloc<Technique>()) Technique(language, tags, variation, passes);
 		SPtr<Technique> techniquePtr = bs_shared_ptr<Technique>(technique);
 		SPtr<Technique> techniquePtr = bs_shared_ptr<Technique>(technique);
 		techniquePtr->_setThisPtr(techniquePtr);
 		techniquePtr->_setThisPtr(techniquePtr);
 		techniquePtr->initialize();
 		techniquePtr->initialize();

+ 12 - 19
Source/BansheeCore/Material/BsTechnique.h

@@ -18,8 +18,7 @@ namespace bs
 	class BS_CORE_EXPORT TechniqueBase
 	class BS_CORE_EXPORT TechniqueBase
 	{
 	{
 	public:
 	public:
-		TechniqueBase(const String& language, const StringID& renderer, const Vector<StringID>& tags, 
-			const ShaderVariation& variation);
+		TechniqueBase(const String& language, const Vector<StringID>& tags, const ShaderVariation& variation);
 		virtual ~TechniqueBase() { }
 		virtual ~TechniqueBase() { }
 
 
 		/**	Checks if this technique is supported based on current render and other systems. */
 		/**	Checks if this technique is supported based on current render and other systems. */
@@ -36,7 +35,6 @@ namespace bs
 
 
 	protected:
 	protected:
 		String mLanguage;
 		String mLanguage;
-		StringID mRenderer;
 		Vector<StringID> mTags;
 		Vector<StringID> mTags;
 		ShaderVariation mVariation;
 		ShaderVariation mVariation;
 	};
 	};
@@ -57,8 +55,8 @@ namespace bs
 		typedef typename TPassType<Core>::Type PassType;
 		typedef typename TPassType<Core>::Type PassType;
 		
 		
 		TTechnique();
 		TTechnique();
-		TTechnique(const String& language, const StringID& renderer, const Vector<StringID>& tags, 
-			const ShaderVariation& variation, const Vector<SPtr<PassType>>& passes);
+		TTechnique(const String& language, const Vector<StringID>& tags, const ShaderVariation& variation, 
+			const Vector<SPtr<PassType>>& passes);
 		virtual ~TTechnique() { }
 		virtual ~TTechnique() { }
 
 
 		/**	Returns a pass with the specified index. */
 		/**	Returns a pass with the specified index. */
@@ -90,8 +88,8 @@ namespace bs
 	class BS_CORE_EXPORT Technique : public IReflectable, public CoreObject, public TTechnique<false>
 	class BS_CORE_EXPORT Technique : public IReflectable, public CoreObject, public TTechnique<false>
 	{
 	{
 	public:
 	public:
-		Technique(const String& language, const StringID& renderer, const Vector<StringID>& tags,
-			const ShaderVariation& variation, const Vector<SPtr<Pass>>& passes);
+		Technique(const String& language, const Vector<StringID>& tags, const ShaderVariation& variation, 
+			const Vector<SPtr<Pass>>& passes);
 
 
 		/** Retrieves an implementation of a technique usable only from the core thread. */
 		/** Retrieves an implementation of a technique usable only from the core thread. */
 		SPtr<ct::Technique> getCore() const;
 		SPtr<ct::Technique> getCore() const;
@@ -101,20 +99,16 @@ namespace bs
 		 *
 		 *
 		 * @param[in]	language	Shading language used by the technique. The engine will not use this technique unless
 		 * @param[in]	language	Shading language used by the technique. The engine will not use this technique unless
 		 *							this language is supported by the render API.
 		 *							this language is supported by the render API.
-		 * @param[in]	renderer	Renderer the technique supports. Under normal circumstances the engine will not use
-		 *							this technique unless this renderer is enabled.
 		 * @param[in]	passes		A set of passes that define the technique.
 		 * @param[in]	passes		A set of passes that define the technique.
 		 * @return					Newly creted technique.
 		 * @return					Newly creted technique.
 		 */
 		 */
-		static SPtr<Technique> create(const String& language, const StringID& renderer, const Vector<SPtr<Pass>>& passes);
+		static SPtr<Technique> create(const String& language, const Vector<SPtr<Pass>>& passes);
 
 
 		/** 
 		/** 
 		 * Creates a new technique. 
 		 * Creates a new technique. 
 		 *
 		 *
 		 * @param[in]	language	Shading language used by the technique. The engine will not use this technique unless
 		 * @param[in]	language	Shading language used by the technique. The engine will not use this technique unless
 		 *							this language is supported by the render API.
 		 *							this language is supported by the render API.
-		 * @param[in]	renderer	Renderer the technique supports. Under normal circumstances the engine will not use
-		 *							this technique unless this renderer is enabled.
 		 * @param[in]	tags		An optional set of tags that can be used for further identifying under which 
 		 * @param[in]	tags		An optional set of tags that can be used for further identifying under which 
 		 *							circumstances should a technique be used.
 		 *							circumstances should a technique be used.
 		 * @param[in]	variation	A set of preprocessor directives that were used for compiling this particular technique.
 		 * @param[in]	variation	A set of preprocessor directives that were used for compiling this particular technique.
@@ -122,7 +116,7 @@ namespace bs
 		 * @param[in]	passes		A set of passes that define the technique.
 		 * @param[in]	passes		A set of passes that define the technique.
 		 * @return					Newly creted technique.
 		 * @return					Newly creted technique.
 		 */
 		 */
-		static SPtr<Technique> create(const String& language, const StringID& renderer, const Vector<StringID>& tags,
+		static SPtr<Technique> create(const String& language, const Vector<StringID>& tags,
 			const ShaderVariation& variation, const Vector<SPtr<Pass>>& passes);
 			const ShaderVariation& variation, const Vector<SPtr<Pass>>& passes);
 
 
 	protected:
 	protected:
@@ -161,18 +155,17 @@ namespace bs
 	class BS_CORE_EXPORT Technique : public CoreObject, public TTechnique<true>
 	class BS_CORE_EXPORT Technique : public CoreObject, public TTechnique<true>
 	{
 	{
 	public:
 	public:
-		Technique(const String& language, const StringID& renderer, const Vector<StringID>& tags,
+		Technique(const String& language, const Vector<StringID>& tags,
 			const ShaderVariation& variation, const Vector<SPtr<Pass>>& passes);
 			const ShaderVariation& variation, const Vector<SPtr<Pass>>& passes);
 
 
-		/** @copydoc bs::Technique::create(const String&, const StringID&, const Vector<SPtr<Pass>>&) */
-		static SPtr<Technique> create(const String& language, const StringID& renderer,
-			const Vector<SPtr<Pass>>& passes);
+		/** @copydoc bs::Technique::create(const String&, const Vector<SPtr<Pass>>&) */
+		static SPtr<Technique> create(const String& language, const Vector<SPtr<Pass>>& passes);
 
 
 		/** 
 		/** 
-		 * @copydoc bs::Technique::create(const String&, const StringID&, const Vector<StringID>&, 
+		 * @copydoc bs::Technique::create(const String&, const Vector<StringID>&, 
 		 *				const ShaderVariation&, const Vector<SPtr<Pass>>&) 
 		 *				const ShaderVariation&, const Vector<SPtr<Pass>>&) 
 		 */
 		 */
-		static SPtr<Technique> create(const String& language, const StringID& renderer, const Vector<StringID>& tags,
+		static SPtr<Technique> create(const String& language, const Vector<StringID>& tags,
 			const ShaderVariation& variation, const Vector<SPtr<Pass>>& passes);
 			const ShaderVariation& variation, const Vector<SPtr<Pass>>& passes);
 	};
 	};
 
 

+ 1 - 1
Source/BansheeCore/RTTI/BsTechniqueRTTI.h

@@ -17,7 +17,7 @@ namespace bs
 	{
 	{
 	private:
 	private:
 		BS_BEGIN_RTTI_MEMBERS
 		BS_BEGIN_RTTI_MEMBERS
-			BS_RTTI_MEMBER_PLAIN(mRenderer, 1)
+			//BS_RTTI_MEMBER_PLAIN(mRenderer, 1)
 			BS_RTTI_MEMBER_REFLPTR_ARRAY(mPasses, 2)
 			BS_RTTI_MEMBER_REFLPTR_ARRAY(mPasses, 2)
 			BS_RTTI_MEMBER_PLAIN_ARRAY(mTags, 3)
 			BS_RTTI_MEMBER_PLAIN_ARRAY(mTags, 3)
 			BS_RTTI_MEMBER_PLAIN(mLanguage, 4)
 			BS_RTTI_MEMBER_PLAIN(mLanguage, 4)

+ 0 - 7
Source/BansheeCore/RenderAPI/BsRenderAPI.h

@@ -279,13 +279,6 @@ namespace bs
 		 */
 		 */
 		virtual const StringID& getName() const = 0;
 		virtual const StringID& getName() const = 0;
 
 
-		/**
-		 * Gets the name of the primary shading language used by the rendering system.
-		 *
-		 * @note	Thread safe.
-		 */
-		virtual const String& getShadingLanguageName() const = 0;
-
 		/**
 		/**
 		 * Applies a set of parameters that control execution of all currently bound GPU programs. These are the uniforms
 		 * Applies a set of parameters that control execution of all currently bound GPU programs. These are the uniforms
 		 * like textures, samplers, or uniform buffers. Caller is expected to ensure the provided parameters actually
 		 * like textures, samplers, or uniform buffers. Caller is expected to ensure the provided parameters actually

+ 0 - 4
Source/BansheeCore/Utility/BsCommonTypes.h

@@ -213,15 +213,11 @@ namespace bs
 		 * GPU program.
 		 * GPU program.
 		 */
 		 */
 		GBT_STRUCTURED,
 		GBT_STRUCTURED,
-		/** Buffer containing raw bytes. It is up to the user to interpret the data. */
-		GBT_RAW,
 		/**
 		/**
 		 * Special type of buffer allowing you to specify arguments for draw operations inside the buffer instead of 
 		 * Special type of buffer allowing you to specify arguments for draw operations inside the buffer instead of 
 		 * providing them directly. Useful when you want to control drawing directly from GPU.
 		 * providing them directly. Useful when you want to control drawing directly from GPU.
 		 */
 		 */
 		GBT_INDIRECTARGUMENT,
 		GBT_INDIRECTARGUMENT,
-		/** A stack-like buffer that allows you to add or remove elements to/from the buffer from within the GPU program. */
-		GBT_APPENDCONSUME
 	};
 	};
 
 
 	/** Types of valid formats used for standard GPU buffers. */
 	/** Types of valid formats used for standard GPU buffers. */

+ 0 - 6
Source/BansheeD3D11RenderAPI/BsD3D11GpuBuffer.cpp

@@ -44,15 +44,9 @@ namespace bs { namespace ct
 		case GBT_STRUCTURED:
 		case GBT_STRUCTURED:
 			bufferType = D3D11HardwareBuffer::BT_STRUCTURED;
 			bufferType = D3D11HardwareBuffer::BT_STRUCTURED;
 			break;
 			break;
-		case GBT_RAW:
-			bufferType = D3D11HardwareBuffer::BT_RAW;
-			break;
 		case GBT_INDIRECTARGUMENT:
 		case GBT_INDIRECTARGUMENT:
 			bufferType = D3D11HardwareBuffer::BT_INDIRECTARGUMENT;
 			bufferType = D3D11HardwareBuffer::BT_INDIRECTARGUMENT;
 			break;
 			break;
-		case GBT_APPENDCONSUME:
-			bufferType = D3D11HardwareBuffer::BT_APPENDCONSUME;
-			break;
 		default:
 		default:
 			BS_EXCEPT(InvalidParametersException, "Unsupported buffer type " + toString(props.getType()));
 			BS_EXCEPT(InvalidParametersException, "Unsupported buffer type " + toString(props.getType()));
 		}
 		}

+ 0 - 25
Source/BansheeD3D11RenderAPI/BsD3D11GpuBufferView.cpp

@@ -69,9 +69,6 @@ namespace bs { namespace ct
 	{
 	{
 		const GpuBufferProperties& props = buffer->getProperties();
 		const GpuBufferProperties& props = buffer->getProperties();
 
 
-		if (props.getType() == GBT_APPENDCONSUME)
-			BS_EXCEPT(InvalidParametersException, "Cannot create ShaderResourceView for an append/consume buffer.");
-
 		D3D11_SHADER_RESOURCE_VIEW_DESC desc;
 		D3D11_SHADER_RESOURCE_VIEW_DESC desc;
 		ZeroMemory(&desc, sizeof(desc));
 		ZeroMemory(&desc, sizeof(desc));
 
 
@@ -89,14 +86,6 @@ namespace bs { namespace ct
 			desc.Buffer.FirstElement = firstElement;
 			desc.Buffer.FirstElement = firstElement;
 			desc.Buffer.NumElements = numElements;
 			desc.Buffer.NumElements = numElements;
 		}
 		}
-		else if (props.getType() == GBT_RAW)
-		{
-			desc.Format = DXGI_FORMAT_R32_TYPELESS;
-			desc.ViewDimension = D3D11_SRV_DIMENSION_BUFFEREX;
-			desc.BufferEx.Flags = D3D11_BUFFEREX_SRV_FLAG_RAW;
-			desc.BufferEx.FirstElement = firstElement;
-			desc.BufferEx.NumElements = numElements;
-		}
 		else if (props.getType() == GBT_INDIRECTARGUMENT)
 		else if (props.getType() == GBT_INDIRECTARGUMENT)
 		{
 		{
 			desc.Format = DXGI_FORMAT_R32_UINT;
 			desc.Format = DXGI_FORMAT_R32_UINT;
@@ -151,13 +140,6 @@ namespace bs { namespace ct
 			else
 			else
 				desc.Buffer.Flags = 0;
 				desc.Buffer.Flags = 0;
 		}
 		}
-		else if (props.getType() == GBT_RAW)
-		{
-			desc.Format = DXGI_FORMAT_R32_TYPELESS;
-			desc.Buffer.Flags = D3D11_BUFFER_UAV_FLAG_RAW;
-			desc.Buffer.FirstElement = firstElement;
-			desc.Buffer.NumElements = numElements;
-		}
 		else if (props.getType() == GBT_INDIRECTARGUMENT)
 		else if (props.getType() == GBT_INDIRECTARGUMENT)
 		{
 		{
 			desc.Format = DXGI_FORMAT_R32_UINT;
 			desc.Format = DXGI_FORMAT_R32_UINT;
@@ -165,13 +147,6 @@ namespace bs { namespace ct
 			desc.Buffer.FirstElement = firstElement;
 			desc.Buffer.FirstElement = firstElement;
 			desc.Buffer.NumElements = numElements;
 			desc.Buffer.NumElements = numElements;
 		}
 		}
-		else if (props.getType() == GBT_APPENDCONSUME)
-		{
-			desc.Format = DXGI_FORMAT_UNKNOWN;
-			desc.Buffer.Flags = D3D11_BUFFER_UAV_FLAG_APPEND;
-			desc.Buffer.FirstElement = firstElement;
-			desc.Buffer.NumElements = numElements;
-		}
 
 
 		ID3D11UnorderedAccessView* uav = nullptr;
 		ID3D11UnorderedAccessView* uav = nullptr;
 
 

+ 10 - 5
Source/BansheeD3D11RenderAPI/BsD3D11GpuProgram.cpp

@@ -134,14 +134,19 @@ namespace bs { namespace ct
 			source.c_str(),		// [in] Pointer to the shader in memory. 
 			source.c_str(),		// [in] Pointer to the shader in memory. 
 			source.size(),		// [in] Size of the shader in memory.  
 			source.size(),		// [in] Size of the shader in memory.  
 			nullptr,			// [in] The name of the file that contains the shader code. 
 			nullptr,			// [in] The name of the file that contains the shader code. 
-			defines,			// [in] Optional. Pointer to a NULL-terminated array of macro definitions. See D3D_SHADER_MACRO. If not used, set this to NULL. 
-			nullptr,			// [in] Optional. Pointer to an ID3DInclude Interface interface for handling include files. Setting this to NULL will cause a compile error if a shader contains a #include. 
+			defines,			// [in] Optional. Pointer to a NULL-terminated array of macro definitions. 
+								//		See D3D_SHADER_MACRO. If not used, set this to NULL. 
+			nullptr,			// [in] Optional. Pointer to an ID3DInclude Interface interface for handling include files. 
+								//		Setting this to NULL will cause a compile error if a shader contains a #include. 
 			entryPoint.c_str(),	// [in] Name of the shader-entrypoint function where shader execution begins. 
 			entryPoint.c_str(),	// [in] Name of the shader-entrypoint function where shader execution begins. 
-			profile.c_str(),// [in] A string that specifies the shader model; can be any profile in shader model 4 or higher. 
+			profile.c_str(),	// [in] A string that specifies the shader model; can be any profile in shader model 4 or higher. 
 			compileFlags,		// [in] Effect compile flags - no D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY at the first try...
 			compileFlags,		// [in] Effect compile flags - no D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY at the first try...
 			0,					// [in] Effect compile flags
 			0,					// [in] Effect compile flags
-			&microCode,			// [out] A pointer to an ID3DBlob Interface which contains the compiled shader, as well as any embedded debug and symbol-table information. 
-			&messages			// [out] A pointer to an ID3DBlob Interface which contains a listing of errors and warnings that occurred during compilation. These errors and warnings are identical to the the debug output from a debugger.
+			&microCode,			// [out] A pointer to an ID3DBlob Interface which contains the compiled shader, as well as
+								//		 any embedded debug and symbol-table information. 
+			&messages			// [out] A pointer to an ID3DBlob Interface which contains a listing of errors and warnings
+								//		 that occurred during compilation. These errors and warnings are identical to the 
+								//		 debug output from a debugger.
 			);
 			);
 
 
 		if (messages != nullptr)
 		if (messages != nullptr)

+ 6 - 15
Source/BansheeD3D11RenderAPI/BsD3D11HLSLProgramFactory.cpp

@@ -5,23 +5,14 @@
 
 
 namespace bs { namespace ct
 namespace bs { namespace ct
 {
 {
-    const String D3D11HLSLProgramFactory::LANGUAGE_NAME = "hlsl";
+	D3D11HLSLProgramFactory::D3D11HLSLProgramFactory()
+	{ }
 
 
-    D3D11HLSLProgramFactory::D3D11HLSLProgramFactory()
-    {
-    }
-
-    D3D11HLSLProgramFactory::~D3D11HLSLProgramFactory()
-    {
-    }
-
-    const String& D3D11HLSLProgramFactory::getLanguage(void) const
-    {
-        return LANGUAGE_NAME;
-    }
+	D3D11HLSLProgramFactory::~D3D11HLSLProgramFactory()
+	{ }
 
 
 	SPtr<GpuProgram> D3D11HLSLProgramFactory::create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask)
 	SPtr<GpuProgram> D3D11HLSLProgramFactory::create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask)
-    {
+	{
 		SPtr<GpuProgram> gpuProg;
 		SPtr<GpuProgram> gpuProg;
 
 
 		switch (desc.type)
 		switch (desc.type)
@@ -56,7 +47,7 @@ namespace bs { namespace ct
 			gpuProg->_setThisPtr(gpuProg);
 			gpuProg->_setThisPtr(gpuProg);
 
 
 		return gpuProg;
 		return gpuProg;
-    }
+	}
 
 
 	SPtr<GpuProgram> D3D11HLSLProgramFactory::create(GpuProgramType type, GpuDeviceFlags deviceMask)
 	SPtr<GpuProgram> D3D11HLSLProgramFactory::create(GpuProgramType type, GpuDeviceFlags deviceMask)
 	{
 	{

+ 0 - 3
Source/BansheeD3D11RenderAPI/BsD3D11HLSLProgramFactory.h

@@ -18,9 +18,6 @@ namespace bs { namespace ct
 		D3D11HLSLProgramFactory();
 		D3D11HLSLProgramFactory();
 		~D3D11HLSLProgramFactory();
 		~D3D11HLSLProgramFactory();
 
 
-		/** @copydoc GpuProgramFactory::getLanguage */
-		const String& getLanguage() const override;
-
 		/** @copydoc GpuProgramFactory::create(const GPU_PROGRAM_DESC&, GpuDeviceFlags) */
 		/** @copydoc GpuProgramFactory::create(const GPU_PROGRAM_DESC&, GpuDeviceFlags) */
 		SPtr<GpuProgram> create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask = GDF_DEFAULT) override;
 		SPtr<GpuProgram> create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask = GDF_DEFAULT) override;
 
 

+ 1 - 7
Source/BansheeD3D11RenderAPI/BsD3D11RenderAPI.cpp

@@ -52,12 +52,6 @@ namespace bs { namespace ct
 		return strName;
 		return strName;
 	}
 	}
 
 
-	const String& D3D11RenderAPI::getShadingLanguageName() const
-	{
-		static String strName("hlsl");
-		return strName;
-	}
-
 	void D3D11RenderAPI::initialize()
 	void D3D11RenderAPI::initialize()
 	{
 	{
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
@@ -130,7 +124,7 @@ namespace bs { namespace ct
 		mCurrentCapabilities = bs_newN<RenderAPICapabilities>(mNumDevices);
 		mCurrentCapabilities = bs_newN<RenderAPICapabilities>(mNumDevices);
 		initCapabilites(selectedAdapter, mCurrentCapabilities[0]);
 		initCapabilites(selectedAdapter, mCurrentCapabilities[0]);
 				
 				
-		GpuProgramManager::instance().addFactory(mHLSLFactory);
+		GpuProgramManager::instance().addFactory("hlsl", mHLSLFactory);
 
 
 		mIAManager = bs_new<D3D11InputLayoutManager>();
 		mIAManager = bs_new<D3D11InputLayoutManager>();
 
 

+ 0 - 3
Source/BansheeD3D11RenderAPI/BsD3D11RenderAPI.h

@@ -21,9 +21,6 @@ namespace bs { namespace ct
 		/** @copydoc RenderAPI::getName */
 		/** @copydoc RenderAPI::getName */
 		const StringID& getName() const override;
 		const StringID& getName() const override;
 		
 		
-		/** @copydoc RenderAPI::getShadingLanguageName */
-		const String& getShadingLanguageName() const override;
-
 		/** @copydoc RenderAPI::setGraphicsPipeline */
 		/** @copydoc RenderAPI::setGraphicsPipeline */
 		void setGraphicsPipeline(const SPtr<GraphicsPipelineState>& pipelineState, 
 		void setGraphicsPipeline(const SPtr<GraphicsPipelineState>& pipelineState, 
 			const SPtr<CommandBuffer>& commandBuffer = nullptr) override;
 			const SPtr<CommandBuffer>& commandBuffer = nullptr) override;

+ 1 - 1
Source/BansheeGLRenderAPI/BsGLGpuBuffer.cpp

@@ -12,7 +12,7 @@ namespace bs { namespace ct
 	GLGpuBuffer::GLGpuBuffer(const GPU_BUFFER_DESC& desc, GpuDeviceFlags deviceMask)
 	GLGpuBuffer::GLGpuBuffer(const GPU_BUFFER_DESC& desc, GpuDeviceFlags deviceMask)
 		: GpuBuffer(desc, deviceMask), mTextureID(0), mFormat(0)
 		: GpuBuffer(desc, deviceMask), mTextureID(0), mFormat(0)
 	{
 	{
-		if(desc.type == GBT_APPENDCONSUME || desc.type == GBT_INDIRECTARGUMENT || desc.type == GBT_RAW)
+		if(desc.type == GBT_INDIRECTARGUMENT)
 			LOGERR("Only standard and structured buffers are supported on OpenGL.");
 			LOGERR("Only standard and structured buffers are supported on OpenGL.");
 
 
 		if (desc.useCounter)
 		if (desc.useCounter)

+ 16 - 12
Source/BansheeGLRenderAPI/BsGLRenderAPI.cpp

@@ -125,12 +125,6 @@ namespace bs { namespace ct
 		return strName;
 		return strName;
 	}
 	}
 
 
-	const String& GLRenderAPI::getShadingLanguageName() const
-	{
-		static String strName("glsl");
-		return strName;
-	}
-
 	void GLRenderAPI::initialize()
 	void GLRenderAPI::initialize()
 	{
 	{
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
@@ -206,7 +200,9 @@ namespace bs { namespace ct
 		if (mGLSLProgramFactory)
 		if (mGLSLProgramFactory)
 		{
 		{
 			// Remove from manager safely
 			// Remove from manager safely
-			GpuProgramManager::instance().removeFactory(mGLSLProgramFactory);
+			GpuProgramManager::instance().removeFactory("glsl");
+			GpuProgramManager::instance().removeFactory("glsl4_1");
+
 			bs_delete(mGLSLProgramFactory);
 			bs_delete(mGLSLProgramFactory);
 			mGLSLProgramFactory = nullptr;
 			mGLSLProgramFactory = nullptr;
 		}
 		}
@@ -2449,11 +2445,12 @@ namespace bs { namespace ct
 		HardwareBufferManager::startUp<GLHardwareBufferManager>();
 		HardwareBufferManager::startUp<GLHardwareBufferManager>();
 
 
 		// GPU Program Manager setup
 		// GPU Program Manager setup
-		if(caps->isShaderProfileSupported("glsl"))
-		{
-			mGLSLProgramFactory = bs_new<GLSLProgramFactory>();
-			GpuProgramManager::instance().addFactory(mGLSLProgramFactory);
-		}
+		mGLSLProgramFactory = bs_new<GLSLProgramFactory>();
+		if(caps->isShaderProfileSupported("glsl")) // Check for most recent GLSL support
+			GpuProgramManager::instance().addFactory("glsl", mGLSLProgramFactory);
+
+		if(caps->isShaderProfileSupported("glsl4_1")) // Check for OpenGL 4.1 compatible version
+			GpuProgramManager::instance().addFactory("glsl4_1", mGLSLProgramFactory);
 
 
 		GLRTTManager::startUp<GLRTTManager>();
 		GLRTTManager::startUp<GLRTTManager>();
 
 
@@ -2536,7 +2533,14 @@ namespace bs { namespace ct
 		else
 		else
 			caps.setVendor(GPU_UNKNOWN);
 			caps.setVendor(GPU_UNKNOWN);
 
 
+#if BS_OPENGL_4_1
+		caps.addShaderProfile("glsl4_1");
+#endif
+
+#if BS_OPENGL_4_5
 		caps.addShaderProfile("glsl");
 		caps.addShaderProfile("glsl");
+#endif
+
 		caps.setCapability(RSC_TEXTURE_COMPRESSION_BC);
 		caps.setCapability(RSC_TEXTURE_COMPRESSION_BC);
 
 
 #if BS_OPENGL_4_1 || BS_OPENGLES_3_2
 #if BS_OPENGL_4_1 || BS_OPENGLES_3_2

+ 0 - 3
Source/BansheeGLRenderAPI/BsGLRenderAPI.h

@@ -24,9 +24,6 @@ namespace bs { namespace ct
 		/** @copydoc RenderAPI::getName() */
 		/** @copydoc RenderAPI::getName() */
 		const StringID& getName() const override;
 		const StringID& getName() const override;
 
 
-		/** @copydoc RenderAPI::getShadingLanguageName() */
-		const String& getShadingLanguageName() const override;
-
 		/** @copydoc RenderAPI::setGraphicsPipeline */
 		/** @copydoc RenderAPI::setGraphicsPipeline */
 		void setGraphicsPipeline(const SPtr<GraphicsPipelineState>& pipelineState,
 		void setGraphicsPipeline(const SPtr<GraphicsPipelineState>& pipelineState,
 			const SPtr<CommandBuffer>& commandBuffer = nullptr) override;
 			const SPtr<CommandBuffer>& commandBuffer = nullptr) override;

+ 0 - 3
Source/BansheeGLRenderAPI/GLSL/BsGLSLGpuProgram.cpp

@@ -272,9 +272,6 @@ namespace bs { namespace ct
 		RenderAPI* rapi = RenderAPI::instancePtr();
 		RenderAPI* rapi = RenderAPI::instancePtr();
 		const RenderAPICapabilities& caps = rapi->getCapabilities(0);
 		const RenderAPICapabilities& caps = rapi->getCapabilities(0);
 
 
-		if(!caps.isShaderProfileSupported("glsl"))
-			return false;
-
 		switch (mProperties.getType())
 		switch (mProperties.getType())
 		{
 		{
 		case GPT_GEOMETRY_PROGRAM:
 		case GPT_GEOMETRY_PROGRAM:

+ 0 - 7
Source/BansheeGLRenderAPI/GLSL/BsGLSLProgramFactory.cpp

@@ -5,13 +5,6 @@
 
 
 namespace bs { namespace ct
 namespace bs { namespace ct
 {
 {
-	const String GLSLProgramFactory::LANGUAGE_NAME = "glsl";
-
-	const String& GLSLProgramFactory::getLanguage() const
-	{
-		return LANGUAGE_NAME;
-	}
-
 	SPtr<GpuProgram> GLSLProgramFactory::create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask)
 	SPtr<GpuProgram> GLSLProgramFactory::create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask)
 	{
 	{
 		GLSLGpuProgram* prog = new (bs_alloc<GLSLGpuProgram>()) GLSLGpuProgram(desc, deviceMask);
 		GLSLGpuProgram* prog = new (bs_alloc<GLSLGpuProgram>()) GLSLGpuProgram(desc, deviceMask);

+ 0 - 3
Source/BansheeGLRenderAPI/GLSL/BsGLSLProgramFactory.h

@@ -15,9 +15,6 @@ namespace bs { namespace ct
 	class GLSLProgramFactory : public GpuProgramFactory
 	class GLSLProgramFactory : public GpuProgramFactory
 	{
 	{
 	public:
 	public:
-		/** @copydoc GpuProgramFactory::getLanguage */
-		const String& getLanguage() const override;
-
 		/** @copydoc GpuProgramFactory::create(const GPU_PROGRAM_DESC&, GpuDeviceFlags) */
 		/** @copydoc GpuProgramFactory::create(const GPU_PROGRAM_DESC&, GpuDeviceFlags) */
 		SPtr<GpuProgram> create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask = GDF_DEFAULT) override;
 		SPtr<GpuProgram> create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask = GDF_DEFAULT) override;
 
 

+ 1 - 1
Source/BansheeSL/BsASTFX.c

@@ -18,7 +18,7 @@ OptionInfo OPTION_LOOKUP[] =
 	{ OT_Depth, ODT_Complex },
 	{ OT_Depth, ODT_Complex },
 	{ OT_Stencil, ODT_Complex },
 	{ OT_Stencil, ODT_Complex },
 	{ OT_Blend, ODT_Complex },
 	{ OT_Blend, ODT_Complex },
-	{ OT_Renderer, ODT_String }, 
+	{ OT_FeatureSet, ODT_String }, 
 	{ OT_Pass, ODT_Complex }, 
 	{ OT_Pass, ODT_Complex }, 
 	{ OT_FillMode, ODT_Int }, 
 	{ OT_FillMode, ODT_Int }, 
 	{ OT_CullMode, ODT_Int },
 	{ OT_CullMode, ODT_Int },

+ 1 - 1
Source/BansheeSL/BsASTFX.h

@@ -40,7 +40,7 @@ enum tagOptionType
 	OT_Depth,
 	OT_Depth,
 	OT_Stencil,
 	OT_Stencil,
 	OT_Blend,
 	OT_Blend,
-	OT_Renderer,
+	OT_FeatureSet,
 	OT_Pass,
 	OT_Pass,
 	OT_FillMode,
 	OT_FillMode,
 	OT_CullMode,
 	OT_CullMode,

+ 1 - 1
Source/BansheeSL/BsLexerFX.l

@@ -57,7 +57,7 @@ priority		{ return TOKEN_PRIORITY; }
 transparent		{ return TOKEN_TRANSPARENT; }
 transparent		{ return TOKEN_TRANSPARENT; }
 
 
 	/* Technique keywords */
 	/* Technique keywords */
-renderer		{ return TOKEN_RENDERER; }
+featureset		{ return TOKEN_FEATURESET; }
 tags			{ return TOKEN_TAGS; }
 tags			{ return TOKEN_TAGS; }
 pass			{ return TOKEN_PASS; }
 pass			{ return TOKEN_PASS; }
 variations		{ return TOKEN_VARIATIONS; }
 variations		{ return TOKEN_VARIATIONS; }

+ 5 - 5
Source/BansheeSL/BsParserFX.y

@@ -87,7 +87,7 @@ typedef struct YYLTYPE {
 %token TOKEN_SEPARABLE TOKEN_SORT TOKEN_PRIORITY TOKEN_TRANSPARENT
 %token TOKEN_SEPARABLE TOKEN_SORT TOKEN_PRIORITY TOKEN_TRANSPARENT
 	
 	
 	/* Technique keywords */
 	/* Technique keywords */
-%token TOKEN_RENDERER TOKEN_PASS TOKEN_TAGS TOKEN_VARIATIONS
+%token TOKEN_FEATURESET TOKEN_PASS TOKEN_TAGS TOKEN_VARIATIONS
 
 
 	/* Pass keywords */
 	/* Pass keywords */
 %token TOKEN_CODE TOKEN_BLEND TOKEN_RASTER TOKEN_DEPTH TOKEN_STENCIL
 %token TOKEN_CODE TOKEN_BLEND TOKEN_RASTER TOKEN_DEPTH TOKEN_STENCIL
@@ -243,10 +243,10 @@ technique_statement
 	;
 	;
 
 
 technique_option
 technique_option
-	: TOKEN_RENDERER '=' TOKEN_STRING ';'	{ $$.type = OT_Renderer; $$.value.strValue = $3; }
-	| TOKEN_MIXIN TOKEN_IDENTIFIER ';'		{ $$.type = OT_Mixin; $$.value.strValue = $2; }
-	| tags									{ $$.type = OT_Tags; $$.value.nodePtr = $1; }
-	| variations							{ $$.type = OT_Variations; $$.value.nodePtr = $1; }
+	: TOKEN_FEATURESET '=' TOKEN_IDENTIFIER ';'	{ $$.type = OT_FeatureSet; $$.value.strValue = $3; }
+	| TOKEN_MIXIN TOKEN_IDENTIFIER ';'			{ $$.type = OT_Mixin; $$.value.strValue = $2; }
+	| tags										{ $$.type = OT_Tags; $$.value.nodePtr = $1; }
+	| variations								{ $$.type = OT_Variations; $$.value.nodePtr = $1; }
 	;
 	;
 	
 	
 	/* Technique tags */
 	/* Technique tags */

+ 12 - 25
Source/BansheeSL/BsSLFXCompiler.cpp

@@ -744,11 +744,7 @@ namespace bs
 
 
 						if (entry.second.name == includes)
 						if (entry.second.name == includes)
 						{
 						{
-							bool matches =
-								(entry.second.language == metaData.language ||
-								entry.second.language == "Any") &&
-								(entry.second.renderer == metaData.renderer ||
-								entry.second.renderer == RendererAny);
+							bool matches = entry.second.language == metaData.language || entry.second.language == "Any";
 
 
 							// We want the last matching technique, in order to allow techniques to override each other
 							// We want the last matching technique, in order to allow techniques to override each other
 							if (matches)
 							if (matches)
@@ -1042,7 +1038,6 @@ namespace bs
 	{
 	{
 		TechniqueMetaData metaData;
 		TechniqueMetaData metaData;
 
 
-		metaData.renderer = RendererAny;
 		metaData.language = "hlsl";
 		metaData.language = "hlsl";
 		metaData.isMixin = technique->type == NT_Mixin;
 		metaData.isMixin = technique->type == NT_Mixin;
 
 
@@ -1052,9 +1047,6 @@ namespace bs
 
 
 			switch (option->type)
 			switch (option->type)
 			{
 			{
-			case OT_Renderer:
-				metaData.renderer = parseRenderer(removeQuotes(option->value.strValue));
-				break;
 			case OT_Tags:
 			case OT_Tags:
 			{
 			{
 				ASTFXNode* tagsNode = option->value.nodePtr;
 				ASTFXNode* tagsNode = option->value.nodePtr;
@@ -1079,6 +1071,9 @@ namespace bs
 				}
 				}
 			}
 			}
 				break;
 				break;
+			case OT_FeatureSet:
+				metaData.featureSet = option->value.strValue;
+				break;
 			case OT_Identifier:
 			case OT_Identifier:
 				metaData.name = option->value.strValue;
 				metaData.name = option->value.strValue;
 				break;
 				break;
@@ -1119,16 +1114,6 @@ namespace bs
 			metaData.variations.push_back(variationData);
 			metaData.variations.push_back(variationData);
 	}
 	}
 
 
-	StringID BSLFXCompiler::parseRenderer(const String& name)
-	{
-		if (name == "Any")
-			return RendererAny;
-		else if (name == "Default")
-			return RendererDefault;
-
-		return RendererAny;
-	}
-
 	QueueSortType BSLFXCompiler::parseSortType(CullAndSortModeValue sortType)
 	QueueSortType BSLFXCompiler::parseSortType(CullAndSortModeValue sortType)
 	{
 	{
 		switch (sortType)
 		switch (sortType)
@@ -1837,9 +1822,7 @@ namespace bs
 					{
 					{
 						bool matches = 
 						bool matches = 
 							(entry.second.metaData.language == metaData.language || 
 							(entry.second.metaData.language == metaData.language || 
-							entry.second.metaData.language == "Any") &&
-							(entry.second.metaData.renderer == metaData.renderer || 
-							entry.second.metaData.renderer == RendererAny);
+							entry.second.metaData.language == "Any");
 
 
 						// We want the last matching technique, in order to allow techniques to override each other
 						// We want the last matching technique, in order to allow techniques to override each other
 						if (matches)
 						if (matches)
@@ -1918,7 +1901,12 @@ namespace bs
 			TechniqueData& hlslTechnique = techniqueData[i].second;
 			TechniqueData& hlslTechnique = techniqueData[i].second;
 
 
 			TechniqueData glslTechnique = techniqueData[i].second;
 			TechniqueData glslTechnique = techniqueData[i].second;
-			glslTechnique.metaData.language = "glsl";
+
+			// When working with OpenGL, lower-end feature sets are supported. For other backends, high-end is always assumed.
+			if(glslTechnique.metaData.featureSet == "HighEnd")
+				glslTechnique.metaData.language = "glsl";
+			else
+				glslTechnique.metaData.language = "glsl4_1";
 
 
 			TechniqueData vkslTechnique = techniqueData[i].second;
 			TechniqueData vkslTechnique = techniqueData[i].second;
 			vkslTechnique.metaData.language = "vksl";
 			vkslTechnique.metaData.language = "vksl";
@@ -2078,8 +2066,7 @@ namespace bs
 
 
 			if (orderedPasses.size() > 0)
 			if (orderedPasses.size() > 0)
 			{
 			{
-				SPtr<Technique> technique = Technique::create(metaData.language, metaData.renderer, metaData.tags,
-					variation, orderedPasses);
+				SPtr<Technique> technique = Technique::create(metaData.language, metaData.tags, variation, orderedPasses);
 				techniques.push_back(technique);
 				techniques.push_back(technique);
 			}
 			}
 		}
 		}

+ 8 - 11
Source/BansheeSL/BsSLFXCompiler.h

@@ -76,7 +76,7 @@ namespace bs
 			bool isMixin;
 			bool isMixin;
 
 
 			String language;
 			String language;
-			StringID renderer = RendererAny;
+			String featureSet;
 
 
 			Vector<StringID> tags;
 			Vector<StringID> tags;
 			Vector<VariationData> variations;
 			Vector<VariationData> variations;
@@ -105,28 +105,25 @@ namespace bs
 		/** Parses technique variations and writes them to the provided meta-data object. */
 		/** Parses technique variations and writes them to the provided meta-data object. */
 		static void parseVariations(TechniqueMetaData& metaData, ASTFXNode* variations);
 		static void parseVariations(TechniqueMetaData& metaData, ASTFXNode* variations);
 
 
-		/**	Converts FX renderer name into an in-engine renderer identifier. */
-		static StringID parseRenderer(const String& name);
-
-		/**	Maps FX queue sort type enum into in-engine queue sort type mode. */
+		/**	Maps BSL queue sort type enum into in-engine queue sort type mode. */
 		static QueueSortType parseSortType(CullAndSortModeValue sortType);
 		static QueueSortType parseSortType(CullAndSortModeValue sortType);
 
 
-		/**	Maps FX comparison function enum into in-engine compare function. */
+		/**	Maps BSL comparison function enum into in-engine compare function. */
 		static CompareFunction parseCompFunc(CompFuncValue compFunc);
 		static CompareFunction parseCompFunc(CompFuncValue compFunc);
 
 
-		/**	Maps FX operation to in-engine blend factor. */
+		/**	Maps BSL operation to in-engine blend factor. */
 		static BlendFactor parseBlendFactor(OpValue factor);
 		static BlendFactor parseBlendFactor(OpValue factor);
 
 
-		/**	Maps FX blend operation to in-engine blend operation. */
+		/**	Maps BSL blend operation to in-engine blend operation. */
 		static BlendOperation parseBlendOp(BlendOpValue op);
 		static BlendOperation parseBlendOp(BlendOpValue op);
 
 
-		/**	Maps FX operation to in-engine stencil operation. */
+		/**	Maps BSL operation to in-engine stencil operation. */
 		static StencilOperation parseStencilOp(OpValue op);
 		static StencilOperation parseStencilOp(OpValue op);
 		
 		
-		/**	Maps FX cull mode enum to in-engine cull mode. */
+		/**	Maps BSL cull mode enum to in-engine cull mode. */
 		static CullingMode parseCullMode(CullAndSortModeValue cm);
 		static CullingMode parseCullMode(CullAndSortModeValue cm);
 
 
-		/**	Maps FX fill mode enum to in-engine fill mode. */
+		/**	Maps BSL fill mode enum to in-engine fill mode. */
 		static PolygonMode parseFillMode(FillModeValue fm);
 		static PolygonMode parseFillMode(FillModeValue fm);
 
 
 		/**
 		/**

+ 1 - 1
Source/BansheeUtility/Math/BsMath.h

@@ -112,7 +112,7 @@ namespace bs
 		 * positive. 
 		 * positive. 
 		 */
 		 */
 		template<class T>
 		template<class T>
-		static T divideAndRoundUp(T n, T d) { return (n + d - 1) / d; }
+		static constexpr T divideAndRoundUp(T n, T d) { return (n + d - 1) / d; }
 
 
 		/** Returns the nearest integer equal or lower of the provided value. */
 		/** Returns the nearest integer equal or lower of the provided value. */
 		static float floor(float val) { return (float)std::floor(val); }
 		static float floor(float val) { return (float)std::floor(val); }

+ 1 - 7
Source/BansheeVulkanRenderAPI/BsVulkanRenderAPI.cpp

@@ -101,12 +101,6 @@ namespace bs { namespace ct
 		return strName;
 		return strName;
 	}
 	}
 
 
-	const String& VulkanRenderAPI::getShadingLanguageName() const
-	{
-		static String strName("vksl");
-		return strName;
-	}
-
 	void VulkanRenderAPI::initialize()
 	void VulkanRenderAPI::initialize()
 	{
 	{
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;
@@ -277,7 +271,7 @@ namespace bs { namespace ct
 
 
 		// Create render state manager
 		// Create render state manager
 		RenderStateManager::startUp<VulkanRenderStateManager>();
 		RenderStateManager::startUp<VulkanRenderStateManager>();
-		GpuProgramManager::instance().addFactory(mGLSLFactory);
+		GpuProgramManager::instance().addFactory("vksl", mGLSLFactory);
 
 
 		initCapabilites();
 		initCapabilites();
 		
 		

+ 0 - 3
Source/BansheeVulkanRenderAPI/BsVulkanRenderAPI.h

@@ -21,9 +21,6 @@ namespace bs { namespace ct
 		/** @copydoc RenderAPI::getName */
 		/** @copydoc RenderAPI::getName */
 		const StringID& getName() const override;
 		const StringID& getName() const override;
 		
 		
-		/** @copydoc RenderAPI::getShadingLanguageName */
-		const String& getShadingLanguageName() const override;
-
 		/** @copydoc RenderAPI::setGraphicsPipeline */
 		/** @copydoc RenderAPI::setGraphicsPipeline */
 		void setGraphicsPipeline(const SPtr<GraphicsPipelineState>& pipelineState, 
 		void setGraphicsPipeline(const SPtr<GraphicsPipelineState>& pipelineState, 
 			const SPtr<CommandBuffer>& commandBuffer = nullptr) override;
 			const SPtr<CommandBuffer>& commandBuffer = nullptr) override;

+ 2 - 9
Source/BansheeVulkanRenderAPI/Managers/BsVulkanGLSLProgramFactory.cpp

@@ -8,8 +8,6 @@
 
 
 namespace bs { namespace ct
 namespace bs { namespace ct
 {
 {
-    const String VulkanGLSLProgramFactory::LANGUAGE_NAME = "vksl";
-
 	VulkanGLSLProgramFactory::VulkanGLSLProgramFactory()
 	VulkanGLSLProgramFactory::VulkanGLSLProgramFactory()
 	{
 	{
 		glslang::InitializeProcess();
 		glslang::InitializeProcess();
@@ -20,19 +18,14 @@ namespace bs { namespace ct
 		glslang::FinalizeProcess();
 		glslang::FinalizeProcess();
 	}
 	}
 
 
-    const String& VulkanGLSLProgramFactory::getLanguage() const
-    {
-        return LANGUAGE_NAME;
-    }
-
 	SPtr<GpuProgram> VulkanGLSLProgramFactory::create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask)
 	SPtr<GpuProgram> VulkanGLSLProgramFactory::create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask)
-    {
+	{
 		SPtr<GpuProgram> gpuProg = bs_shared_ptr<VulkanGpuProgram>(new (bs_alloc<VulkanGpuProgram>())
 		SPtr<GpuProgram> gpuProg = bs_shared_ptr<VulkanGpuProgram>(new (bs_alloc<VulkanGpuProgram>())
 			VulkanGpuProgram(desc, deviceMask));
 			VulkanGpuProgram(desc, deviceMask));
 		gpuProg->_setThisPtr(gpuProg);
 		gpuProg->_setThisPtr(gpuProg);
 
 
 		return gpuProg;
 		return gpuProg;
-    }
+	}
 
 
 	SPtr<GpuProgram> VulkanGLSLProgramFactory::create(GpuProgramType type, GpuDeviceFlags deviceMask)
 	SPtr<GpuProgram> VulkanGLSLProgramFactory::create(GpuProgramType type, GpuDeviceFlags deviceMask)
 	{
 	{

+ 0 - 3
Source/BansheeVulkanRenderAPI/Managers/BsVulkanGLSLProgramFactory.h

@@ -18,9 +18,6 @@ namespace bs { namespace ct
 		VulkanGLSLProgramFactory();
 		VulkanGLSLProgramFactory();
 		~VulkanGLSLProgramFactory();
 		~VulkanGLSLProgramFactory();
 
 
-		/** @copydoc GpuProgramFactory::getLanguage */
-		const String& getLanguage() const override;
-
 		/** @copydoc GpuProgramFactory::create(const GPU_PROGRAM_DESC&, GpuDeviceFlags) */
 		/** @copydoc GpuProgramFactory::create(const GPU_PROGRAM_DESC&, GpuDeviceFlags) */
 		SPtr<GpuProgram> create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask = GDF_DEFAULT) override;
 		SPtr<GpuProgram> create(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask = GDF_DEFAULT) override;
 
 

+ 12 - 8
Source/RenderBeast/BsLightProbes.cpp

@@ -759,12 +759,14 @@ namespace bs { namespace ct
 
 
 	void LightProbes::resizeTetrahedronBuffer(UINT32 count)
 	void LightProbes::resizeTetrahedronBuffer(UINT32 count)
 	{
 	{
+		static constexpr UINT32 ELEMENT_SIZE = Math::divideAndRoundUp(sizeof(TetrahedronDataGPU), 4ULL);
+
 		GPU_BUFFER_DESC desc;
 		GPU_BUFFER_DESC desc;
-		desc.type = GBT_STRUCTURED;
-		desc.elementSize = sizeof(TetrahedronDataGPU);
-		desc.elementCount = count;
+		desc.type = GBT_STANDARD;
+		desc.elementSize = 0;
+		desc.elementCount = count * ELEMENT_SIZE;
 		desc.usage = GBU_STATIC;
 		desc.usage = GBU_STATIC;
-		desc.format = BF_UNKNOWN;
+		desc.format = BF_32X4U;
 
 
 		mTetrahedronInfosGPU = GpuBuffer::create(desc);
 		mTetrahedronInfosGPU = GpuBuffer::create(desc);
 		mMaxTetrahedra = count;
 		mMaxTetrahedra = count;
@@ -772,12 +774,14 @@ namespace bs { namespace ct
 
 
 	void LightProbes::resizeTetrahedronFaceBuffer(UINT32 count)
 	void LightProbes::resizeTetrahedronFaceBuffer(UINT32 count)
 	{
 	{
+		static constexpr UINT32 ELEMENT_SIZE = Math::divideAndRoundUp(sizeof(TetrahedronFaceDataGPU), 4ULL);
+
 		GPU_BUFFER_DESC desc;
 		GPU_BUFFER_DESC desc;
-		desc.type = GBT_STRUCTURED;
-		desc.elementSize = sizeof(TetrahedronFaceDataGPU);
-		desc.elementCount = count;
+		desc.type = GBT_STANDARD;
+		desc.elementSize = 0;
+		desc.elementCount = count * ELEMENT_SIZE;
 		desc.usage = GBU_STATIC;
 		desc.usage = GBU_STATIC;
-		desc.format = BF_UNKNOWN;
+		desc.format = BF_32X4F;
 
 
 		mTetrahedronFaceInfosGPU = GpuBuffer::create(desc);
 		mTetrahedronFaceInfosGPU = GpuBuffer::create(desc);
 		mMaxFaces = count;
 		mMaxFaces = count;