Browse Source

Modified shader Techniques so they now depend on shader language rather than on render API (requires existing shader re-import)
Removed GPU program profiles (assuming 5.0 profile)
Making all GLSL shaders version 450 compatible

BearishSun 9 years ago
parent
commit
3703a767a6
28 changed files with 92 additions and 228 deletions
  1. BIN
      Data/Examples/Example.bsl.asset
  2. 1 1
      Data/Raw/Editor/Includes/PickingAlphaCull.bslinc
  3. 1 1
      Data/Raw/Editor/Shaders/GizmoPickingAlpha.bsl
  4. 2 2
      Data/Raw/Editor/Shaders/IconGizmo.bsl
  5. 1 1
      Data/Raw/Editor/Shaders/TextGizmo.bsl
  6. 0 1
      Data/Raw/Engine/Includes/DeferredPointLightPass.bslinc
  7. 1 1
      Data/Raw/Engine/Includes/SpriteImage.bslinc
  8. 0 2
      Data/Raw/Engine/Includes/VolumeRenderBase.bslinc
  9. 2 2
      Data/Raw/Engine/Shaders/Diffuse.bsl
  10. 2 4
      Data/Raw/Engine/Shaders/PPCreateTonemapLUT.bsl
  11. 7 7
      Data/Raw/Engine/Shaders/PPDownsample.bsl
  12. 1 1
      Data/Raw/Engine/Shaders/PPTonemapping.bsl
  13. 1 1
      Data/Raw/Engine/Shaders/SpriteText.bsl
  14. 1 7
      Source/BansheeCore/Include/BsGpuProgram.h
  15. 0 4
      Source/BansheeCore/Include/BsGpuProgramRTTI.h
  16. 0 24
      Source/BansheeCore/Include/BsRenderAPICapabilities.h
  17. 15 15
      Source/BansheeCore/Include/BsTechnique.h
  18. 1 1
      Source/BansheeCore/Include/BsTechniqueRTTI.h
  19. 5 10
      Source/BansheeCore/Source/BsGpuProgram.cpp
  20. 0 1
      Source/BansheeCore/Source/BsGpuProgramManager.cpp
  21. 18 19
      Source/BansheeCore/Source/BsTechnique.cpp
  22. 23 2
      Source/BansheeD3D11RenderAPI/Source/BsD3D11GpuProgram.cpp
  23. 0 33
      Source/BansheeD3D11RenderAPI/Source/BsD3D11RenderAPI.cpp
  24. 2 9
      Source/BansheeSL/Include/BsSLFXCompiler.h
  25. 4 62
      Source/BansheeSL/Source/BsSLFXCompiler.cpp
  26. 2 2
      Source/BansheeVulkanRenderAPI/Source/BsVulkanGpuPipelineState.cpp
  27. 2 0
      Source/BansheeVulkanRenderAPI/Source/BsVulkanGpuProgram.cpp
  28. 0 15
      Source/BansheeVulkanRenderAPI/Source/BsVulkanRenderAPI.cpp

BIN
Data/Examples/Example.bsl.asset


+ 1 - 1
Data/Raw/Editor/Includes/PickingAlphaCull.bslinc

@@ -120,7 +120,7 @@ Technique : base("PickingAlphaCull") =
 
 
 			void main()
 			void main()
 			{
 			{
-				vec4 color = texture2D(gMainTexture, texcoord0);
+				vec4 color = texture(gMainTexture, texcoord0);
 				if(color.a < gAlphaCutoff)
 				if(color.a < gAlphaCutoff)
 					discard;
 					discard;
 					
 					

+ 1 - 1
Data/Raw/Editor/Shaders/GizmoPickingAlpha.bsl

@@ -114,7 +114,7 @@ Technique =
 			
 			
 			void main()
 			void main()
 			{
 			{
-				vec4 texColor = texture2D(gMainTexture, texcoord0);
+				vec4 texColor = texture(gMainTexture, texcoord0);
 				if(texColor.a < gAlphaCutoff)
 				if(texColor.a < gAlphaCutoff)
 					discard;
 					discard;
 				
 				

+ 2 - 2
Data/Raw/Editor/Shaders/IconGizmo.bsl

@@ -166,7 +166,7 @@ Technique =
 			
 			
 			void main()
 			void main()
 			{
 			{
-				vec4 texColor = texture2D(gMainTexture, texcoord0.st);
+				vec4 texColor = texture(gMainTexture, texcoord0.st);
 				fragColor = color0 * texColor;
 				fragColor = color0 * texColor;
 			}		
 			}		
 		};
 		};
@@ -221,7 +221,7 @@ Technique =
 			
 			
 			void main()
 			void main()
 			{
 			{
-				vec4 texColor = texture2D(gMainTexture, texcoord0.st);
+				vec4 texColor = texture(gMainTexture, texcoord0.st);
 				fragColor = color0 * texColor;
 				fragColor = color0 * texColor;
 			}		
 			}		
 		};
 		};

+ 1 - 1
Data/Raw/Editor/Shaders/TextGizmo.bsl

@@ -117,7 +117,7 @@ Technique =
 			
 			
 			void main()
 			void main()
 			{
 			{
-				fragColor = vec4(color0.rgb, texture2D(gMainTexture, texcoord0.st).r * color0.a);
+				fragColor = vec4(color0.rgb, texture(gMainTexture, texcoord0.st).r * color0.a);
 			}		
 			}		
 		};
 		};
 	};
 	};

+ 0 - 1
Data/Raw/Engine/Includes/DeferredPointLightPass.bslinc

@@ -150,7 +150,6 @@ Technique
 		Vertex =
 		Vertex =
 		{
 		{
 			layout(location = 0) in vec3 bs_position;
 			layout(location = 0) in vec3 bs_position;
-			in int gl_VertexID;
 		
 		
 			layout(location = 0) out vec4 position;
 			layout(location = 0) out vec4 position;
 			layout(location = 1) out vec4 screenPos;
 			layout(location = 1) out vec4 screenPos;

+ 1 - 1
Data/Raw/Engine/Includes/SpriteImage.bslinc

@@ -119,7 +119,7 @@ Technique : base("SpriteImage") =
 
 
 			void main()
 			void main()
 			{
 			{
-				vec4 color = texture2D(gMainTexture, texcoord0.st);
+				vec4 color = texture(gMainTexture, texcoord0.st);
 				fragColor = color * gTint;
 				fragColor = color * gTint;
 			}
 			}
 		};
 		};

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

@@ -132,8 +132,6 @@ Technique : base("VolumeRenderBase") =
 				vec4 gl_Position;
 				vec4 gl_Position;
 			};
 			};
 		
 		
