i965: Torch public intel_batchbuffer_emit_dword/float helpers.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 5 Jan 2018 20:27:41 +0000 (12:27 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Sun, 7 Jan 2018 04:10:32 +0000 (20:10 -0800)
intel_batchbuffer_emit_float is dead code, it should go.

intel_batchbuffer_emit_dword only had one user, which had bungled using
them by forgetting to call intel_batchbuffer_require_space first.  So it
seems wise to delete these unsafe helpers.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/intel_batchbuffer.c
src/mesa/drivers/dri/i965/intel_batchbuffer.h

index 3fd8e05d3dc46d8ce3a3dd2db0ec0f82840ddefa..a17e1699254c5778f8c9e978468bb3db32b216cb 100644 (file)
@@ -692,9 +692,9 @@ brw_finish_batch(struct brw_context *brw)
     * necessary by emitting an extra MI_NOOP after the end.
     */
    intel_batchbuffer_require_space(brw, 8, brw->batch.ring);
-   intel_batchbuffer_emit_dword(&brw->batch, MI_BATCH_BUFFER_END);
+   *brw->batch.map_next++ = MI_BATCH_BUFFER_END;
    if (USED_BATCH(brw->batch) & 1) {
-      intel_batchbuffer_emit_dword(&brw->batch, MI_NOOP);
+      *brw->batch.map_next++ = MI_NOOP;
    }
 
    brw->batch.no_wrap = false;
index a927fe7e09ec6fdb0dbfb29fb66ce0f331d0c2e0..a9a34600ad1256f397faf265ff2e70331e8042f2 100644 (file)
@@ -78,19 +78,6 @@ static inline uint32_t float_as_int(float f)
    return fi.d;
 }
 
-static inline void
-intel_batchbuffer_emit_dword(struct intel_batchbuffer *batch, GLuint dword)
-{
-   *batch->map_next++ = dword;
-   assert(batch->ring != UNKNOWN_RING);
-}
-
-static inline void
-intel_batchbuffer_emit_float(struct intel_batchbuffer *batch, float f)
-{
-   intel_batchbuffer_emit_dword(batch, float_as_int(f));
-}
-
 static inline void
 intel_batchbuffer_begin(struct brw_context *brw, int n, enum brw_gpu_ring ring)
 {