struct brw_surface_key key;
struct intel_context *intel = &brw->intel;
const int size = params->NumParameters * 4 * sizeof(GLfloat);
+ struct brw_fragment_program *fp =
+ (struct brw_fragment_program *) brw->fragment_program;
+
+ if (!fp->use_const_buffer) {
+ dri_bo_unreference(const_buffer);
+ brw->wm.surf_bo[surf] = NULL;
+ return NULL;
+ }
/* free old const buffer if too small */
if (const_buffer && const_buffer->size < size) {
struct brw_surface_key key;
struct intel_context *intel = &brw->intel;
const int size = params->NumParameters * 4 * sizeof(GLfloat);
+ struct brw_vertex_program *vp =
+ (struct brw_vertex_program *) brw->vertex_program;
assert(surf == 0);
*/
dri_bo_unreference(const_buffer);
+ if (!vp->use_const_buffer) {
+ brw->vs.surf_bo[surf] = NULL;
+ return NULL;
+ }
+
/* alloc new buffer */
const_buffer =
drm_intel_bo_alloc(intel->bufmgr, "vp_const_buffer", size, 64);
brw_update_wm_constant_surface(ctx, surf, fp->const_buffer,
fp->program.Base.Parameters);
- brw->wm.nr_surfaces = surf + 1;
+ if (fp->const_buffer != NULL)
+ brw->wm.nr_surfaces = surf + 1;
}
/* Update surfaces for textures */