Бранимир Караџић %!s(int64=5) %!d(string=hai) anos
pai
achega
925cee63c0
Modificáronse 2 ficheiros con 8 adicións e 8 borrados
  1. 6 6
      src/bgfx_p.h
  2. 2 2
      src/renderer_vk.cpp

+ 6 - 6
src/bgfx_p.h

@@ -2407,7 +2407,7 @@ namespace bgfx
 
 
 		void setIndexBuffer(IndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices)
 		void setIndexBuffer(IndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices)
 		{
 		{
-			BX_ASSERT(UINT8_MAX != m_draw.m_streamMask, "");
+			BX_ASSERT(UINT8_MAX != m_draw.m_streamMask, "bgfx::setVertexCount was already called for this draw call.");
 			m_draw.m_startIndex  = _firstIndex;
 			m_draw.m_startIndex  = _firstIndex;
 			m_draw.m_numIndices  = _numIndices;
 			m_draw.m_numIndices  = _numIndices;
 			m_draw.m_indexBuffer = _handle;
 			m_draw.m_indexBuffer = _handle;
@@ -2415,7 +2415,7 @@ namespace bgfx
 
 
 		void setIndexBuffer(const DynamicIndexBuffer& _dib, uint32_t _firstIndex, uint32_t _numIndices)
 		void setIndexBuffer(const DynamicIndexBuffer& _dib, uint32_t _firstIndex, uint32_t _numIndices)
 		{
 		{
-			BX_ASSERT(UINT8_MAX != m_draw.m_streamMask, "");
+			BX_ASSERT(UINT8_MAX != m_draw.m_streamMask, "bgfx::setVertexCount was already called for this draw call.");
 			const uint32_t indexSize = 0 == (_dib.m_flags & BGFX_BUFFER_INDEX32) ? 2 : 4;
 			const uint32_t indexSize = 0 == (_dib.m_flags & BGFX_BUFFER_INDEX32) ? 2 : 4;
 			m_draw.m_startIndex  = _dib.m_startIndex + _firstIndex;
 			m_draw.m_startIndex  = _dib.m_startIndex + _firstIndex;
 			m_draw.m_numIndices  = bx::min(_numIndices, _dib.m_size/indexSize);
 			m_draw.m_numIndices  = bx::min(_numIndices, _dib.m_size/indexSize);
@@ -2424,7 +2424,7 @@ namespace bgfx
 
 
 		void setIndexBuffer(const TransientIndexBuffer* _tib, uint32_t _firstIndex, uint32_t _numIndices)
 		void setIndexBuffer(const TransientIndexBuffer* _tib, uint32_t _firstIndex, uint32_t _numIndices)
 		{
 		{
-			BX_ASSERT(UINT8_MAX != m_draw.m_streamMask, "");
+			BX_ASSERT(UINT8_MAX != m_draw.m_streamMask, "bgfx::setVertexCount was already called for this draw call.");
 			const uint32_t numIndices = bx::min(_numIndices, _tib->size/2);
 			const uint32_t numIndices = bx::min(_numIndices, _tib->size/2);
 			m_draw.m_indexBuffer = _tib->handle;
 			m_draw.m_indexBuffer = _tib->handle;
 			m_draw.m_startIndex  = _tib->startIndex + _firstIndex;
 			m_draw.m_startIndex  = _tib->startIndex + _firstIndex;
@@ -2440,7 +2440,7 @@ namespace bgfx
 			, VertexLayoutHandle _layoutHandle
 			, VertexLayoutHandle _layoutHandle
 			)
 			)
 		{
 		{
-			BX_ASSERT(UINT8_MAX != m_draw.m_streamMask, "");
+			BX_ASSERT(UINT8_MAX != m_draw.m_streamMask, "bgfx::setVertexCount was already called for this draw call.");
 			BX_ASSERT(_stream < BGFX_CONFIG_MAX_VERTEX_STREAMS, "Invalid stream %d (max %d).", _stream, BGFX_CONFIG_MAX_VERTEX_STREAMS);
 			BX_ASSERT(_stream < BGFX_CONFIG_MAX_VERTEX_STREAMS, "Invalid stream %d (max %d).", _stream, BGFX_CONFIG_MAX_VERTEX_STREAMS);
 			if (m_draw.setStreamBit(_stream, _handle) )
 			if (m_draw.setStreamBit(_stream, _handle) )
 			{
 			{
@@ -2460,7 +2460,7 @@ namespace bgfx
 			, VertexLayoutHandle _layoutHandle
 			, VertexLayoutHandle _layoutHandle
 			)
 			)
 		{
 		{
-			BX_ASSERT(UINT8_MAX != m_draw.m_streamMask, "");
+			BX_ASSERT(UINT8_MAX != m_draw.m_streamMask, "bgfx::setVertexCount was already called for this draw call.");
 			BX_ASSERT(_stream < BGFX_CONFIG_MAX_VERTEX_STREAMS, "Invalid stream %d (max %d).", _stream, BGFX_CONFIG_MAX_VERTEX_STREAMS);
 			BX_ASSERT(_stream < BGFX_CONFIG_MAX_VERTEX_STREAMS, "Invalid stream %d (max %d).", _stream, BGFX_CONFIG_MAX_VERTEX_STREAMS);
 			if (m_draw.setStreamBit(_stream, _dvb.m_handle) )
 			if (m_draw.setStreamBit(_stream, _dvb.m_handle) )
 			{
 			{
@@ -2482,7 +2482,7 @@ namespace bgfx
 			, VertexLayoutHandle _layoutHandle
 			, VertexLayoutHandle _layoutHandle
 			)
 			)
 		{
 		{
-			BX_ASSERT(UINT8_MAX != m_draw.m_streamMask, "");
+			BX_ASSERT(UINT8_MAX != m_draw.m_streamMask, "bgfx::setVertexCount was already called for this draw call.");
 			BX_ASSERT(_stream < BGFX_CONFIG_MAX_VERTEX_STREAMS, "Invalid stream %d (max %d).", _stream, BGFX_CONFIG_MAX_VERTEX_STREAMS);
 			BX_ASSERT(_stream < BGFX_CONFIG_MAX_VERTEX_STREAMS, "Invalid stream %d (max %d).", _stream, BGFX_CONFIG_MAX_VERTEX_STREAMS);
 			if (m_draw.setStreamBit(_stream, _tvb->handle) )
 			if (m_draw.setStreamBit(_stream, _tvb->handle) )
 			{
 			{

+ 2 - 2
src/renderer_vk.cpp

@@ -6943,8 +6943,6 @@ VK_DESTROY
 							, uint8_t(draw.m_instanceDataStride/16)
 							, uint8_t(draw.m_instanceDataStride/16)
 							);
 							);
 
 
-					uint16_t scissor = draw.m_scissor;
-
 					if (pipeline != currentPipeline
 					if (pipeline != currentPipeline
 					||  0 != changedStencil)
 					||  0 != changedStencil)
 					{
 					{
@@ -6975,6 +6973,8 @@ VK_DESTROY
 //						m_commandList->IASetPrimitiveTopology(prim.m_topology);
 //						m_commandList->IASetPrimitiveTopology(prim.m_topology);
 					}
 					}
 
 
+					const uint16_t scissor = draw.m_scissor;
+
 					if (currentState.m_scissor != scissor)
 					if (currentState.m_scissor != scissor)
 					{
 					{
 						currentState.m_scissor = scissor;
 						currentState.m_scissor = scissor;