-			out int gl_Layer;
-		
 			void main()
 			void main()
 			{
 			{
 				gl_Layer = GSInput[0].layerIdx;
 				gl_Layer = GSInput[0].layerIdx;

+ 2 - 2
Data/Raw/Engine/Shaders/Diffuse.bsl

@@ -61,11 +61,11 @@ Technique : base("Surface") =
 
 
 			void main()
 			void main()
 			{
 			{
-				vec3 normal = normalize(texture2D(gNormalTex, uv0).xyz * 2.0f - vec3(1, 1, 1));
+				vec3 normal = normalize(texture(gNormalTex, uv0).xyz * 2.0f - vec3(1, 1, 1));
 				vec3 worldNormal = calcWorldNormal(tangentToWorldZ, tangentToWorldX, normal);
 				vec3 worldNormal = calcWorldNormal(tangentToWorldZ, tangentToWorldX, normal);
 			
 			
 				GBufferData gbufferData;
 				GBufferData gbufferData;
-				gbufferData.albedo = texture2D(gAlbedoTex, uv0);
+				gbufferData.albedo = texture(gAlbedoTex, uv0);
 				gbufferData.worldNormal.xyz = worldNormal;
 				gbufferData.worldNormal.xyz = worldNormal;
 				
 				
 				encodeGBuffer(gbufferData, gl_FragData[1], gl_FragData[2]);
 				encodeGBuffer(gbufferData, gl_FragData[1], gl_FragData[2]);

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

@@ -211,9 +211,7 @@ Technique
 			in GStoFS
 			in GStoFS
 			{
 			{
 				layout(location = 0) vec2 uv0;
 				layout(location = 0) vec2 uv0;
-			} input;
-			
-			in int gl_Layer;
+			} FSInput;
 			
 			
 			layout(location = 0) out vec4 fragColor;
 			layout(location = 0) out vec4 fragColor;
 			
 			
@@ -226,7 +224,7 @@ Technique
 				
 				
 				// By default pixel centers will be sampled, but we want to encode the entire range, so
 				// By default pixel centers will be sampled, but we want to encode the entire range, so
 				// offset the sampling by half a pixel, and extend the entire range by one pixel.
 				// offset the sampling by half a pixel, and extend the entire range by one pixel.
-				vec2 uv = input.uv0 - (0.5f / LUT_SIZE);
+				vec2 uv = FSInput.uv0 - (0.5f / LUT_SIZE);
 				vec3 logColor = vec3(uv * LUT_SIZE / float(LUT_SIZE - 1), gl_Layer / float(LUT_SIZE - 1));
 				vec3 logColor = vec3(uv * LUT_SIZE / float(LUT_SIZE - 1), gl_Layer / float(LUT_SIZE - 1));
 				
 				
 				vec3 linearColor;
 				vec3 linearColor;

+ 7 - 7
Data/Raw/Engine/Shaders/PPDownsample.bsl

@@ -62,7 +62,7 @@ Technique : inherits("PPBase") =
 			in VStoFS
 			in VStoFS
 			{
 			{
 				layout(location = 0) vec2 uv0;
 				layout(location = 0) vec2 uv0;
-			} input;		
+			} FSInput;		
 		
 		
 			layout(location = 0) out vec4 fragColor;
 			layout(location = 0) out vec4 fragColor;
 		
 		
@@ -71,7 +71,7 @@ Technique : inherits("PPBase") =
 				vec2 gInvTexSize;
 				vec2 gInvTexSize;
 			};
 			};
 			
 			
-			layout(location = 1) uniform sampler2D gInputTex;
+			layout(binding = 1) uniform sampler2D gInputTex;
 			
 			
 			void main()
 			void main()
 			{
 			{
@@ -80,15 +80,15 @@ Technique : inherits("PPBase") =
 				// Blur using a 4x4 kernel. It's assumed current position is right in the middle of a 2x2 kernel (because the output
 				// Blur using a 4x4 kernel. It's assumed current position is right in the middle of a 2x2 kernel (because the output
 				// texture should be 1/2 the size of the output texture), and moving by one in each direction will sample areas
 				// texture should be 1/2 the size of the output texture), and moving by one in each direction will sample areas
 				// between a 2x2 kernel as well if bilinear filtering is enabled.
 				// between a 2x2 kernel as well if bilinear filtering is enabled.
-				UV[0] = input.uv0 + gInvTexSize * vec2(-1, -1);
-				UV[1] = input.uv0 + gInvTexSize * vec2( 1, -1);
-				UV[2] = input.uv0 + gInvTexSize * vec2(-1,  1);
-				UV[3] = input.uv0 + gInvTexSize * vec2( 1,  1);
+				UV[0] = FSInput.uv0 + gInvTexSize * vec2(-1, -1);
+				UV[1] = FSInput.uv0 + gInvTexSize * vec2( 1, -1);
+				UV[2] = FSInput.uv0 + gInvTexSize * vec2(-1,  1);
+				UV[3] = FSInput.uv0 + gInvTexSize * vec2( 1,  1);
 
 
 				vec4 samples[4];
 				vec4 samples[4];
 
 
 				for(uint i = 0; i < 4; i++)
 				for(uint i = 0; i < 4; i++)
-					samples[i] = texture2D(gInputTex, UV[i]);
+					samples[i] = texture(gInputTex, UV[i]);
 
 
 				fragColor = (samples[0] + samples[1] + samples[2] + samples[3]) * 0.25f;
 				fragColor = (samples[0] + samples[1] + samples[2] + samples[3]) * 0.25f;
 			}	
 			}	

+ 1 - 1
Data/Raw/Engine/Shaders/PPTonemapping.bsl

@@ -167,7 +167,7 @@ Technique : inherits("PPTonemapCommon") =
 						
 						
 			void main()
 			void main()
 			{
 			{
-				vec4 sceneColor = texture2D(gInputTex, FSInput.uv0);
+				vec4 sceneColor = texture(gInputTex, FSInput.uv0);
 				
 				
 				#if AUTO_EXPOSURE
 				#if AUTO_EXPOSURE
 					sceneColor.rgb = sceneColor.rgb * FSInput.exposureScale;
 					sceneColor.rgb = sceneColor.rgb * FSInput.exposureScale;

+ 1 - 1
Data/Raw/Engine/Shaders/SpriteText.bsl

@@ -133,7 +133,7 @@ Technique =
 
 
 			void main()
 			void main()
 			{
 			{
-				vec4 color = vec4(gTint.rgb, texture2D(gMainTexture, texcoord0.st).r * gTint.a);
+				vec4 color = vec4(gTint.rgb, texture(gMainTexture, texcoord0.st).r * gTint.a);
 				fragColor = color;
 				fragColor = color;
 			}
 			}
 		};
 		};

+ 1 - 7
Source/BansheeCore/Include/BsGpuProgram.h

@@ -52,7 +52,6 @@ namespace bs
 		String entryPoint; /**< Name of the entry point function, for example "main". */
 		String entryPoint; /**< Name of the entry point function, for example "main". */
 		String language; /**< Language the source is written in, for example "hlsl" or "glsl". */
 		String language; /**< Language the source is written in, for example "hlsl" or "glsl". */
 		GpuProgramType type = GPT_VERTEX_PROGRAM; /**< Type of the program, for example vertex or fragment. */
 		GpuProgramType type = GPT_VERTEX_PROGRAM; /**< Type of the program, for example vertex or fragment. */
-		GpuProgramProfile profile = GPP_NONE; /**< Program profile specifying supported feature-set. Must match the type. */
 		bool requiresAdjacency = false; /**< If true then adjacency information will be provided when rendering. */
 		bool requiresAdjacency = false; /**< If true then adjacency information will be provided when rendering. */
 	};
 	};
 
 
