D3D11: Increase bool uniform buffer size (thanks @jeffphilp!)
authorEthan Lee <flibitijibibo@flibitijibibo.com>
Thu, 15 Oct 2020 01:17:45 -0400
changeset 1314 3ddd9fca664f
parent 1313 67bd5adc03c5
child 1315 c54ad4b34c03
D3D11: Increase bool uniform buffer size (thanks @jeffphilp!)
mojoshader_d3d11.c
--- a/mojoshader_d3d11.c	Thu Oct 15 01:03:56 2020 -0400
+++ b/mojoshader_d3d11.c	Thu Oct 15 01:17:45 2020 -0400
@@ -646,11 +646,8 @@
         // Calculate how big we need to make the buffer
         for (i = 0; i < pd->uniform_count; i++)
         {
-            int arrayCount = pd->uniforms[i].array_count;
-            int uniformSize = 16;
-            if (pd->uniforms[i].type == MOJOSHADER_UNIFORM_BOOL)
-                uniformSize = 1;
-            retval->buflen += (arrayCount ? arrayCount : 1) * uniformSize;
+            const int arrayCount = pd->uniforms[i].array_count;
+            retval->buflen += (arrayCount ? arrayCount : 1) * 16;
         } // for
 
         D3D11_BUFFER_DESC bdesc;