Bring in latest revision of r300_lib.
authorVladimir Dergachev <volodya@freedesktop.org>
Wed, 29 Dec 2004 03:48:05 +0000 (03:48 +0000)
committerVladimir Dergachev <volodya@freedesktop.org>
Wed, 29 Dec 2004 03:48:05 +0000 (03:48 +0000)
New capabilities: using vertex buffers, immediate vertex data, immediate indices.

src/mesa/drivers/dri/r300/r300_emit.h
src/mesa/drivers/dri/r300/r300_render.c

index cd995dcced2a6d1c72faf80fda06e495ff4ae427..cd49602fc5dc90488e9719e0684fd2987955f589 100644 (file)
@@ -86,6 +86,16 @@ static __inline__ uint32_t cmdvpu(int addr, int count)
        return cmd.u;
 }
 
+static __inline__ uint32_t cmdpacket3(int packet)
+{
+       drm_r300_cmd_header_t cmd;
+
+       cmd.packet3.cmd_type = R300_CMD_PACKET3;
+       cmd.packet3.packet = packet;
+
+       return cmd.u;
+}
+
 /* Prepare to write a register value to register at address reg.
    If num_extra > 0 then the following extra values are written
    to registers with address +4, +8 and so on.. */
@@ -104,6 +114,8 @@ static __inline__ uint32_t cmdvpu(int addr, int count)
 /* Prepare to write a register value to register at address reg.
    If num_extra > 0 then the following extra values are written
    into the same register. */
+/* It is here to permit r300_lib to compile and link anyway, but
+   complain if actually called */
 #define reg_start_pump(reg, num_extra) \
        { \
        fprintf(stderr, "I am not defined.. Error ! in %s::%s at line %d\n", \
@@ -137,6 +149,26 @@ static __inline__ uint32_t cmdvpu(int addr, int count)
        cmd[0].i=cmdvpu((dest), _n/4); \
        }
 
+#define start_packet3(packet, count)   \
+       { \
+       int _n; \
+       CARD32 _p; \
+       _n=(count); \
+       _p=(packet); \
+       cmd=(drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, \
+                                       (_n+3), \
+                                       __FUNCTION__); \
+       cmd_reserved=_n+3; \
+       cmd_written=2; \
+       if(_n>0x3fff) {\
+               fprintf(stderr,"Too big packet3 %08x: cannot store %d dwords\n", \
+                       _p, _n); \
+               exit(-1); \
+               } \
+       cmd[0].i=cmdpacket3(R300_CMD_PACKET3_RAW); \
+       cmd[1].i=_p | ((_n & 0x3fff)<<16); \
+       }
+
        /* must be sent to switch to 2d commands */
 void static inline end_3d(PREFIX_VOID)
 {
index 92d629f3b713282819fc228f94ff743401a8a176..d229b7d55936e93ee91aa6cdcbdf6e2ad12aa18e 100644 (file)
@@ -162,6 +162,9 @@ static void r300_render_primitive(r300ContextPtr rmesa,
                break;
                }
    end_3d(PASS_PREFIX_VOID);
+   
+   start_packet3(RADEON_CP_PACKET3_NOP, 0);
+   e32(0x0);
 }
 
 /**