i965: clip: Remove no-longer-needed variables.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_draw_upload.c
index 32a1d297479f9646b2c02cf4fb2ba1109fd43671..7bc69c612e321b89480221aced8406300b36d5f2 100644 (file)
@@ -542,7 +542,7 @@ static void brw_emit_vertices(struct brw_context *brw)
     */
    if (brw->vb.nr_enabled == 0) {
       BEGIN_BATCH(3);
-      OUT_BATCH((CMD_VERTEX_ELEMENT << 16) | 1);
+      OUT_BATCH((_3DSTATE_VERTEX_ELEMENTS << 16) | 1);
       if (intel->gen >= 6) {
         OUT_BATCH((0 << GEN6_VE0_INDEX_SHIFT) |
                   GEN6_VE0_VALID |
@@ -567,7 +567,7 @@ static void brw_emit_vertices(struct brw_context *brw)
 
    if (brw->vb.nr_buffers) {
       BEGIN_BATCH(1 + 4*brw->vb.nr_buffers);
-      OUT_BATCH((CMD_VERTEX_BUFFER << 16) | (4*brw->vb.nr_buffers - 1));
+      OUT_BATCH((_3DSTATE_VERTEX_BUFFERS << 16) | (4*brw->vb.nr_buffers - 1));
       for (i = 0; i < brw->vb.nr_buffers; i++) {
         struct brw_vertex_buffer *buffer = &brw->vb.buffers[i];
         uint32_t dw0;
@@ -598,7 +598,7 @@ static void brw_emit_vertices(struct brw_context *brw)
    }
 
    BEGIN_BATCH(1 + brw->vb.nr_enabled * 2);
-   OUT_BATCH((CMD_VERTEX_ELEMENT << 16) | (2*brw->vb.nr_enabled - 1));
+   OUT_BATCH((_3DSTATE_VERTEX_ELEMENTS << 16) | (2*brw->vb.nr_enabled - 1));
    for (i = 0; i < brw->vb.nr_enabled; i++) {
       struct brw_vertex_element *input = brw->vb.enabled[i];
       uint32_t format = get_surface_type(input->glarray->Type,
@@ -689,17 +689,17 @@ static void brw_prepare_indices(struct brw_context *brw)
        * rebase it into a temporary.
        */
        if ((get_size(index_buffer->type) - 1) & offset) {
-           GLubyte *map = ctx->Driver.MapBuffer(ctx,
-                                                GL_ELEMENT_ARRAY_BUFFER_ARB,
-                                                GL_DYNAMIC_DRAW_ARB,
-                                                bufferobj);
-           map += offset;
+           GLubyte *map = ctx->Driver.MapBufferRange(ctx,
+                                                    offset,
+                                                    ib_size,
+                                                    GL_MAP_WRITE_BIT,
+                                                    bufferobj);
 
           intel_upload_data(&brw->intel, map, ib_size, ib_type_size,
                             &bo, &offset);
           brw->ib.start_vertex_offset = offset / ib_type_size;
 
-           ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, bufferobj);
+           ctx->Driver.UnmapBuffer(ctx, bufferobj);
        } else {
          /* Use CMD_3D_PRIM's start_vertex_offset to avoid re-uploading
           * the index buffer state when we're just moving the start index