brw->new_vs_backend = (getenv("INTEL_NEW_VS") != NULL);
+ /* If we're using the new shader backend, we require integer uniforms
+ * stored as actual integers.
+ */
+ if (brw->new_vs_backend)
+ ctx->Const.NativeIntegers = true;
+
return GL_TRUE;
}
GLuint urb_entry_size;
const float *param[MAX_UNIFORMS * 4]; /* should be: BRW_MAX_CURBE */
- enum param_conversion param_convert[MAX_UNIFORMS * 4];
const float *pull_param[MAX_UNIFORMS * 4];
- enum param_conversion pull_param_convert[MAX_UNIFORMS * 4];
bool uses_new_param_layout;
};
if (brw->vs.prog_data->uses_new_param_layout) {
for (i = 0; i < brw->vs.prog_data->nr_params; i++) {
- buf[offset + i] = convert_param(brw->vs.prog_data->param_convert[i],
- brw->vs.prog_data->param[i]);
+ buf[offset + i] = *brw->vs.prog_data->param[i];
}
} else {
/* Load the subset of push constants that will get used when
unsigned int slot = this->uniforms * 4 + i;
c->prog_data.param[slot] = NULL;
- c->prog_data.param_convert[slot] = PARAM_CONVERT_ZERO;
}
this->uniforms++;
case GLSL_TYPE_INT:
case GLSL_TYPE_BOOL:
for (unsigned int i = 0; i < type->vector_elements; i++) {
- int slot = this->uniforms * 4 + i;
- switch (type->base_type) {
- case GLSL_TYPE_FLOAT:
- c->prog_data.param_convert[slot] = PARAM_NO_CONVERT;
- break;
- case GLSL_TYPE_UINT:
- c->prog_data.param_convert[slot] = PARAM_CONVERT_F2U;
- break;
- case GLSL_TYPE_INT:
- c->prog_data.param_convert[slot] = PARAM_CONVERT_F2I;
- break;
- case GLSL_TYPE_BOOL:
- c->prog_data.param_convert[slot] = PARAM_CONVERT_F2B;
- break;
- default:
- assert(!"not reached");
- c->prog_data.param_convert[slot] = PARAM_NO_CONVERT;
- break;
- }
- c->prog_data.param[slot] = &values[i];
+ c->prog_data.param[this->uniforms * 4 + i] = &values[i];
}
+ /* Set up pad elements to get things aligned to a vec4 boundary. */
for (unsigned int i = type->vector_elements; i < 4; i++) {
- c->prog_data.param_convert[this->uniforms * 4 + i] =
- PARAM_CONVERT_ZERO;
- c->prog_data.param[this->uniforms * 4 + i] = NULL;
+ static float zero = 0;
+
+ c->prog_data.param[this->uniforms * 4 + i] = &zero;
}
this->uniform_size[this->uniforms] = type->vector_elements;
last_swiz = swiz;
c->prog_data.param[this->uniforms * 4 + j] = &values[swiz];
- c->prog_data.param_convert[this->uniforms * 4 + j] = PARAM_NO_CONVERT;
if (swiz <= last_swiz)
this->uniform_size[this->uniforms]++;
}
if (brw->vs.prog_data->uses_new_param_layout) {
for (i = 0; i < brw->vs.prog_data->nr_params; i++) {
- *param = convert_param(brw->vs.prog_data->param_convert[i],
- brw->vs.prog_data->param[i]);
+ *param = *brw->vs.prog_data->param[i];
param++;
}
params_uploaded += brw->vs.prog_data->nr_params / 4;