@@ -60,8 +59,7 @@ namespace bs
 	class BS_CORE_EXPORT GpuProgramProperties
 	class BS_CORE_EXPORT GpuProgramProperties
 	{
 	{
 	public:
 	public:
-		GpuProgramProperties(const String& source, const String& entryPoint,
-			GpuProgramType gptype, GpuProgramProfile profile);
+		GpuProgramProperties(const String& source, const String& entryPoint, GpuProgramType gptype);
 
 
 		virtual ~GpuProgramProperties() { }
 		virtual ~GpuProgramProperties() { }
 
 
@@ -71,9 +69,6 @@ namespace bs
 		/**	Type of GPU program (for example fragment, vertex). */
 		/**	Type of GPU program (for example fragment, vertex). */
         GpuProgramType getType() const { return mType; }
         GpuProgramType getType() const { return mType; }
 
 
-		/**	Profile of the GPU program (for example VS_4_0, VS_5_0). */
-		GpuProgramProfile getProfile() const { return mProfile; }
-
 		/**	Name of the program entry method (for example "main"). */
 		/**	Name of the program entry method (for example "main"). */
 		const String& getEntryPoint() const { return mEntryPoint; }
 		const String& getEntryPoint() const { return mEntryPoint; }
 
 
@@ -82,7 +77,6 @@ namespace bs
 
 
 		GpuProgramType mType;
 		GpuProgramType mType;
 		String mEntryPoint;
 		String mEntryPoint;
-		GpuProgramProfile mProfile;
 		String mSource;
 		String mSource;
 	};
 	};
 
 

+ 0 - 4
Source/BansheeCore/Include/BsGpuProgramRTTI.h

@@ -25,9 +25,6 @@ namespace bs
 		String& getEntryPoint(GpuProgram* obj) { return obj->mProperties.mEntryPoint; }
 		String& getEntryPoint(GpuProgram* obj) { return obj->mProperties.mEntryPoint; }
 		void setEntryPoint(GpuProgram* obj, String& val) { obj->mProperties.mEntryPoint = val; }
 		void setEntryPoint(GpuProgram* obj, String& val) { obj->mProperties.mEntryPoint = val; }
 
 
-		GpuProgramProfile& getProfile(GpuProgram* obj) { return obj->mProperties.mProfile; }
-		void setProfile(GpuProgram* obj, GpuProgramProfile& val) { obj->mProperties.mProfile = val; }
-
 		String& getSource(GpuProgram* obj) { return obj->mProperties.mSource; }
 		String& getSource(GpuProgram* obj) { return obj->mProperties.mSource; }
 		void setSource(GpuProgram* obj, String& val) { obj->mProperties.mSource = val; }
 		void setSource(GpuProgram* obj, String& val) { obj->mProperties.mSource = val; }
 
 
@@ -40,7 +37,6 @@ namespace bs
 			addPlainField("mType", 2, &GpuProgramRTTI::getType, &GpuProgramRTTI::setType);
 			addPlainField("mType", 2, &GpuProgramRTTI::getType, &GpuProgramRTTI::setType);
 			addPlainField("mNeedsAdjacencyInfo", 3, &GpuProgramRTTI::getNeedsAjdInfo, &GpuProgramRTTI::setNeedsAjdInfo);
 			addPlainField("mNeedsAdjacencyInfo", 3, &GpuProgramRTTI::getNeedsAjdInfo, &GpuProgramRTTI::setNeedsAjdInfo);
 			addPlainField("mEntryPoint", 4, &GpuProgramRTTI::getEntryPoint, &GpuProgramRTTI::setEntryPoint);
 			addPlainField("mEntryPoint", 4, &GpuProgramRTTI::getEntryPoint, &GpuProgramRTTI::setEntryPoint);
-			addPlainField("mProfile", 5, &GpuProgramRTTI::getProfile, &GpuProgramRTTI::setProfile);
 			addPlainField("mSource", 6, &GpuProgramRTTI::getSource, &GpuProgramRTTI::setSource);
 			addPlainField("mSource", 6, &GpuProgramRTTI::getSource, &GpuProgramRTTI::setSource);
 			addPlainField("mLanguage", 7, &GpuProgramRTTI::getLanguage, &GpuProgramRTTI::setLanguage);
 			addPlainField("mLanguage", 7, &GpuProgramRTTI::getLanguage, &GpuProgramRTTI::setLanguage);
 		}
 		}

+ 0 - 24
Source/BansheeCore/Include/BsRenderAPICapabilities.h

@@ -262,12 +262,6 @@ namespace bs
 			mSupportedShaderProfiles.insert(profile);
 			mSupportedShaderProfiles.insert(profile);
 		}
 		}
 
 
-		/**	Adds a mapping between GPU program profile enum and render-system specific profile name. */
-		void addGpuProgramProfile(GpuProgramProfile gpuProgProfile, const String& rsSpecificProfile)
-		{
-			mGenericToSpecificShaderProfileMap[gpuProgProfile] = rsSpecificProfile;
-		}
-
 		/**	Returns true if the provided profile is supported. */
 		/**	Returns true if the provided profile is supported. */
 		bool isShaderProfileSupported(const String& profile) const
 		bool isShaderProfileSupported(const String& profile) const
 		{
 		{
@@ -280,21 +274,6 @@ namespace bs
 			return mSupportedShaderProfiles;
 			return mSupportedShaderProfiles;
 		}
 		}
 
 
-		/**
-		 * Converts a generic GpuProgramProfile identifier into a render-system specific one. Returns an empty string if 
-		 * conversion cannot be done.
-		 */
-		String gpuProgProfileToRSSpecificProfile(GpuProgramProfile gpuProgProfile) const
-		{
-			auto iterFind = mGenericToSpecificShaderProfileMap.find(gpuProgProfile);
-			if(mGenericToSpecificShaderProfileMap.end() != iterFind)
-			{
-				return iterFind->second;
-			}
-
-			return "";
-		}
-
 		/**	Sets the current GPU device name. */
 		/**	Sets the current GPU device name. */
 		void setDeviceName(const String& name)
 		void setDeviceName(const String& name)
 		{
 		{
@@ -369,9 +348,6 @@ namespace bs
 
 
 		// The list of supported shader profiles
 		// The list of supported shader profiles
 		Set<String> mSupportedShaderProfiles;
 		Set<String> mSupportedShaderProfiles;
-
-		// Allows us to convert a generic shader profile to a render-system specific one
-		UnorderedMap<GpuProgramProfile, String> mGenericToSpecificShaderProfileMap;
 	};
 	};
 
 
 	/** @} */
 	/** @} */

+ 15 - 15
Source/BansheeCore/Include/BsTechnique.h

@@ -16,7 +16,7 @@ namespace bs
 	class BS_CORE_EXPORT TechniqueBase
 	class BS_CORE_EXPORT TechniqueBase
 	{
 	{
 	public:
 	public:
-		TechniqueBase(const StringID& renderAPI, const StringID& renderer, const Vector<StringID>& tags);
+		TechniqueBase(const String& language, const StringID& renderer, const Vector<StringID>& tags);
 		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. */
@@ -29,7 +29,7 @@ namespace bs
 		UINT32 hasTags() const { return !mTags.empty(); }
 		UINT32 hasTags() const { return !mTags.empty(); }
 
 
 	protected:
 	protected:
-		StringID mRenderAPI;
+		String mLanguage;
 		StringID mRenderer;
 		StringID mRenderer;
 		Vector<StringID> mTags;
 		Vector<StringID> mTags;
 	};
 	};
@@ -50,7 +50,7 @@ namespace bs
 		typedef typename TPassType<Core>::Type PassType;
 		typedef typename TPassType<Core>::Type PassType;
 		
 		
 		TTechnique();
 		TTechnique();
-		TTechnique(const StringID& renderAPI, const StringID& renderer, const Vector<StringID>& tags, 
+		TTechnique(const String& language, const StringID& renderer, const Vector<StringID>& tags, 
 			const Vector<SPtr<PassType>>& passes);
 			const Vector<SPtr<PassType>>& passes);
 		virtual ~TTechnique() { }
 		virtual ~TTechnique() { }
 
 
