{
struct intel_context *intel = &brw->intel;
struct gl_context *ctx = &intel->ctx;
- const struct brw_vertex_program *vp =
- brw_vertex_program_const(brw->vertex_program);
const GLuint sz = brw->curbe.total_size;
const GLuint bufsz = sz * 16 * sizeof(GLfloat);
GLfloat *buf;
/* vertex shader constants */
if (brw->curbe.vs_size) {
GLuint offset = brw->curbe.vs_start * 16;
- GLuint nr = brw->vs.prog_data->nr_params / 4;
- if (brw->vs.prog_data->uses_new_param_layout) {
- for (i = 0; i < brw->vs.prog_data->nr_params; i++) {
- buf[offset + i] = *brw->vs.prog_data->param[i];
- }
- } else {
- /* Load the subset of push constants that will get used when
- * we also have a pull constant buffer.
- */
- for (i = 0; i < vp->program.Base.Parameters->NumParameters; i++) {
- if (brw->vs.constant_map[i] != -1) {
- assert(brw->vs.constant_map[i] <= nr);
- memcpy(buf + offset + brw->vs.constant_map[i] * 4,
- vp->program.Base.Parameters->ParameterValues[i],
- 4 * sizeof(float));
- }
- }
+ for (i = 0; i < brw->vs.prog_data->nr_params; i++) {
+ buf[offset + i] = *brw->vs.prog_data->param[i];
}
}
brw_upload_vs_unit(struct brw_context *brw)
{
struct intel_context *intel = &brw->intel;
- struct gl_context *ctx = &intel->ctx;
struct brw_vs_unit_state *vs;
vs = brw_state_batch(brw, AUB_TRACE_VS_STATE,
vs->thread3.urb_entry_read_offset = 0;
/* BRW_NEW_CURBE_OFFSETS, _NEW_TRANSFORM, BRW_NEW_VERTEX_PROGRAM */
- if (ctx->Transform.ClipPlanesEnabled && !brw->vs.prog_data->uses_new_param_layout) {
- /* Note that we read in the userclip planes as well, hence
- * clip_start:
- */
- vs->thread3.const_urb_entry_read_offset = brw->curbe.clip_start * 2;
- }
- else {
- vs->thread3.const_urb_entry_read_offset = brw->curbe.vs_start * 2;
- }
-
+ vs->thread3.const_urb_entry_read_offset = brw->curbe.vs_start * 2;
/* BRW_NEW_URB_FENCE */
if (intel->gen == 5) {
const struct brw_vertex_program *vp =
brw_vertex_program_const(brw->vertex_program);
unsigned int nr_params = brw->vs.prog_data->nr_params / 4;
- bool uses_clip_distance = vp->program.UsesClipDistance;
/* Updates the ParamaterValues[i] pointers for all parameters of the
* basic type of PROGRAM_STATE_VAR.
4 * sizeof(float),
32, &brw->vs.push_const_offset);
- float *save_param = param;
-
- if (brw->vs.prog_data->uses_new_param_layout) {
- for (i = 0; i < brw->vs.prog_data->nr_params; i++) {
- *param = *brw->vs.prog_data->param[i];
- param++;
- }
- params_uploaded += brw->vs.prog_data->nr_params / 4;
- } else {
- /* This should be loaded like any other param, but it's ad-hoc
- * until we redo the VS backend.
- */
- if (ctx->Transform.ClipPlanesEnabled != 0 && !uses_clip_distance) {
- gl_clip_plane *clip_planes = brw_select_clip_planes(ctx);
- int num_userclip_plane_consts
- = _mesa_logbase2(ctx->Transform.ClipPlanesEnabled) + 1;
- int num_floats = 4 * num_userclip_plane_consts;
- memcpy(param, clip_planes, num_floats * sizeof(float));
- param += num_floats;
- params_uploaded += num_userclip_plane_consts;
- }
-
- /* Align to a reg for convenience for brw_vs_emit.c */
- if (params_uploaded & 1) {
- param += 4;
- params_uploaded++;
- }
-
- for (i = 0; i < vp->program.Base.Parameters->NumParameters; i++) {
- if (brw->vs.constant_map[i] != -1) {
- memcpy(param + brw->vs.constant_map[i] * 4,
- vp->program.Base.Parameters->ParameterValues[i],
- 4 * sizeof(float));
- params_uploaded++;
- }
- }
+ for (i = 0; i < brw->vs.prog_data->nr_params; i++) {
+ param[i] = *brw->vs.prog_data->param[i];
}
+ params_uploaded += brw->vs.prog_data->nr_params / 4;
if (0) {
printf("VS constant buffer:\n");
for (i = 0; i < params_uploaded; i++) {
- float *buf = save_param + i * 4;
+ float *buf = param + i * 4;
printf("%d: %f %f %f %f\n",
i, buf[0], buf[1], buf[2], buf[3]);
}