+ newFP->id = brw->program_id++;
+ newFP->isGLSL = brw_wm_is_glsl(fprog);
+
+ /* alloc constant buffer/surface */
+ {
+ const struct gl_program_parameter_list *params = prog->Parameters;
+ const int size = params->NumParameters * 4 * sizeof(GLfloat);
+
+ /* free old const buffer if too small */
+ if (newFP->const_buffer && newFP->const_buffer->size < size) {
+ dri_bo_unreference(newFP->const_buffer);
+ newFP->const_buffer = NULL;
+ }
+
+ if (!newFP->const_buffer) {
+ newFP->const_buffer = drm_intel_bo_alloc(intel->bufmgr,
+ "fp_const_buffer",
+ size, 64);
+ }
+ }