@@ -74,15 +74,15 @@ namespace bs
 	class BS_CORE_EXPORT TechniqueCore : public CoreObjectCore, public TTechnique<true>
 	class BS_CORE_EXPORT TechniqueCore : public CoreObjectCore, public TTechnique<true>
 	{
 	{
 	public:
 	public:
-		TechniqueCore(const StringID& renderAPI, const StringID& renderer, const Vector<StringID>& tags, 
+		TechniqueCore(const String& language, const StringID& renderer, const Vector<StringID>& tags,
 			const Vector<SPtr<PassCore>>& passes);
 			const Vector<SPtr<PassCore>>& passes);
 
 
-		/** @copydoc Technique::create(const StringID&, const StringID&, const Vector<SPtr<Pass>>&) */
-		static SPtr<TechniqueCore> create(const StringID& renderAPI, const StringID& renderer, 
+		/** @copydoc Technique::create(const String&, const StringID&, const Vector<SPtr<Pass>>&) */
+		static SPtr<TechniqueCore> create(const String& language, const StringID& renderer,
 			const Vector<SPtr<PassCore>>& passes);
 			const Vector<SPtr<PassCore>>& passes);
 
 
-		/** @copydoc Technique::create(const StringID&, const StringID&, const Vector<StringID>&, const Vector<SPtr<Pass>>&) */
-		static SPtr<TechniqueCore> create(const StringID& renderAPI, const StringID& renderer, const Vector<StringID>& tags,
+		/** @copydoc Technique::create(const String&, const StringID&, const Vector<StringID>&, const Vector<SPtr<Pass>>&) */
+		static SPtr<TechniqueCore> create(const String& language, const StringID& renderer, const Vector<StringID>& tags,
 			const Vector<SPtr<PassCore>>& passes);
 			const Vector<SPtr<PassCore>>& passes);
 	};
 	};
 
 
@@ -104,7 +104,7 @@ 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 StringID& renderAPI, const StringID& renderer, const Vector<StringID>& tags, 
+		Technique(const String& language, const StringID& renderer, const Vector<StringID>& tags,
 			const Vector<SPtr<Pass>>& passes);
 			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. */
