From 3f92b17b13f8e5052f7a9c4be4492ac1ab313619 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Thu, 15 Oct 2020 01:17:45 -0400 Subject: [PATCH] D3D11: Increase bool uniform buffer size (thanks @jeffphilp!) --- mojoshader_d3d11.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mojoshader_d3d11.c b/mojoshader_d3d11.c index a0c6e76..97f1815 100644 --- a/mojoshader_d3d11.c +++ b/mojoshader_d3d11.c @@ -646,11 +646,8 @@ MOJOSHADER_d3d11Shader *MOJOSHADER_d3d11CompileShader(const char *mainfn, // 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;