i965/vs: Remove support for the old parameter layout.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 26 Oct 2012 17:51:02 +0000 (10:51 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 1 Nov 2012 21:29:29 +0000 (14:29 -0700)
Only the old backend used it.

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_curbe.c
src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
src/mesa/drivers/dri/i965/brw_vs_state.c
src/mesa/drivers/dri/i965/gen6_vs_state.c

index 38a0cc7c8245dff0a2cff451812f0e0f46149990..9fa4848af3acd600fc525346a33f014f43b8f1a4 100644 (file)
@@ -451,7 +451,6 @@ struct brw_vs_prog_data {
     */
    GLuint urb_entry_size;
 
-   bool uses_new_param_layout;
    bool uses_vertexid;
    bool userclip;
 
index 35980bb21709fd2e47ed7db329a890b4621fddb0..8f196f4830b8136993fa4f6a7d5305ebb71ef598 100644 (file)
@@ -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];
       }
    }
 
index 1567765173bfe6279e984b7b7af1146ec4487374..812fa47fbb7ebc3c1da3e390d846f47d57282538 100644 (file)
@@ -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;
 }
index f57212349572718af4ad5e98acef7a28aa544329..a72a283982fa5face96d68b4e8b5fdf4ace84e02 100644 (file)
@@ -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) {
index 0e80c27b912a179a57954428474a322db09cb4bc..d293482ed8e2da200851d46e7256f2d88449dbf9 100644 (file)
@@ -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]);
         }