@@ -113,20 +113,20 @@ namespace bs
 		/** 
 		/** 
 		 * Creates a new technique. 
 		 * Creates a new technique. 
 		 *
 		 *
-		 * @param[in]	renderAPI	Render API the technique supports. Under normal circumstances the engine will not use
-		 *							this technique unless this API is enabled.
+		 * @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.
 		 * @param[in]	renderer	Renderer the technique supports. Under normal circumstances the engine will not use
 		 * @param[in]	renderer	Renderer the technique supports. Under normal circumstances the engine will not use
 		 *							this technique unless this renderer is enabled.
 		 *							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 StringID& renderAPI, const StringID& renderer, const Vector<SPtr<Pass>>& passes);
+		static SPtr<Technique> create(const String& language, const StringID& renderer, const Vector<SPtr<Pass>>& passes);
 
 
 		/** 
 		/** 
 		 * Creates a new technique. 
 		 * Creates a new technique. 
 		 *
 		 *
-		 * @param[in]	renderAPI	Render API the technique supports. Under normal circumstances the engine will not use
-		 *							this technique unless this API is enabled.
+		 * @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.
 		 * @param[in]	renderer	Renderer the technique supports. Under normal circumstances the engine will not use
 		 * @param[in]	renderer	Renderer the technique supports. Under normal circumstances the engine will not use
 		 *							this technique unless this renderer is enabled.
 		 *							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 
@@ -134,7 +134,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 StringID& renderAPI, const StringID& renderer, const Vector<StringID>& tags, 
+		static SPtr<Technique> create(const String& language, const StringID& renderer, const Vector<StringID>& tags,
 			const Vector<SPtr<Pass>>& passes);
 			const Vector<SPtr<Pass>>& passes);
 
 
 	protected:
 	protected:

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

@@ -17,10 +17,10 @@ namespace bs
 	{
 	{
 	private:
 	private:
 		BS_BEGIN_RTTI_MEMBERS
 		BS_BEGIN_RTTI_MEMBERS
-			BS_RTTI_MEMBER_PLAIN(mRenderAPI, 0)
 			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_END_RTTI_MEMBERS
 		BS_END_RTTI_MEMBERS
 
 
 	public:
 	public:

+ 5 - 10
Source/BansheeCore/Source/BsGpuProgram.cpp

@@ -10,14 +10,13 @@
 
 
 namespace bs
 namespace bs
 {
 {
-	GpuProgramProperties::GpuProgramProperties(const String& source, const String& entryPoint,
-		GpuProgramType gptype, GpuProgramProfile profile)
-		:mType(gptype), mEntryPoint(entryPoint), mProfile(profile), mSource(source)
+	GpuProgramProperties::GpuProgramProperties(const String& source, const String& entryPoint, GpuProgramType gptype)
+		:mType(gptype), mEntryPoint(entryPoint), mSource(source)
 	{ }
 	{ }
 		
 		
 	GpuProgramCore::GpuProgramCore(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask)
 	GpuProgramCore::GpuProgramCore(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask)
 		:mNeedsAdjacencyInfo(desc.requiresAdjacency), mIsCompiled(false), mProperties(desc.source, desc.entryPoint, 
 		:mNeedsAdjacencyInfo(desc.requiresAdjacency), mIsCompiled(false), mProperties(desc.source, desc.entryPoint, 
-			desc.type, desc.profile)
+			desc.type)
 	{
 	{
 		mParametersDesc = bs_shared_ptr_new<GpuParamDesc>();
 		mParametersDesc = bs_shared_ptr_new<GpuParamDesc>();
 	}
 	}
@@ -27,10 +26,7 @@ namespace bs
 		if (!isRequiredCapabilitiesSupported())
 		if (!isRequiredCapabilitiesSupported())
 			return false;
 			return false;
 
 
-		RenderAPICore* rapi = RenderAPICore::instancePtr();
-		String profile = rapi->getCapabilities(0).gpuProgProfileToRSSpecificProfile(getProperties().getProfile());
-
-		return rapi->getCapabilities(0).isShaderProfileSupported(profile);
+		return true;
     }
     }
 
 
 	bool GpuProgramCore::isRequiredCapabilitiesSupported() const
 	bool GpuProgramCore::isRequiredCapabilitiesSupported() const
@@ -45,7 +41,7 @@ namespace bs
 
 
 	GpuProgram::GpuProgram(const GPU_PROGRAM_DESC& desc)
 	GpuProgram::GpuProgram(const GPU_PROGRAM_DESC& desc)
 		: mNeedsAdjacencyInfo(desc.requiresAdjacency), mLanguage(desc.language)
 		: mNeedsAdjacencyInfo(desc.requiresAdjacency), mLanguage(desc.language)
-		, mProperties(desc.source, desc.entryPoint, desc.type, desc.profile)
+		, mProperties(desc.source, desc.entryPoint, desc.type)
     {
     {
 
 
     }
     }
@@ -77,7 +73,6 @@ namespace bs
 		desc.entryPoint = mProperties.getEntryPoint();
 		desc.entryPoint = mProperties.getEntryPoint();
 		desc.language = mLanguage;
 		desc.language = mLanguage;
 		desc.type = mProperties.getType();
 		desc.type = mProperties.getType();
-		desc.profile = mProperties.getProfile();
 		desc.requiresAdjacency = mNeedsAdjacencyInfo;
 		desc.requiresAdjacency = mNeedsAdjacencyInfo;
 
 
 		return GpuProgramCoreManager::instance().createInternal(desc);
 		return GpuProgramCoreManager::instance().createInternal(desc);

+ 0 - 1
Source/BansheeCore/Source/BsGpuProgramManager.cpp

@@ -70,7 +70,6 @@ namespace bs
 		GPU_PROGRAM_DESC desc;
 		GPU_PROGRAM_DESC desc;
 		desc.language = language;
 		desc.language = language;
 		desc.type = type;
 		desc.type = type;
-		desc.profile = GPP_VS_1_1;
 
 
 		GpuProgram* program = new (bs_alloc<GpuProgram>()) GpuProgram(desc);
 		GpuProgram* program = new (bs_alloc<GpuProgram>()) GpuProgram(desc);
 		SPtr<GpuProgram> ret = bs_core_ptr<GpuProgram>(program);
 		SPtr<GpuProgram> ret = bs_core_ptr<GpuProgram>(program);

+ 18 - 19
Source/BansheeCore/Source/BsTechnique.cpp

@@ -11,16 +11,15 @@
 
 
 namespace bs
 namespace bs
 {
 {
-	TechniqueBase::TechniqueBase(const StringID& renderAPI, const StringID& renderer, const Vector<StringID>& tags)
-		:mRenderAPI(renderAPI), mRenderer(renderer), mTags(tags)
+	TechniqueBase::TechniqueBase(const String& language, const StringID& renderer, const Vector<StringID>& tags)
+		:mLanguage(language), mRenderer(renderer), mTags(tags)
 	{
 	{
 
 
 	}
 	}
 
 
 	bool TechniqueBase::isSupported() const
 	bool TechniqueBase::isSupported() const
 	{
 	{
-		if ((RenderAPICore::instancePtr()->getName() == mRenderAPI ||
-			RenderAPIAny == mRenderAPI) &&
+		if ((RenderAPICore::instancePtr()->getShadingLanguageName() == mLanguage || mLanguage == "Any") &&
 			(RendererManager::instance().getActive()->getName() == mRenderer ||
 			(RendererManager::instance().getActive()->getName() == mRenderer ||
 			RendererAny == mRenderer))
 			RendererAny == mRenderer))
 		{
 		{
@@ -42,9 +41,9 @@ namespace bs
 	}
 	}
 
 
 	template<bool Core>
 	template<bool Core>
-	TTechnique<Core>::TTechnique(const StringID& renderAPI, const StringID& renderer, const Vector<StringID>& tags, 
+	TTechnique<Core>::TTechnique(const String& language, const StringID& renderer, const Vector<StringID>& tags,
 		const Vector<SPtr<PassType>>& passes)
 		const Vector<SPtr<PassType>>& passes)
-		: TechniqueBase(renderAPI, renderer, tags), mPasses(passes)
+		: TechniqueBase(language, renderer, tags), mPasses(passes)
 	{ }
 	{ }
 
 
 	template<bool Core>
 	template<bool Core>
@@ -64,15 +63,15 @@ namespace bs
 	template class TTechnique < false > ;
 	template class TTechnique < false > ;
 	template class TTechnique < true >;
 	template class TTechnique < true >;
 
 
-	TechniqueCore::TechniqueCore(const StringID& renderAPI, const StringID& renderer, const Vector<StringID>& tags, 
+	TechniqueCore::TechniqueCore(const String& language, const StringID& renderer, const Vector<StringID>& tags,
 		const Vector<SPtr<PassCore>>& passes)
 		const Vector<SPtr<PassCore>>& passes)
-		:TTechnique(renderAPI, renderer, tags, passes)
+		:TTechnique(language, renderer, tags, passes)
 	{ }
 	{ }
 
 
-	SPtr<TechniqueCore> TechniqueCore::create(const StringID& renderAPI, const StringID& renderer, 
+	SPtr<TechniqueCore> TechniqueCore::create(const String& language, const StringID& renderer,
 		const Vector<SPtr<PassCore>>& passes)
 		const Vector<SPtr<PassCore>>& passes)
 	{
 	{
-		TechniqueCore* technique = new (bs_alloc<TechniqueCore>()) TechniqueCore(renderAPI, renderer, {}, passes);
+		TechniqueCore* technique = new (bs_alloc<TechniqueCore>()) TechniqueCore(language, renderer, {}, passes);
 		SPtr<TechniqueCore> techniquePtr = bs_shared_ptr<TechniqueCore>(technique);
 		SPtr<TechniqueCore> techniquePtr = bs_shared_ptr<TechniqueCore>(technique);
 		techniquePtr->_setThisPtr(techniquePtr);
 		techniquePtr->_setThisPtr(techniquePtr);
 		techniquePtr->initialize();
 		techniquePtr->initialize();
@@ -80,10 +79,10 @@ namespace bs
 		return techniquePtr;
 		return techniquePtr;
 	}
 	}
 
 
-	SPtr<TechniqueCore> TechniqueCore::create(const StringID& renderAPI, const StringID& renderer, 
+	SPtr<TechniqueCore> TechniqueCore::create(const String& language, const StringID& renderer,
 		const Vector<StringID>& tags, const Vector<SPtr<PassCore>>& passes)
 		const Vector<StringID>& tags, const Vector<SPtr<PassCore>>& passes)
 	{
 	{
-		TechniqueCore* technique = new (bs_alloc<TechniqueCore>()) TechniqueCore(renderAPI, renderer, tags, passes);
+		TechniqueCore* technique = new (bs_alloc<TechniqueCore>()) TechniqueCore(language, renderer, tags, passes);
 		SPtr<TechniqueCore> techniquePtr = bs_shared_ptr<TechniqueCore>(technique);
 		SPtr<TechniqueCore> techniquePtr = bs_shared_ptr<TechniqueCore>(technique);
 		techniquePtr->_setThisPtr(techniquePtr);
 		techniquePtr->_setThisPtr(techniquePtr);
 		techniquePtr->initialize();
 		techniquePtr->initialize();
@@ -91,9 +90,9 @@ namespace bs
 		return techniquePtr;
 		return techniquePtr;
 	}
 	}
 
 
-	Technique::Technique(const StringID& renderAPI, const StringID& renderer, const Vector<StringID>& tags, 
+	Technique::Technique(const String& language, const StringID& renderer, const Vector<StringID>& tags,
 		const Vector<SPtr<Pass>>& passes)
 		const Vector<SPtr<Pass>>& passes)
-		:TTechnique(renderAPI, renderer, tags, passes)
+		:TTechnique(language, renderer, tags, passes)
 	{ }
 	{ }
 
 
 	Technique::Technique()
 	Technique::Technique()
@@ -111,7 +110,7 @@ namespace bs
 		for (auto& pass : mPasses)
 		for (auto& pass : mPasses)
 			passes.push_back(pass->getCore());
 			passes.push_back(pass->getCore());
 
 
-		TechniqueCore* technique = new (bs_alloc<TechniqueCore>()) TechniqueCore(mRenderAPI, mRenderer, mTags, passes);
+		TechniqueCore* technique = new (bs_alloc<TechniqueCore>()) TechniqueCore(mLanguage, mRenderer, mTags, passes);
 		SPtr<TechniqueCore> techniquePtr = bs_shared_ptr<TechniqueCore>(technique);
 		SPtr<TechniqueCore> techniquePtr = bs_shared_ptr<TechniqueCore>(technique);
 		techniquePtr->_setThisPtr(techniquePtr);
 		techniquePtr->_setThisPtr(techniquePtr);
 
 
@@ -124,9 +123,9 @@ namespace bs
 			dependencies.push_back(pass.get());
 			dependencies.push_back(pass.get());
 	}
 	}
 
 
-	SPtr<Technique> Technique::create(const StringID& renderAPI, const StringID& renderer, const Vector<SPtr<Pass>>& passes)
+	SPtr<Technique> Technique::create(const String& language, const StringID& renderer, const Vector<SPtr<Pass>>& passes)
 	{
 	{
-		Technique* technique = new (bs_alloc<Technique>()) Technique(renderAPI, renderer, {}, passes);
+		Technique* technique = new (bs_alloc<Technique>()) Technique(language, renderer, {}, 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();
@@ -134,10 +133,10 @@ namespace bs
 		return techniquePtr;
 		return techniquePtr;
 	}
 	}
 
 
-	SPtr<Technique> Technique::create(const StringID& renderAPI, const StringID& renderer, const Vector<StringID>& tags, 
+	SPtr<Technique> Technique::create(const String& language, const StringID& renderer, const Vector<StringID>& tags,
 		const Vector<SPtr<Pass>>& passes)
 		const Vector<SPtr<Pass>>& passes)
 	{
 	{
-		Technique* technique = new (bs_alloc<Technique>()) Technique(renderAPI, renderer, tags, passes);
+		Technique* technique = new (bs_alloc<Technique>()) Technique(language, renderer, tags, 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();

+ 23 - 2
Source/BansheeD3D11RenderAPI/Source/BsD3D11GpuProgram.cpp

@@ -42,11 +42,32 @@ namespace bs
 			return;
 			return;
 		}
 		}
 
 
+		String hlslProfile;
+		switch(mProperties.getType())
+		{
+		case GPT_FRAGMENT_PROGRAM:
+			hlslProfile = "ps_5_0";
+			break;
+		case GPT_VERTEX_PROGRAM:
+			hlslProfile = "vs_5_0";
+			break;
+		case GPT_GEOMETRY_PROGRAM:
+			hlslProfile = "gs_5_0";
+			break;
+		case GPT_COMPUTE_PROGRAM:
+			hlslProfile = "cs_5_0";
+			break;
+		case GPT_HULL_PROGRAM:
+			hlslProfile = "hs_5_0";
+			break;
+		case GPT_DOMAIN_PROGRAM:
+			hlslProfile = "ds_5_0";
+			break;
+		}
+
 		D3D11RenderAPI* rapi = static_cast<D3D11RenderAPI*>(RenderAPICore::instancePtr());
 		D3D11RenderAPI* rapi = static_cast<D3D11RenderAPI*>(RenderAPICore::instancePtr());
-		String hlslProfile = rapi->getCapabilities(0).gpuProgProfileToRSSpecificProfile(mProperties.getProfile());
 
 
 		ID3DBlob* microcode = compileMicrocode(hlslProfile);
 		ID3DBlob* microcode = compileMicrocode(hlslProfile);
-
 		if (microcode != nullptr)
 		if (microcode != nullptr)
 		{
 		{
 			mMicrocode.resize(microcode->GetBufferSize());
 			mMicrocode.resize(microcode->GetBufferSize());

+ 0 - 33
Source/BansheeD3D11RenderAPI/Source/BsD3D11RenderAPI.cpp

@@ -1149,14 +1149,6 @@ namespace bs
 		{
 		{
 			caps.setCapability(RSC_GEOMETRY_PROGRAM);
 			caps.setCapability(RSC_GEOMETRY_PROGRAM);
 
 
-			caps.addShaderProfile("ps_4_0");
-			caps.addShaderProfile("vs_4_0");
-			caps.addShaderProfile("gs_4_0");
-
-			caps.addGpuProgramProfile(GPP_FS_4_0, "ps_4_0");
-			caps.addGpuProgramProfile(GPP_VS_4_0, "vs_4_0");
-			caps.addGpuProgramProfile(GPP_GS_4_0, "gs_4_0");
-
 			caps.setNumTextureUnits(GPT_FRAGMENT_PROGRAM, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT);
 			caps.setNumTextureUnits(GPT_FRAGMENT_PROGRAM, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT);
 			caps.setNumTextureUnits(GPT_VERTEX_PROGRAM, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT);
 			caps.setNumTextureUnits(GPT_VERTEX_PROGRAM, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT);
 			caps.setNumTextureUnits(GPT_GEOMETRY_PROGRAM, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT);
 			caps.setNumTextureUnits(GPT_GEOMETRY_PROGRAM, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT);
@@ -1172,36 +1164,11 @@ namespace bs
 				+ caps.getNumGpuParamBlockBuffers(GPT_VERTEX_PROGRAM) + caps.getNumGpuParamBlockBuffers(GPT_GEOMETRY_PROGRAM));
 				+ caps.getNumGpuParamBlockBuffers(GPT_VERTEX_PROGRAM) + caps.getNumGpuParamBlockBuffers(GPT_GEOMETRY_PROGRAM));
 		}
 		}
 
 
-		if(mFeatureLevel >= D3D_FEATURE_LEVEL_10_1)
-		{
-			caps.addShaderProfile("ps_4_1");
-			caps.addShaderProfile("vs_4_1");
-			caps.addShaderProfile("gs_4_1");
-
-			caps.addGpuProgramProfile(GPP_FS_4_1, "ps_4_1");
-			caps.addGpuProgramProfile(GPP_VS_4_1, "vs_4_1");
-			caps.addGpuProgramProfile(GPP_GS_4_1, "gs_4_1");
-		}
-
 		if(mFeatureLevel >= D3D_FEATURE_LEVEL_11_0)
 		if(mFeatureLevel >= D3D_FEATURE_LEVEL_11_0)
 		{
 		{
 			caps.setCapability(RSC_TESSELLATION_PROGRAM);
 			caps.setCapability(RSC_TESSELLATION_PROGRAM);
 			caps.setCapability(RSC_COMPUTE_PROGRAM);
 			caps.setCapability(RSC_COMPUTE_PROGRAM);
 
 
-			caps.addShaderProfile("ps_5_0");
-			caps.addShaderProfile("vs_5_0");
-			caps.addShaderProfile("gs_5_0");
-			caps.addShaderProfile("cs_5_0");
-			caps.addShaderProfile("hs_5_0");
-			caps.addShaderProfile("ds_5_0");
-
-			caps.addGpuProgramProfile(GPP_FS_5_0, "ps_5_0");
-			caps.addGpuProgramProfile(GPP_VS_5_0, "vs_5_0");
-			caps.addGpuProgramProfile(GPP_GS_5_0, "gs_5_0");
-			caps.addGpuProgramProfile(GPP_CS_5_0, "cs_5_0");
-			caps.addGpuProgramProfile(GPP_HS_5_0, "hs_5_0");
-			caps.addGpuProgramProfile(GPP_DS_5_0, "ds_5_0");
-
 			caps.setNumTextureUnits(GPT_HULL_PROGRAM, D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT);
 			caps.setNumTextureUnits(GPT_HULL_PROGRAM, D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT);
 			caps.setNumTextureUnits(GPT_DOMAIN_PROGRAM, D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT);
 			caps.setNumTextureUnits(GPT_DOMAIN_PROGRAM, D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT);
 			caps.setNumTextureUnits(GPT_COMPUTE_PROGRAM, D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT);
 			caps.setNumTextureUnits(GPT_COMPUTE_PROGRAM, D3D11_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT);

+ 2 - 9
Source/BansheeSL/Include/BsSLFXCompiler.h

@@ -64,7 +64,6 @@ namespace bs
 		struct TechniqueMetaData
 		struct TechniqueMetaData
 		{
 		{
 			StringID renderer = RendererAny;
 			StringID renderer = RendererAny;
-			StringID renderAPI = RenderAPIAny;
 			Vector<StringID> tags;
 			Vector<StringID> tags;
 			String language;
 			String language;
 
 
@@ -93,11 +92,8 @@ namespace bs
 		/**	Converts FX renderer name into an in-engine renderer identifier. */
 		/**	Converts FX renderer name into an in-engine renderer identifier. */
 		static StringID parseRenderer(const String& name);
 		static StringID parseRenderer(const String& name);
 
 
