i965: Remove the create_raw_surface vtbl hook.
authorFrancisco Jerez <currojerez@riseup.net>
Tue, 10 Feb 2015 13:54:55 +0000 (15:54 +0200)
committerFrancisco Jerez <currojerez@riseup.net>
Mon, 2 Mar 2015 12:33:13 +0000 (14:33 +0200)
It's a wrapper around emit_buffer_surface_state with format=RAW, pitch=1,
rw=true and the remaining arguments ordered differently.  There's no point in
having a separate vtbl pointer for that.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
src/mesa/drivers/dri/i965/brw_binding_tables.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
src/mesa/drivers/dri/i965/gen8_surface_state.c

index ea82e717e72a0b4cf379507ab438adc161095fff..08e419144283ffb976de3ea892382e2ad761f9a0 100644 (file)
@@ -68,9 +68,11 @@ brw_upload_binding_table(struct brw_context *brw,
    } else {
       /* Upload a new binding table. */
       if (INTEL_DEBUG & DEBUG_SHADER_TIME) {
-         brw->vtbl.create_raw_surface(
-            brw, brw->shader_time.bo, 0, brw->shader_time.bo->size,
-            &stage_state->surf_offset[prog_data->binding_table.shader_time_start], true);
+         brw->vtbl.emit_buffer_surface_state(
+            brw, &stage_state->surf_offset[
+                    prog_data->binding_table.shader_time_start],
+            brw->shader_time.bo, 0, BRW_SURFACEFORMAT_RAW,
+            brw->shader_time.bo->size, 1, true);
       }
 
       uint32_t *bind = brw_state_batch(brw, AUB_TRACE_BINDING_TABLE,
index 197ed3e6dc6d233dfa6e2ef92414b76d293ea74e..c89e90ec3ad899f0e697cfac7a7c0307c25611e0 100644 (file)
@@ -964,12 +964,6 @@ struct brw_context
                                          bool layered,
                                          unsigned unit);
 
-      void (*create_raw_surface)(struct brw_context *brw,
-                                 drm_intel_bo *bo,
-                                 uint32_t offset,
-                                 uint32_t size,
-                                 uint32_t *out_offset,
-                                 bool rw);
       void (*emit_buffer_surface_state)(struct brw_context *brw,
                                         uint32_t *out_offset,
                                         drm_intel_bo *bo,
index f479f44d7cbdc500cb7a38cdf00e143a3907064b..828893bdc6213ccdd495d4bca0c7b728f76225c6 100644 (file)
@@ -953,9 +953,9 @@ brw_upload_abo_surfaces(struct brw_context *brw,
       drm_intel_bo *bo = intel_bufferobj_buffer(
          brw, intel_bo, binding->Offset, intel_bo->Base.Size - binding->Offset);
 
-      brw->vtbl.create_raw_surface(brw, bo, binding->Offset,
-                                   bo->size - binding->Offset,
-                                   &surf_offsets[i], true);
+      brw->vtbl.emit_buffer_surface_state(brw, &surf_offsets[i], bo,
+                                          binding->Offset, BRW_SURFACEFORMAT_RAW,
+                                          bo->size - binding->Offset, 1, true);
    }
 
    if (prog->NumAtomicBuffers)
index 12b588fdf12b0625a40c012302456b17f9e5b490..7d78515543c1ce465cae8025a3086f8959d4bf51 100644 (file)
@@ -372,24 +372,6 @@ gen7_update_texture_surface(struct gl_context *ctx,
    gen7_check_surface_setup(surf, false /* is_render_target */);
 }
 
-/**
- * Create a raw surface for untyped R/W access.
- */
-static void
-gen7_create_raw_surface(struct brw_context *brw, drm_intel_bo *bo,
-                        uint32_t offset, uint32_t size,
-                        uint32_t *out_offset, bool rw)
-{
-   gen7_emit_buffer_surface_state(brw,
-                                  out_offset,
-                                  bo,
-                                  offset,
-                                  BRW_SURFACEFORMAT_RAW,
-                                  size,
-                                  1,
-                                  true /* rw */);
-}
-
 /**
  * Creates a null surface.
  *
@@ -563,6 +545,5 @@ gen7_init_vtable_surface_functions(struct brw_context *brw)
    brw->vtbl.update_texture_surface = gen7_update_texture_surface;
    brw->vtbl.update_renderbuffer_surface = gen7_update_renderbuffer_surface;
    brw->vtbl.emit_null_surface_state = gen7_emit_null_surface_state;
-   brw->vtbl.create_raw_surface = gen7_create_raw_surface;
    brw->vtbl.emit_buffer_surface_state = gen7_emit_buffer_surface_state;
 }
index d6b870ec4cd170cfc3233d79e619052363655d13..7f82f537b562b9ecd06474f4cd4bbce12b4860f0 100644 (file)
@@ -274,21 +274,6 @@ gen8_update_texture_surface(struct gl_context *ctx,
                            I915_GEM_DOMAIN_SAMPLER, 0);
 }
 
-static void
-gen8_create_raw_surface(struct brw_context *brw, drm_intel_bo *bo,
-                        uint32_t offset, uint32_t size,
-                        uint32_t *out_offset, bool rw)
-{
-   gen8_emit_buffer_surface_state(brw,
-                                  out_offset,
-                                  bo,
-                                  offset,
-                                  BRW_SURFACEFORMAT_RAW,
-                                  size,
-                                  1,
-                                  true /* rw */);
-}
-
 /**
  * Creates a null surface.
  *
@@ -456,6 +441,5 @@ gen8_init_vtable_surface_functions(struct brw_context *brw)
    brw->vtbl.update_texture_surface = gen8_update_texture_surface;
    brw->vtbl.update_renderbuffer_surface = gen8_update_renderbuffer_surface;
    brw->vtbl.emit_null_surface_state = gen8_emit_null_surface_state;
-   brw->vtbl.create_raw_surface = gen8_create_raw_surface;
    brw->vtbl.emit_buffer_surface_state = gen8_emit_buffer_surface_state;
 }