Browse Source

Prevent D3D12 error creating a 0 sized buffer, while creating a 0 sized buffer is legit using heaps API.

clementlandrin 2 years ago
parent
commit
7f2dff4700
1 changed files with 1 additions and 0 deletions
  1. 1 0
      h3d/impl/DX12Driver.hx

+ 1 - 0
h3d/impl/DX12Driver.hx

@@ -1343,6 +1343,7 @@ class DX12Driver extends h3d.impl.Driver {
 		var b = frame.availableBuffers, prev = null;
 		var tmpBuf = null;
 		var size = calcCBVSize(dataSize);
+		if ( size == 0 ) size = 1;
 		while( b != null ) {
 			if( b.size >= size && b.size < size << 1 ) {
 				tmpBuf = b.buffer;