-		/**
-		 * Converts FX language into an in-engine shader language (for example hlsl, glsl) and a rendering API that supports
-		 * the provided language.
-		 */
-		static void parseLanguage(const String& name, StringID& renderAPI, String& language);
+		/** Converts FX language string into an in-engine shader language string (for example hlsl, glsl). */
+		static void parseLanguage(const String& name, String& language);
 
 
 		/**	Maps FX buffer usage enum into in-engine param block usage. */
 		/**	Maps FX buffer usage enum into in-engine param block usage. */
 		static GpuParamBlockUsage parseBlockUsage(BufferUsageValue usage);
 		static GpuParamBlockUsage parseBlockUsage(BufferUsageValue usage);
@@ -248,9 +244,6 @@ namespace bs
 		 */
 		 */
 		static String removeQuotes(const char* input);
 		static String removeQuotes(const char* input);
 
 
-		/**	Retrieves a GPU program profile to use with the specified API and GPU program type. */
-		static GpuProgramProfile getProfile(const StringID& renderAPI, GpuProgramType type);
-
 		/** Returns one of the builtin textures based on their name. */
 		/** Returns one of the builtin textures based on their name. */
 		static HTexture getBuiltinTexture(const String& name);
 		static HTexture getBuiltinTexture(const String& name);
 	};
 	};

