Преглед изворни кода

Getting everything to compile after load/store texture and render texture refactor

Marko Pintera пре 11 година
родитељ
комит
eb6a85cf56

+ 1 - 1
BansheeCore/Include/BsCoreThreadAccessor.h

@@ -28,7 +28,7 @@ namespace BansheeEngine
 
 
 		/** @copydoc RenderSystem::setLoadStoreTexture() */
 		/** @copydoc RenderSystem::setLoadStoreTexture() */
 		void setLoadStoreTexture(GpuProgramType gptype, UINT16 unit, bool enabled, const TexturePtr& texPtr,
 		void setLoadStoreTexture(GpuProgramType gptype, UINT16 unit, bool enabled, const TexturePtr& texPtr,
-			UINT32 mipLevel = 0, UINT32 arraySlice = 0, UINT32 numSlices = 1);
+			const TextureSurface& surface);
 
 
 		/** @copydoc RenderSystem::setSamplerState() */
 		/** @copydoc RenderSystem::setSamplerState() */
 		void setSamplerState(GpuProgramType gptype, UINT16 texUnit, const SamplerStatePtr& samplerState);
 		void setSamplerState(GpuProgramType gptype, UINT16 texUnit, const SamplerStatePtr& samplerState);

+ 2 - 2
BansheeCore/Source/BsCoreThreadAccessor.cpp

@@ -35,10 +35,10 @@ namespace BansheeEngine
 	}
 	}
 
 
 	void CoreThreadAccessorBase::setLoadStoreTexture(GpuProgramType gptype, UINT16 unit, bool enabled, const TexturePtr& texPtr,
 	void CoreThreadAccessorBase::setLoadStoreTexture(GpuProgramType gptype, UINT16 unit, bool enabled, const TexturePtr& texPtr,
-		UINT32 mipLevel, UINT32 arraySlice, UINT32 numSlices)
+		const TextureSurface& surface)
 	{
 	{
 		mCommandQueue->queue(std::bind(&RenderSystem::setLoadStoreTexture, RenderSystem::instancePtr(), gptype, unit, enabled, texPtr, 
 		mCommandQueue->queue(std::bind(&RenderSystem::setLoadStoreTexture, RenderSystem::instancePtr(), gptype, unit, enabled, texPtr, 
-			mipLevel, arraySlice, numSlices));
+			surface));
 	}
 	}
 
 
 	void CoreThreadAccessorBase::setSamplerState(GpuProgramType gptype, UINT16 texUnit, const SamplerStatePtr& samplerState)
 	void CoreThreadAccessorBase::setSamplerState(GpuProgramType gptype, UINT16 texUnit, const SamplerStatePtr& samplerState)

+ 1 - 1
BansheeCore/Source/BsGpuParams.cpp

@@ -373,7 +373,7 @@ namespace BansheeEngine
 		paramBlockBufferOffset = paramBlockOffset + paramBlockBufferSize;
 		paramBlockBufferOffset = paramBlockOffset + paramBlockBufferSize;
 		textureOffset = paramBlockBufferOffset + paramBlockBuffersBufferSize;
 		textureOffset = paramBlockBufferOffset + paramBlockBuffersBufferSize;
 		samplerStateOffset = textureOffset + textureBufferSize;
 		samplerStateOffset = textureOffset + textureBufferSize;
