r300g: simplify reloc macros
authorMarek Olšák <maraeo@gmail.com>
Mon, 14 Jun 2010 00:26:02 +0000 (02:26 +0200)
committerMarek Olšák <maraeo@gmail.com>
Mon, 14 Jun 2010 10:46:37 +0000 (12:46 +0200)
src/gallium/drivers/r300/r300_cs.h
src/gallium/drivers/r300/r300_screen_buffer.h

index 91e5dee0b0146c394b107340516b5e98302bb862..0baa20f08ddce6e18b52d67457dca20a6e55c728 100644 (file)
  * Writing relocations.
  */
 
-#define OUT_CS_BUF_RELOC(bo, offset, rd, wd, flags) do { \
+#define OUT_CS_RELOC(bo, offset, rd, wd, flags) do { \
     assert(bo); \
     cs_winsys->write_cs_dword(cs_winsys, offset); \
-    r300_buffer_write_reloc(cs_winsys, r300_buffer(bo), rd, wd, flags);        \
+    cs_winsys->write_cs_reloc(cs_winsys, bo, rd, wd, flags); \
     CS_DEBUG(cs_count -= 3;) \
 } while (0)
 
+#define OUT_CS_BUF_RELOC(bo, offset, rd, wd, flags) do { \
+    assert(bo); \
+    OUT_CS_RELOC(r300_buffer(bo)->buf, offset, rd, wd, flags); \
+} while (0)
+
 #define OUT_CS_TEX_RELOC(tex, offset, rd, wd, flags) do { \
     assert(tex); \
-    cs_winsys->write_cs_dword(cs_winsys, offset); \
-    r300_texture_write_reloc(cs_winsys, tex, rd, wd, flags);   \
-    CS_DEBUG(cs_count -= 3;) \
+    OUT_CS_RELOC(tex->buffer, offset, rd, wd, flags); \
 } while (0)
 
 #define OUT_CS_BUF_RELOC_NO_OFFSET(bo, rd, wd, flags) do { \
     assert(bo); \
-    r300_buffer_write_reloc(cs_winsys, r300_buffer(bo), rd, wd, flags);        \
+    cs_winsys->write_cs_reloc(cs_winsys, r300_buffer(bo)->buf, rd, wd, flags); \
     CS_DEBUG(cs_count -= 2;) \
 } while (0)
 
-#define OUT_CS_INDEX_RELOC(bo, offset, count, rd, wd, flags) do { \
-    assert(bo); \
-    cs_winsys->write_cs_dword(cs_winsys, offset); \
-    cs_winsys->write_cs_dword(cs_winsys, count); \
-    cs_winsys->write_cs_reloc(cs_winsys, bo, rd, wd, flags); \
-    CS_DEBUG(cs_count -= 4;) \
-} while (0)
-
 
 /**
  * Command buffer emission.
index 87b42b94122a231dd641e58e85824ea9ce9291a0..ff355858704c5bf8da95abbc6454ea602ded1507 100644 (file)
@@ -116,25 +116,4 @@ static INLINE boolean r300_add_texture(struct r300_winsys_screen *rws,
     return rws->add_buffer(rws, tex->buffer, rd, wr);
 }
 
-static INLINE void r300_buffer_write_reloc(struct r300_winsys_screen *rws,
-                                     struct r300_buffer *buf,
-                                     enum r300_buffer_domain rd,
-                                      enum r300_buffer_domain wd,
-                                      uint32_t flags)
-{
-    if (!buf->buf)
-       return;
-
-    rws->write_cs_reloc(rws, buf->buf, rd, wd, flags);
-}
-
-static INLINE void r300_texture_write_reloc(struct r300_winsys_screen *rws,
-                                           struct r300_texture *texture,
-                                           enum r300_buffer_domain rd,
-                                            enum r300_buffer_domain wd,
-                                            uint32_t flags)
-{
-    rws->write_cs_reloc(rws, texture->buffer, rd, wd, flags);
-}
-
 #endif