+ 4 - 62
Source/BansheeSL/Source/BsSLFXCompiler.cpp

@@ -207,7 +207,7 @@ namespace bs
 				metaData.renderer = parseRenderer(removeQuotes(option->value.strValue));
 				metaData.renderer = parseRenderer(removeQuotes(option->value.strValue));
 				break;
 				break;
 			case OT_Language:
 			case OT_Language:
-				parseLanguage(removeQuotes(option->value.strValue), metaData.renderAPI, metaData.language);
+				parseLanguage(removeQuotes(option->value.strValue), metaData.language);
 				break;
 				break;
 			case OT_Tags:
 			case OT_Tags:
 			{
 			{
@@ -245,28 +245,16 @@ namespace bs
 		return RendererAny;
 		return RendererAny;
 	}
 	}
 
 
-	void BSLFXCompiler::parseLanguage(const String& name, StringID& renderAPI, String& language)
+	void BSLFXCompiler::parseLanguage(const String& name, String& language)
 	{
 	{
 		if (name == "HLSL" || name == "HLSL11")
 		if (name == "HLSL" || name == "HLSL11")
-		{
-			renderAPI = RenderAPIDX11;
 			language = "hlsl";
 			language = "hlsl";
-		}
 		else if (name == "HLSL9")
 		else if (name == "HLSL9")
-		{
-			renderAPI = RenderAPIDX9;
 			language = "hlsl9";
 			language = "hlsl9";
-		}
 		else if (name == "GLSL")
 		else if (name == "GLSL")
-		{
-			renderAPI = RenderAPIOpenGL;
 			language = "glsl";
 			language = "glsl";
-		}
 		else // "Any"
 		else // "Any"
-		{
-			renderAPI = RenderAPIAny;
 			language = "";
 			language = "";
-		}
 	}
 	}
 
 
 	GpuParamBlockUsage BSLFXCompiler::parseBlockUsage(BufferUsageValue usage)
 	GpuParamBlockUsage BSLFXCompiler::parseBlockUsage(BufferUsageValue usage)
@@ -1372,7 +1360,6 @@ namespace bs
 				{
 				{
 					desc.source = passData.commonCode + passData.vertexCode;
 					desc.source = passData.commonCode + passData.vertexCode;
 					desc.type = GPT_VERTEX_PROGRAM;
 					desc.type = GPT_VERTEX_PROGRAM;
-					desc.profile = getProfile(metaData.renderAPI, GPT_VERTEX_PROGRAM);
 
 
 					passDesc.vertexProgram = GpuProgram::create(desc);
 					passDesc.vertexProgram = GpuProgram::create(desc);
 				}
 				}
@@ -1381,7 +1368,6 @@ namespace bs
 				{
 				{
 					desc.source = passData.commonCode + passData.fragmentCode;
 					desc.source = passData.commonCode + passData.fragmentCode;
 					desc.type = GPT_FRAGMENT_PROGRAM;
 					desc.type = GPT_FRAGMENT_PROGRAM;
-					desc.profile = getProfile(metaData.renderAPI, GPT_FRAGMENT_PROGRAM);
 
 
 					passDesc.fragmentProgram = GpuProgram::create(desc);
 					passDesc.fragmentProgram = GpuProgram::create(desc);
 				}
 				}
@@ -1390,7 +1376,6 @@ namespace bs
 				{
 				{
 					desc.source = passData.commonCode + passData.geometryCode;
 					desc.source = passData.commonCode + passData.geometryCode;
 					desc.type = GPT_GEOMETRY_PROGRAM;
 					desc.type = GPT_GEOMETRY_PROGRAM;
-					desc.profile = getProfile(metaData.renderAPI, GPT_GEOMETRY_PROGRAM);
 
 
 					passDesc.geometryProgram = GpuProgram::create(desc);
 					passDesc.geometryProgram = GpuProgram::create(desc);
 				}
 				}
@@ -1399,7 +1384,6 @@ namespace bs
 				{
 				{
 					desc.source = passData.commonCode + passData.hullCode;
 					desc.source = passData.commonCode + passData.hullCode;
 					desc.type = GPT_HULL_PROGRAM;
 					desc.type = GPT_HULL_PROGRAM;
-					desc.profile = getProfile(metaData.renderAPI, GPT_HULL_PROGRAM);
 
 
 					passDesc.hullProgram = GpuProgram::create(desc);
 					passDesc.hullProgram = GpuProgram::create(desc);
 				}
 				}
@@ -1408,7 +1392,6 @@ namespace bs
 				{
 				{
 					desc.source = passData.commonCode + passData.domainCode;
 					desc.source = passData.commonCode + passData.domainCode;
 					desc.type = GPT_DOMAIN_PROGRAM;
 					desc.type = GPT_DOMAIN_PROGRAM;
-					desc.profile = getProfile(metaData.renderAPI, GPT_DOMAIN_PROGRAM);
 
 
 					passDesc.domainProgram = GpuProgram::create(desc);
 					passDesc.domainProgram = GpuProgram::create(desc);
 				}
 				}
@@ -1417,7 +1400,6 @@ namespace bs
 				{
 				{
 					desc.source = passData.commonCode + passData.computeCode;
 					desc.source = passData.commonCode + passData.computeCode;
 					desc.type = GPT_COMPUTE_PROGRAM;
 					desc.type = GPT_COMPUTE_PROGRAM;
-					desc.profile = getProfile(metaData.renderAPI, GPT_COMPUTE_PROGRAM);
 
 
 					passDesc.computeProgram = GpuProgram::create(desc);
 					passDesc.computeProgram = GpuProgram::create(desc);
 				}
 				}
