st/mesa: calculate buffer size correctly for packed uniforms
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 29 Oct 2018 09:27:08 +0000 (20:27 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 30 Oct 2018 22:32:41 +0000 (09:32 +1100)
Fixes: edded1237607 ("mesa: rework ParameterList to allow packing")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_atom_constbuf.c

index 6455e612e4ee556f02f57348021c01cda91a5741..fa147b8968849db6aac7316b7ca5610b9a400a9a 100644 (file)
@@ -92,7 +92,7 @@ st_upload_constants(struct st_context *st, struct gl_program *prog)
    /* update constants */
    if (params && params->NumParameters) {
       struct pipe_constant_buffer cb;
-      const uint paramBytes = params->NumParameters * sizeof(GLfloat) * 4;
+      const uint paramBytes = params->NumParameterValues * sizeof(GLfloat);
 
       /* Update the constants which come from fixed-function state, such as
        * transformation matrices, fog factors, etc.  The rest of the values in