Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
D3D11: Increase bool uniform buffer size (thanks @jeffphilp!)
  • Loading branch information
flibitijibibo committed Oct 15, 2020
1 parent 385d4d8 commit 3f92b17
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions mojoshader_d3d11.c
Expand Up @@ -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;
Expand Down

0 comments on commit 3f92b17

Please sign in to comment.