@@ -1435,8 +1417,8 @@ namespace bs
 
 
 			if (orderedPasses.size() > 0)
 			if (orderedPasses.size() > 0)
 			{
 			{
-				SPtr<Technique> technique = Technique::create(metaData.renderAPI, metaData.renderer,
-					metaData.tags, orderedPasses);
+				SPtr<Technique> technique = Technique::create(metaData.language, metaData.renderer, metaData.tags, 
+					orderedPasses);
 				techniques.push_back(technique);
 				techniques.push_back(technique);
 			}
 			}
 		}
 		}
@@ -1473,46 +1455,6 @@ namespace bs
 		return output;
 		return output;
 	}
 	}
 
 
-	GpuProgramProfile BSLFXCompiler::getProfile(const StringID& renderAPI, GpuProgramType type)
-	{
-		StringID target = renderAPI;
-		if (target == RenderAPIAny)
-			target = RenderAPICore::instance().getName();
-
-		if (target == RenderAPIDX11 || target == RenderAPIOpenGL)
-		{
-			switch (type)
-			{
-			case GPT_VERTEX_PROGRAM:
-				return GPP_VS_5_0;
-			case GPT_FRAGMENT_PROGRAM:
-				return GPP_FS_5_0;
-			case GPT_GEOMETRY_PROGRAM:
-				return GPP_GS_5_0;
-			case GPT_HULL_PROGRAM:
-				return GPP_HS_5_0;
-			case GPT_DOMAIN_PROGRAM:
-				return GPP_DS_5_0;
-			case GPT_COMPUTE_PROGRAM:
-				return GPP_CS_5_0;
-			}
-		}
-		else if (target == RenderAPIDX9)
-		{
-			switch (type)
-			{
-			case GPT_VERTEX_PROGRAM:
-				return GPP_VS_3_0;
-			case GPT_FRAGMENT_PROGRAM:
-				return GPP_FS_3_0;
-			default:
-				break;
-			}
-		}
-
-		return GPP_NONE;
-	}
-
 	HTexture BSLFXCompiler::getBuiltinTexture(const String& name)
 	HTexture BSLFXCompiler::getBuiltinTexture(const String& name)
 	{
 	{
 		if (StringUtil::compare(name, String("white"), false) == 0)
 		if (StringUtil::compare(name, String("white"), false) == 0)

+ 2 - 2
Source/BansheeVulkanRenderAPI/Source/BsVulkanGpuPipelineState.cpp

@@ -566,9 +566,9 @@ namespace bs
 				VulkanShaderModule* module = vkProgram->getShaderModule(i);
 				VulkanShaderModule* module = vkProgram->getShaderModule(i);
 
 
 				if (module != nullptr)
 				if (module != nullptr)
-					stageCI.module = module->getHandle();
+					pipelineCI.stage.module = module->getHandle();
 				else
 				else
-					stageCI.module = VK_NULL_HANDLE;
+					pipelineCI.stage.module = VK_NULL_HANDLE;
 
 
 				pipelineCI.layout = descManager.getPipelineLayout(layouts, numLayouts);
 				pipelineCI.layout = descManager.getPipelineLayout(layouts, numLayouts);
 
 

+ 2 - 0
Source/BansheeVulkanRenderAPI/Source/BsVulkanGpuProgram.cpp

@@ -664,6 +664,8 @@ namespace bs
 			}
 			}
 		}
 		}
 
 
+		mIsCompiled = true;
+
 cleanup:
 cleanup:
 		delete program;
 		delete program;
 		delete shader;
 		delete shader;

+ 0 - 15
Source/BansheeVulkanRenderAPI/Source/BsVulkanRenderAPI.cpp

@@ -683,14 +683,6 @@ namespace bs
 
 
 			caps.setCapability(RSC_COMPUTE_PROGRAM);
 			caps.setCapability(RSC_COMPUTE_PROGRAM);
 
 
-			caps.addShaderProfile("ps_5_0");
-			caps.addShaderProfile("vs_5_0");
-			caps.addShaderProfile("cs_5_0");
-
-			caps.addGpuProgramProfile(GPP_FS_5_0, "ps_5_0");
-			caps.addGpuProgramProfile(GPP_VS_5_0, "vs_5_0");
-			caps.addGpuProgramProfile(GPP_CS_5_0, "cs_5_0");
-
 			caps.setNumTextureUnits(GPT_FRAGMENT_PROGRAM, deviceLimits.maxPerStageDescriptorSampledImages);
 			caps.setNumTextureUnits(GPT_FRAGMENT_PROGRAM, deviceLimits.maxPerStageDescriptorSampledImages);
 			caps.setNumTextureUnits(GPT_VERTEX_PROGRAM, deviceLimits.maxPerStageDescriptorSampledImages);
 			caps.setNumTextureUnits(GPT_VERTEX_PROGRAM, deviceLimits.maxPerStageDescriptorSampledImages);
 			caps.setNumTextureUnits(GPT_COMPUTE_PROGRAM, deviceLimits.maxPerStageDescriptorSampledImages);
 			caps.setNumTextureUnits(GPT_COMPUTE_PROGRAM, deviceLimits.maxPerStageDescriptorSampledImages);
@@ -706,7 +698,6 @@ namespace bs
 			{
 			{
 				caps.setCapability(RSC_GEOMETRY_PROGRAM);
 				caps.setCapability(RSC_GEOMETRY_PROGRAM);
 				caps.addShaderProfile("gs_5_0");
 				caps.addShaderProfile("gs_5_0");
-				caps.addGpuProgramProfile(GPP_GS_5_0, "gs_5_0");
 				caps.setNumTextureUnits(GPT_GEOMETRY_PROGRAM, deviceLimits.maxPerStageDescriptorSampledImages);
 				caps.setNumTextureUnits(GPT_GEOMETRY_PROGRAM, deviceLimits.maxPerStageDescriptorSampledImages);
 				caps.setNumGpuParamBlockBuffers(GPT_GEOMETRY_PROGRAM, deviceLimits.maxPerStageDescriptorUniformBuffers);
 				caps.setNumGpuParamBlockBuffers(GPT_GEOMETRY_PROGRAM, deviceLimits.maxPerStageDescriptorUniformBuffers);
 				caps.setGeometryProgramNumOutputVertices(deviceLimits.maxGeometryOutputVertices);
 				caps.setGeometryProgramNumOutputVertices(deviceLimits.maxGeometryOutputVertices);
@@ -716,12 +707,6 @@ namespace bs
 			{
 			{
 				caps.setCapability(RSC_TESSELLATION_PROGRAM);
 				caps.setCapability(RSC_TESSELLATION_PROGRAM);
 
 
-				caps.addShaderProfile("hs_5_0");
-				caps.addShaderProfile("ds_5_0");
-
-				caps.addGpuProgramProfile(GPP_HS_5_0, "hs_5_0");
-				caps.addGpuProgramProfile(GPP_DS_5_0, "ds_5_0");
-
 				caps.setNumTextureUnits(GPT_HULL_PROGRAM, deviceLimits.maxPerStageDescriptorSampledImages);
 				caps.setNumTextureUnits(GPT_HULL_PROGRAM, deviceLimits.maxPerStageDescriptorSampledImages);
 				caps.setNumTextureUnits(GPT_DOMAIN_PROGRAM, deviceLimits.maxPerStageDescriptorSampledImages);
 				caps.setNumTextureUnits(GPT_DOMAIN_PROGRAM, deviceLimits.maxPerStageDescriptorSampledImages);