Explorar o código

Minor cleanup (mostly style)

BearishSun %!s(int64=9) %!d(string=hai) anos
pai
achega
83b40c0c88

+ 2 - 2
Data/Raw/Engine/Includes/DeferredLightPass.bslinc

@@ -43,8 +43,8 @@ Technique
 			
 			cbuffer PerLight
 			{
-				// x, y, z - World position of the lightData
-				// w - Type type - Directional = 0, Point = >0, Spot = >0.5
+				// x, y, z - World position of the light
+				// w - Light type - Directional = 0, Point = >0, Spot = >0.5
 				float4 gLightPositionAndType;
 				float4 gLightColorAndIntensity;
 				// x - outerAngle in radians, y - cos(outerAngle), z - 1.0f/(cos(innerAngle) - cos(outerAngle)), w - inverse point light radius

+ 6 - 10
Source/BansheeD3D11RenderAPI/Source/BsD3D11HardwareBuffer.cpp

@@ -108,13 +108,10 @@ namespace bs { namespace ct
 				}
 				else
 				{
-					// Map cannot be called with MAP_WRITE_DISCARD access, 
-					// because the Resource was not created as D3D11_USAGE_DYNAMIC. 
-					// D3D11_USAGE_DYNAMIC Resources must use either MAP_WRITE_DISCARD 
+					// Map cannot be called with MAP_WRITE_DISCARD access, because the Resource was not created as 
+					// D3D11_USAGE_DYNAMIC. D3D11_USAGE_DYNAMIC Resources must use either MAP_WRITE_DISCARD 
 					// or MAP_WRITE_NO_OVERWRITE with Map.
 					mapType = D3D11_MAP_WRITE;
-
-					LOGWRN("DISCARD lock is only available on dynamic buffers. Falling back to normal write.");
 				}
 				break;
 			case GBL_WRITE_ONLY_NO_OVERWRITE:
@@ -122,9 +119,8 @@ namespace bs { namespace ct
 					mapType = D3D11_MAP_WRITE_NO_OVERWRITE;
 				else
 				{
+					// Note supported on anything but index/vertex buffers in DX11 (this restriction was dropped in 11.1)
 					mapType = D3D11_MAP_WRITE;
-
-					LOGWRN("NO_OVERWRITE lock is not available on this (" + toString(mBufferType) + ") buffer type. Falling back to normal write.");
 				}
 				break;
 			case GBL_WRITE_ONLY:
@@ -151,10 +147,10 @@ namespace bs { namespace ct
 			}
 
 			if(D3D11Mappings::isMappingRead(mapType) && (mDesc.CPUAccessFlags & D3D11_CPU_ACCESS_READ) == 0)
-				BS_EXCEPT(RenderingAPIException, "Trying to read a buffer, but buffer wasn't created with a read access flag.");
+				LOGERR("Trying to read a buffer, but buffer wasn't created with a read access flag.");
 
 			if(D3D11Mappings::isMappingWrite(mapType) && (mDesc.CPUAccessFlags & D3D11_CPU_ACCESS_WRITE) == 0)
-				BS_EXCEPT(RenderingAPIException, "Trying to write to a buffer, but buffer wasn't created with a write access flag.");
+				LOGERR("Trying to write to a buffer, but buffer wasn't created with a write access flag.");
 
 			void * pRet = NULL;
 			D3D11_MAPPED_SUBRESOURCE mappedSubResource;
@@ -297,7 +293,7 @@ namespace bs { namespace ct
 		}
 		else
 		{
-			BS_EXCEPT(RenderingAPIException, "Trying to write into a buffer with unsupported usage: " + toString(mDesc.Usage));
+			LOGERR("Trying to write into a buffer with unsupported usage: " + toString(mDesc.Usage));
 		}
 	}
 }}

+ 8 - 8
Source/ExampleLowLevelRendering/Source/Main.cpp

@@ -321,18 +321,21 @@ namespace bs { namespace ct
 		// Bind the pipeline state
 		rapi.setGraphicsPipeline(gPipelineState, cmds);
 
-		// Bind the GPU program parameters (i.e. resource descriptors)
-		rapi.setGpuParams(gGpuParams, cmds);
-
 		// Set the vertex & index buffers, as well as vertex declaration and draw type
 		rapi.setVertexBuffers(0, &gVertexBuffer, 1, cmds);
 		rapi.setIndexBuffer(gIndexBuffer, cmds);
 		rapi.setVertexDeclaration(gVertexDecl, cmds);
 		rapi.setDrawOperation(DOT_TRIANGLE_LIST, cmds);
 
+		// Bind the GPU program parameters (i.e. resource descriptors)
+		rapi.setGpuParams(gGpuParams, cmds);
+
 		// Draw
 		rapi.drawIndexed(0, NUM_INDICES, 0, NUM_VERTICES, 1, cmds);
 
+		// Submit the command buffer
+		rapi.submitCommandBuffer(cmds);
+
 		// Blit the image from the render texture, to the render window
 		rapi.setRenderTarget(gRenderWindow);
 
@@ -343,9 +346,6 @@ namespace bs { namespace ct
 		// bound render target. Internally this uses the same calls we used above, just with a different pipeline and mesh.
 		gRendererUtility().blit(colorTexture);
 
-		// Submit the command buffer
-		rapi.submitCommandBuffer(cmds);
-
 		// Present the rendered image to the user
 		rapi.swapBuffers(gRenderWindow);
 	}
@@ -426,7 +426,7 @@ namespace bs { namespace ct
 
 	const char* getVertexProgSource()
 	{
-		if(BS_RENDER_API_MODULE == "BansheeD3D11RenderAPI")
+		if(USE_HLSL)
 		{
 			static char* src = R"(
 cbuffer Params
@@ -480,7 +480,7 @@ void main()
 
 	const char* getFragmentProgSource()
 	{
-		if (BS_RENDER_API_MODULE == "BansheeD3D11RenderAPI")
+		if (USE_HLSL)
 		{
 			static char* src = R"(
 cbuffer Params

+ 2 - 2
Source/RenderBeast/Include/BsRenderBeast.h

@@ -30,8 +30,8 @@ namespace bs
 	static StringID RPS_BoneMatrices = "BoneMatrices";
 
 	/**
-	 * Default renderer for Banshee. Performs frustum culling, sorting and renders objects in custom ways determine by
-	 * renderable handlers.
+	 * Default renderer for Banshee. Performs frustum culling, sorting and renders all scene objects while applying
+	 * lighting, shadowing, special effects and post-processing.
 	 *
 	 * @note	Sim thread unless otherwise noted.
 	 */