r300-gallium: Clean up compile warnings and strict compile errors.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Sat, 4 Apr 2009 07:31:49 +0000 (00:31 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Sat, 4 Apr 2009 07:36:04 +0000 (00:36 -0700)
src/gallium/drivers/r300/r300_emit.c
src/gallium/drivers/r300/r300_query.c
src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/r300/r300_surface.c
src/gallium/drivers/r300/r300_surface.h

index 989fba74df030b3e9f6ca55a8ec3f6f0071c6fe1..0ee32334460fa82af571207a1335bf9daf4699ed 100644 (file)
@@ -82,8 +82,8 @@ void r300_emit_dsa_state(struct r300_context* r300,
 void r300_emit_fragment_shader(struct r300_context* r300,
                                struct r300_fragment_shader* fs)
 {
-    CS_LOCALS(r300);
     int i;
+    CS_LOCALS(r300);
 
     BEGIN_CS(22);
 
@@ -114,10 +114,10 @@ void r300_emit_fragment_shader(struct r300_context* r300,
 void r500_emit_fragment_shader(struct r300_context* r300,
                                struct r500_fragment_shader* fs)
 {
-    CS_LOCALS(r300);
+    int i;
     struct r300_constant_buffer* constants =
         &r300->shader_constants[PIPE_SHADER_FRAGMENT];
-    int i;
+    CS_LOCALS(r300);
 
     BEGIN_CS(9 + (fs->instruction_count * 6) + (constants->count ? 3 : 0) +
             (constants->count * 4));
@@ -156,9 +156,9 @@ void r500_emit_fragment_shader(struct r300_context* r300,
 void r300_emit_fb_state(struct r300_context* r300,
                         struct pipe_framebuffer_state* fb)
 {
-    CS_LOCALS(r300);
-    struct r300_texture* tex;
     int i;
+    struct r300_texture* tex;
+    CS_LOCALS(r300);
 
     BEGIN_CS((6 * fb->nr_cbufs) + (fb->zsbuf ? 6 : 0) + 4);
     for (i = 0; i < fb->nr_cbufs; i++) {
@@ -217,9 +217,9 @@ void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs)
 void r300_emit_rs_block_state(struct r300_context* r300,
                               struct r300_rs_block* rs)
 {
+    int i;
     struct r300_screen* r300screen = r300_screen(r300->context.screen);
     CS_LOCALS(r300);
-    int i;
 
     BEGIN_CS(21);
     if (r300screen->caps->is_r500) {
@@ -293,8 +293,8 @@ void r300_emit_texture(struct r300_context* r300,
 
 void r300_emit_vertex_format_state(struct r300_context* r300)
 {
-    CS_LOCALS(r300);
     int i;
+    CS_LOCALS(r300);
 
     BEGIN_CS(26);
     OUT_CS_REG(R300_VAP_VTX_SIZE, r300->vertex_info.vinfo.size);
@@ -328,9 +328,9 @@ void r300_emit_vertex_format_state(struct r300_context* r300)
 void r300_emit_vertex_shader(struct r300_context* r300,
                              struct r300_vertex_shader* vs)
 {
-    CS_LOCALS(r300);
-    struct r300_screen* r300screen = r300_screen(r300->context.screen);
     int i;
+    struct r300_screen* r300screen = r300_screen(r300->context.screen);
+    CS_LOCALS(r300);
 
     if (!r300screen->caps->has_tcl) {
         debug_printf("r300: Implementation error: emit_vertex_shader called,"
@@ -368,8 +368,6 @@ void r300_emit_vertex_shader(struct r300_context* r300,
 void r300_emit_viewport_state(struct r300_context* r300,
                               struct r300_viewport_state* viewport)
 {
-    /* XXX has_tcl */
-    return;
     CS_LOCALS(r300);
 
     BEGIN_CS(7);
index 5f5f4c4dbd40cee10b74dc50049431e033f312c4..8fc61c2dec71fdca056b2d2d7c085f4973c91cf6 100644 (file)
@@ -46,12 +46,12 @@ static void r300_destroy_query(struct pipe_context* pipe,
 static void r300_begin_query(struct pipe_context* pipe,
                              struct pipe_query* query)
 {
+    uint32_t* map;
     struct r300_context* r300 = r300_context(pipe);
     struct r300_query* q = (struct r300_query*)query;
     CS_LOCALS(r300);
 
-    uint32_t* map = pipe_buffer_map(pipe->screen, q->buf,
-            PIPE_BUFFER_USAGE_CPU_WRITE);
+    map = pipe_buffer_map(pipe->screen, q->buf, PIPE_BUFFER_USAGE_CPU_WRITE);
     *map = ~0;
     pipe_buffer_unmap(pipe->screen, q->buf);
 
@@ -79,6 +79,7 @@ static boolean r300_get_query_result(struct pipe_context* pipe,
                                      uint64_t* result)
 {
     struct r300_query* q = (struct r300_query*)query;
+    uint32_t* map;
     uint32_t temp;
 
     if (wait) {
@@ -88,8 +89,7 @@ static boolean r300_get_query_result(struct pipe_context* pipe,
         pipe->flush(pipe, 0, NULL);
     }
 
-    uint32_t* map = pipe_buffer_map(pipe->screen, q->buf,
-            PIPE_BUFFER_USAGE_CPU_READ);
+    map = pipe_buffer_map(pipe->screen, q->buf, PIPE_BUFFER_USAGE_CPU_READ);
     temp = *map;
     pipe_buffer_unmap(pipe->screen, q->buf);
 
index c9a20c9e8ace0c069f9453ba3d93b1279d4c0e6e..b1d85260cc17ae1a8049d29e09e3c1bc74ba36b8 100644 (file)
@@ -593,6 +593,7 @@ static void* r300_create_vs_state(struct pipe_context* pipe,
                                   const struct pipe_shader_state* state)
 {
     struct r300_context* context = r300_context(pipe);
+    tgsi_dump(state->tokens);
     /* XXX handing this off to Draw for now */
     return draw_create_vertex_shader(context->draw, state);
 }
index ab0ecac35a455bb9dbb282b868a45ff4ec66145e..dc4b29eb40a8147f122465ae2caad679da91a871 100644 (file)
@@ -29,10 +29,10 @@ static void r300_surface_setup(struct pipe_context* pipe,
                                unsigned w, unsigned h)
 {
     struct r300_context* r300 = r300_context(pipe);
-    CS_LOCALS(r300);
     struct r300_capabilities* caps = r300_screen(pipe->screen)->caps;
     struct r300_texture* tex = (struct r300_texture*)dest->texture;
     unsigned pixpitch = tex->stride / tex->tex.block.size;
+    CS_LOCALS(r300);
 
     r300_emit_blend_state(r300, &blend_clear_state);
     r300_emit_blend_color_state(r300, &blend_color_clear_state);
@@ -80,13 +80,13 @@ static void r300_surface_fill(struct pipe_context* pipe,
                               unsigned w, unsigned h,
                               unsigned color)
 {
+    int i;
+    float r, g, b, a, depth;
     struct r300_context* r300 = r300_context(pipe);
-    CS_LOCALS(r300);
     struct r300_capabilities* caps = r300_screen(pipe->screen)->caps;
     struct r300_texture* tex = (struct r300_texture*)dest->texture;
-    int i;
-    float r, g, b, a, depth;
     unsigned pixpitch = tex->stride / tex->tex.block.size;
+    CS_LOCALS(r300);
 
     a = (float)((color >> 24) & 0xff) / 255.0f;
     r = (float)((color >> 16) & 0xff) / 255.0f;
@@ -201,12 +201,12 @@ static void r300_surface_copy(struct pipe_context* pipe,
                               unsigned w, unsigned h)
 {
     struct r300_context* r300 = r300_context(pipe);
-    CS_LOCALS(r300);
     struct r300_capabilities* caps = r300_screen(pipe->screen)->caps;
     struct r300_texture* srctex = (struct r300_texture*)src->texture;
     struct r300_texture* desttex = (struct r300_texture*)dest->texture;
-
     unsigned pixpitch = srctex->stride / srctex->tex.block.size;
+    CS_LOCALS(r300);
+
     debug_printf("r300: Copying surface %p at (%d,%d) to %p at (%d, %d),"
         " dimensions %dx%d (pixel pitch %d)\n",
         src, srcx, srcy, dest, destx, desty, w, h, pixpitch);
index 36090882f134b6328a2e3b4ee0725a7dcab72215..894def07aa8b3a46cbe7da0ceda975bac1aed30a 100644 (file)
@@ -105,11 +105,11 @@ static struct r300_rs_block r300_rs_block_copy_state = {
 };
 
 static struct r300_rs_block r500_rs_block_copy_state = {
-    .ip[0] = R500_RS_SEL_S(R500_RS_IP_PTR_K0) |
-        R500_RS_SEL_T(R500_RS_IP_PTR_K0) |
+    .ip[0] = R500_RS_SEL_S(0) |
+        R500_RS_SEL_T(1) |
         R500_RS_SEL_R(R500_RS_IP_PTR_K0) |
         R500_RS_SEL_Q(R500_RS_IP_PTR_K1),
-    .inst[0] = R500_RS_INST_COL_CN_WRITE,
+    .inst[0] = R500_RS_INST_TEX_CN_WRITE,
     .count = R300_IT_COUNT(2) | R300_IC_COUNT(0) | R300_HIRES_EN,
     .inst_count = R300_RS_TX_OFFSET(6),
 };