st/mesa: fix GLSL uniform updates for glBitmap & glDrawPixels (v2)
[mesa.git] / src / mesa / state_tracker / st_glsl_to_tgsi.cpp
index ad3a68465585aed98b31330b48d6eb0f7234e674..cdbe2f4f8a88de14f2fccd089e18e5d32b83617b 100644 (file)
@@ -5688,6 +5688,12 @@ get_mesa_program(struct gl_context *ctx,
 
    _mesa_reference_program(ctx, &shader->Program, prog);
 
+   /* Avoid reallocation of the program parameter list, because the uniform
+    * storage is only associated with the original parameter list.
+    * This should be enough for Bitmap and DrawPixels constants.
+    */
+   _mesa_reserve_parameter_storage(prog->Parameters, 8);
+
    /* This has to be done last.  Any operation the can cause
     * prog->ParameterValues to get reallocated (e.g., anything that adds a
     * program constant) has to happen before creating this linkage.