mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 15:50:11 +01:00
i965/vs: Remove support for the old parameter layout.
Only the old backend used it. Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
4b2457b548
commit
ab973403e4
5 changed files with 7 additions and 70 deletions
|
|
@ -451,7 +451,6 @@ struct brw_vs_prog_data {
|
|||
*/
|
||||
GLuint urb_entry_size;
|
||||
|
||||
bool uses_new_param_layout;
|
||||
bool uses_vertexid;
|
||||
bool userclip;
|
||||
|
||||
|
|
|
|||
|
|
@ -184,8 +184,6 @@ brw_upload_constant_buffer(struct brw_context *brw)
|
|||
{
|
||||
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;
|
||||
|
|
@ -249,24 +247,9 @@ brw_upload_constant_buffer(struct brw_context *brw)
|
|||
/* 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];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,6 @@ vec4_visitor::setup_uniforms(int reg)
|
|||
c->prog_data.nr_params = this->uniforms * 4;
|
||||
|
||||
c->prog_data.curb_read_length = reg - 1;
|
||||
c->prog_data.uses_new_param_layout = true;
|
||||
|
||||
return reg;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ static void
|
|||
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,
|
||||
|
|
@ -89,16 +88,7 @@ brw_upload_vs_unit(struct brw_context *brw)
|
|||
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) {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ gen6_upload_vs_push_constants(struct brw_context *brw)
|
|||
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.
|
||||
|
|
@ -63,48 +62,15 @@ gen6_upload_vs_push_constants(struct brw_context *brw)
|
|||
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]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue