struct gl_vertex_program program;
GLuint id;
dri_bo *const_buffer; /** Program constant buffer/surface */
+ GLboolean use_const_buffer;
};
GLboolean isGLSL; /**< really, any IF/LOOP/CONT/BREAK instructions */
dri_bo *const_buffer; /** Program constant buffer/surface */
+ GLboolean use_const_buffer;
};
printf("update VS constants in buffer %p\n", vp->const_buffer);
printf("program %u\n", vp->program.Base.Id);
}
- update_constant_buffer(brw, vp->program.Base.Parameters, vp->const_buffer);
+ if (vp->use_const_buffer)
+ update_constant_buffer(brw, vp->program.Base.Parameters, vp->const_buffer);
}
{
struct brw_fragment_program *fp =
(struct brw_fragment_program *) brw->fragment_program;
- update_constant_buffer(brw, fp->program.Base.Parameters, fp->const_buffer);
+ if (fp->use_const_buffer)
+ update_constant_buffer(brw, fp->program.Base.Parameters, fp->const_buffer);
}
struct brw_reg userplane[6];
- /** using a real constant buffer? */
- GLboolean use_const_buffer;
/** we may need up to 3 constants per instruction (if use_const_buffer) */
struct {
GLint index;
#if 0
if (c->vp->program.Base.Parameters->NumParameters >= 6)
- c->use_const_buffer = 1;
+ c->vp->use_const_buffer = 1;
else
#endif
- c->use_const_buffer = GL_FALSE;
+ c->vp->use_const_buffer = GL_FALSE;
/*printf("use_const_buffer = %d\n", c->use_const_buffer);*/
/* r0 -- reserved as usual
/* Vertex program parameters from curbe:
*/
- if (c->use_const_buffer) {
+ if (c->vp->use_const_buffer) {
/* get constants from a real constant buffer */
c->prog_data.curb_read_length = 0;
c->prog_data.nr_params = 4; /* XXX 0 causes a bug elsewhere... */
reg++;
}
- if (c->use_const_buffer) {
+ if (c->vp->use_const_buffer) {
for (i = 0; i < 3; i++) {
c->current_const[i].index = -1;
c->current_const[i].reg = brw_vec8_grf(reg, 0);
case PROGRAM_STATE_VAR:
case PROGRAM_CONSTANT:
case PROGRAM_UNIFORM:
- if (c->use_const_buffer) {
+ if (c->vp->use_const_buffer) {
return get_constant(c, inst, argIndex);
}
else if (relAddr) {
GLuint tmp_max;
GLuint subroutines[BRW_WM_MAX_SUBROUTINE];
- /** using a real constant buffer? */
- GLboolean use_const_buffer;
/** we may need up to 3 constants per instruction (if use_const_buffer) */
struct {
GLint index;
const int nr_params = c->fp->program.Base.Parameters->NumParameters;
/* use a real constant buffer, or just use a section of the GRF? */
- c->use_const_buffer = GL_FALSE; /* (nr_params > 8);*/
+ c->fp->use_const_buffer = GL_FALSE; /* (nr_params > 8);*/
- if (c->use_const_buffer) {
+ if (c->fp->use_const_buffer) {
/* We'll use a real constant buffer and fetch constants from
* it with a dataport read message.
*/
* They'll be found in these registers.
* XXX alloc these on demand!
*/
- if (c->use_const_buffer) {
+ if (c->fp->use_const_buffer) {
for (i = 0; i < 3; i++) {
c->current_const[i].index = -1;
c->current_const[i].reg = alloc_tmp(c);
}
}
#if 0
- printf("USE CONST BUFFER? %d\n", c->use_const_buffer);
+ printf("USE CONST BUFFER? %d\n", c->fp->use_const_buffer);
printf("AFTER PRE_ALLOC, reg_index = %d\n", c->reg_index);
#endif
}
const GLuint nr = 1;
const GLuint component = GET_SWZ(src->Swizzle, channel);
- if (c->use_const_buffer &&
+ if (c->fp->use_const_buffer &&
(src->File == PROGRAM_STATE_VAR ||
src->File == PROGRAM_CONSTANT ||
src->File == PROGRAM_UNIFORM)) {
#endif
/* fetch any constants that this instruction needs */
- if (c->use_const_buffer)
+ if (c->fp->use_const_buffer)
fetch_constants(c, inst);
if (inst->CondUpdate)