-		textureInfoOffset = samplerStateOffset + textureInfoBufferSize;
+		textureInfoOffset = samplerStateOffset + samplerStateBufferSize;
 
 
 		if (frameAlloc != nullptr)
 		if (frameAlloc != nullptr)
 		{
 		{

+ 0 - 2
BansheeCore/Source/BsTextureManager.cpp

@@ -70,12 +70,10 @@ namespace BansheeEngine
 		desc.colorSurface.texture = texture;
 		desc.colorSurface.texture = texture;
 		desc.colorSurface.face = 0;
 		desc.colorSurface.face = 0;
 		desc.colorSurface.mipLevel = 0;
 		desc.colorSurface.mipLevel = 0;
-		desc.colorSurface.numFaces = 1;
 
 
 		desc.depthStencilSurface.texture = depthStencil;
 		desc.depthStencilSurface.texture = depthStencil;
 		desc.depthStencilSurface.face = 0;
 		desc.depthStencilSurface.face = 0;
 		desc.depthStencilSurface.mipLevel = 0;
 		desc.depthStencilSurface.mipLevel = 0;
-		desc.depthStencilSurface.numFaces = 1;
 
 
 		RenderTexturePtr newRT = createRenderTexture(desc);
 		RenderTexturePtr newRT = createRenderTexture(desc);
 
 

+ 0 - 7
BansheeD3D11RenderSystem/Include/BsD3D11Texture.h

@@ -23,13 +23,6 @@ namespace BansheeEngine
 		 */
 		 */
 		ID3D11ShaderResourceView* getSRV() const { return mShaderResourceView; }
 		ID3D11ShaderResourceView* getSRV() const { return mShaderResourceView; }
 
 
-		/**
-		 * @brief	Returns unordered access view associated with the texture.
-		 *
-		 * @note	Used for random read/write operations from GPU programs.
-		 */
-		ID3D11UnorderedAccessView* getUAV() const { return mUnorderedAccessView; }
-
 		/**
 		/**
 		 * @brief	Returns DXGI pixel format used by the texture.
 		 * @brief	Returns DXGI pixel format used by the texture.
 		 */
 		 */

+ 1 - 1
BansheeEditorExec/BsEditorExec.cpp

@@ -11,7 +11,7 @@ int CALLBACK WinMain(
 	_In_  int nCmdShow
 	_In_  int nCmdShow
 	)
 	)
 {
 {
-	EditorApplication::startUp(RenderSystemPlugin::DX11);
+	EditorApplication::startUp(RenderSystemPlugin::OpenGL);
 	EditorApplication::instance().runMainLoop();
 	EditorApplication::instance().runMainLoop();
 	EditorApplication::shutDown();
 	EditorApplication::shutDown();
 
 

+ 4 - 4
BansheeGLRenderSystem/Source/BsGLMultiRenderTexture.cpp

@@ -22,13 +22,13 @@ namespace BansheeEngine
 				if (glColorSurface->getTextureType() != TEX_TYPE_3D)
 				if (glColorSurface->getTextureType() != TEX_TYPE_3D)
 				{
 				{
 					surfaceDesc.zoffset = 0;
 					surfaceDesc.zoffset = 0;
-					colorBuffer = glColorSurface->getBuffer(mColorSurfaces[i]->getFirstArraySlice,
-						mColorSurfaces[i]->getMostDetailedMip);
+					colorBuffer = glColorSurface->getBuffer(mColorSurfaces[i]->getFirstArraySlice(),
+						mColorSurfaces[i]->getMostDetailedMip());
 				}
 				}
 				else
 				else
 				{
 				{
-					surfaceDesc.zoffset = mColorSurfaces[i]->getFirstArraySlice;
-					colorBuffer = glColorSurface->getBuffer(0, mColorSurfaces[i]->getMostDetailedMip);
+					surfaceDesc.zoffset = mColorSurfaces[i]->getFirstArraySlice();
+					colorBuffer = glColorSurface->getBuffer(0, mColorSurfaces[i]->getMostDetailedMip());
 				}
 				}
 				
 				
 				surfaceDesc.numSamples = getProperties().getMultisampleCount();
 				surfaceDesc.numSamples = getProperties().getMultisampleCount();

+ 0 - 27
BansheeGLRenderSystem/Source/BsGLRenderSystem.cpp

@@ -483,33 +483,6 @@ namespace BansheeEngine
 		BS_INC_RENDER_STAT(NumTextureBinds);
 		BS_INC_RENDER_STAT(NumTextureBinds);
 	}
 	}
 
 
-	void GLRenderSystem::setSamplerState(GpuProgramType gptype, UINT16 unit, const SamplerStatePtr& state)
-	{
-		THROW_IF_NOT_CORE_THREAD;
-
-		unit = getGLTextureUnit(gptype, unit);
-
-		// Set texture layer filtering
-		setTextureFiltering(unit, FT_MIN, state->getTextureFiltering(FT_MIN));
-		setTextureFiltering(unit, FT_MAG, state->getTextureFiltering(FT_MAG));
-		setTextureFiltering(unit, FT_MIP, state->getTextureFiltering(FT_MIP));
-
-		// Set texture anisotropy
-		setTextureAnisotropy(unit, state->getTextureAnisotropy());
-
-		// Set mipmap biasing
-		setTextureMipmapBias(unit, state->getTextureMipmapBias());
-
-		// Texture addressing mode
-		const UVWAddressingMode& uvw = state->getTextureAddressingMode();
-		setTextureAddressingMode(unit, uvw);
-
-		// Set border color
-		setTextureBorderColor(unit, state->getBorderColor());
-
-		BS_INC_RENDER_STAT(NumSamplerBinds);
-	}
-
 	void GLRenderSystem::setBlendState(const BlendStatePtr& blendState)
 	void GLRenderSystem::setBlendState(const BlendStatePtr& blendState)
 	{
 	{
 		THROW_IF_NOT_CORE_THREAD;
 		THROW_IF_NOT_CORE_THREAD;

+ 4 - 4
MBansheeEngine/Camera.cs

@@ -74,13 +74,13 @@ namespace BansheeEngine
             set { Internal_SetClearColor(mCachedPtr, value); }
             set { Internal_SetClearColor(mCachedPtr, value); }
         }
         }
 
 
-        public int clearDepth
+        public float clearDepth
         {
         {
             get { return Internal_GetDepthClearValue(mCachedPtr); }
             get { return Internal_GetDepthClearValue(mCachedPtr); }
             set { Internal_SetDepthClearValue(mCachedPtr, value); }
             set { Internal_SetDepthClearValue(mCachedPtr, value); }
         }
         }
 
 
-        public byte clearStencil
+        public UInt16 clearStencil
         {
         {
             get { return Internal_GetStencilClearValue(mCachedPtr); }
             get { return Internal_GetStencilClearValue(mCachedPtr); }
             set { Internal_SetStencilClearValue(mCachedPtr, value); }
             set { Internal_SetStencilClearValue(mCachedPtr, value); }
@@ -200,9 +200,9 @@ namespace BansheeEngine
         private static extern void Internal_SetClearColor(IntPtr instance, Color value);
         private static extern void Internal_SetClearColor(IntPtr instance, Color value);
 
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern int Internal_GetDepthClearValue(IntPtr instance);
+        private static extern float Internal_GetDepthClearValue(IntPtr instance);
         [MethodImpl(MethodImplOptions.InternalCall)]
         [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetDepthClearValue(IntPtr instance, int value);
+        private static extern void Internal_SetDepthClearValue(IntPtr instance, float value);
 
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern UInt16 Internal_GetStencilClearValue(IntPtr instance);
         private static extern UInt16 Internal_GetStencilClearValue(IntPtr instance);

+ 2 - 2
SBansheeEngine/Include/BsScriptCamera.h

@@ -47,8 +47,8 @@ namespace BansheeEngine
 		static Color internal_GetClearColor(ScriptCamera* instance);
 		static Color internal_GetClearColor(ScriptCamera* instance);
 		static void internal_SetClearColor(ScriptCamera* instance, Color value);
 		static void internal_SetClearColor(ScriptCamera* instance, Color value);
 
 
-		static int internal_GetDepthClearValue(ScriptCamera* instance);
-		static void internal_SetDepthClearValue(ScriptCamera* instance, int value);
+		static float internal_GetDepthClearValue(ScriptCamera* instance);
+		static void internal_SetDepthClearValue(ScriptCamera* instance, float value);
 
 
 		static UINT16 internal_GetStencilClearValue(ScriptCamera* instance);
 		static UINT16 internal_GetStencilClearValue(ScriptCamera* instance);
 		static void internal_SetStencilClearValue(ScriptCamera* instance, UINT16 value);
 		static void internal_SetStencilClearValue(ScriptCamera* instance, UINT16 value);

+ 2 - 2
SBansheeEngine/Source/BsScriptCamera.cpp

@@ -184,12 +184,12 @@ namespace BansheeEngine
 		vp->setClearValues(value, vp->getClearDepthValue(), vp->getClearStencilValue());
 		vp->setClearValues(value, vp->getClearDepthValue(), vp->getClearStencilValue());
 	}
 	}
 
 
-	int ScriptCamera::internal_GetDepthClearValue(ScriptCamera* instance)
+	float ScriptCamera::internal_GetDepthClearValue(ScriptCamera* instance)
 	{
 	{
 		return instance->mCameraHandler->getViewport()->getClearDepthValue();
 		return instance->mCameraHandler->getViewport()->getClearDepthValue();
 	}
 	}
 
 
-	void ScriptCamera::internal_SetDepthClearValue(ScriptCamera* instance, int value)
+	void ScriptCamera::internal_SetDepthClearValue(ScriptCamera* instance, float value)
 	{
 	{
 		ViewportPtr vp = instance->mCameraHandler->getViewport();
 		ViewportPtr vp = instance->mCameraHandler->getViewport();
 		vp->setClearValues(vp->getClearColor(), value, vp->getClearStencilValue());
 		vp->setClearValues(vp->getClearColor(), value, vp->getClearStencilValue());