r300g: do not use the c++ template keyword
authorMarek Olšák <maraeo@gmail.com>
Sun, 4 Apr 2010 01:54:09 +0000 (03:54 +0200)
committerMarek Olšák <maraeo@gmail.com>
Sun, 4 Apr 2010 01:54:09 +0000 (03:54 +0200)
It makes life for some code browsing utilites easier.

src/gallium/drivers/r300/r300_texture.c
src/gallium/drivers/r300/r300_transfer.c

index 72e14bd8922d121621a3e13ac9c5f58b5b2044ab..57f2766d2e039edfe7caa460b12bac13e582b1f9 100644 (file)
@@ -785,7 +785,7 @@ static void r300_setup_tiling(struct pipe_screen *screen,
 
 /* Create a new texture. */
 static struct pipe_texture* r300_texture_create(struct pipe_screen* screen,
-                                         const struct pipe_texture* template)
+                                         const struct pipe_texture* base)
 {
     struct r300_texture* tex = CALLOC_STRUCT(r300_texture);
     struct r300_screen* rscreen = r300_screen(screen);
@@ -795,12 +795,12 @@ static struct pipe_texture* r300_texture_create(struct pipe_screen* screen,
         return NULL;
     }
 
-    tex->tex = *template;
+    tex->tex = *base;
     pipe_reference_init(&tex->tex.reference, 1);
     tex->tex.screen = screen;
 
     r300_setup_flags(tex);
-    if (!(template->tex_usage & R300_TEXTURE_USAGE_TRANSFER)) {
+    if (!(base->tex_usage & R300_TEXTURE_USAGE_TRANSFER)) {
         r300_setup_tiling(screen, tex);
     }
     r300_setup_miptree(rscreen, tex);
@@ -938,7 +938,7 @@ r300_video_surface_create(struct pipe_screen *screen,
                           unsigned width, unsigned height)
 {
     struct r300_video_surface *r300_vsfc;
-    struct pipe_texture template;
+    struct pipe_texture base;
 
     assert(screen);
     assert(width && height);
@@ -953,17 +953,17 @@ r300_video_surface_create(struct pipe_screen *screen,
     r300_vsfc->base.width = width;
     r300_vsfc->base.height = height;
 
-    memset(&template, 0, sizeof(struct pipe_texture));
-    template.target = PIPE_TEXTURE_2D;
-    template.format = PIPE_FORMAT_B8G8R8X8_UNORM;
-    template.last_level = 0;
-    template.width0 = util_next_power_of_two(width);
-    template.height0 = util_next_power_of_two(height);
-    template.depth0 = 1;
-    template.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER |
-                         PIPE_TEXTURE_USAGE_RENDER_TARGET;
-
-    r300_vsfc->tex = screen->texture_create(screen, &template);
+    memset(&base, 0, sizeof(struct pipe_texture));
+    base.target = PIPE_TEXTURE_2D;
+    base.format = PIPE_FORMAT_B8G8R8X8_UNORM;
+    base.last_level = 0;
+    base.width0 = util_next_power_of_two(width);
+    base.height0 = util_next_power_of_two(height);
+    base.depth0 = 1;
+    base.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER |
+                     PIPE_TEXTURE_USAGE_RENDER_TARGET;
+
+    r300_vsfc->tex = screen->texture_create(screen, &base);
     if (!r300_vsfc->tex)
     {
         FREE(r300_vsfc);
index 987a040698ff68d96c0cfc49ca1abb77ad5e13c8..cbf3174b381430e26a79aa0209903a8ea7e9f245 100644 (file)
@@ -129,7 +129,7 @@ r300_get_tex_transfer(struct pipe_context *ctx,
     struct r300_texture *tex = (struct r300_texture *)texture;
     struct r300_screen *r300screen = r300_screen(ctx->screen);
     struct r300_transfer *trans;
-    struct pipe_texture template;
+    struct pipe_texture base;
 
     trans = CALLOC_STRUCT(r300_transfer);
     if (trans) {
@@ -154,31 +154,31 @@ r300_get_tex_transfer(struct pipe_context *ctx,
                 PIPE_TEXTURE_USAGE_DEPTH_STENCIL :
                 PIPE_TEXTURE_USAGE_RENDER_TARGET;
 
-            template.target = PIPE_TEXTURE_2D;
-            template.format = texture->format;
-            template.width0 = w;
-            template.height0 = h;
-            template.depth0 = 0;
-            template.last_level = 0;
-            template.nr_samples = 0;
-            template.tex_usage = PIPE_TEXTURE_USAGE_DYNAMIC |
+            base.target = PIPE_TEXTURE_2D;
+            base.format = texture->format;
+            base.width0 = w;
+            base.height0 = h;
+            base.depth0 = 0;
+            base.last_level = 0;
+            base.nr_samples = 0;
+            base.tex_usage = PIPE_TEXTURE_USAGE_DYNAMIC |
                                  R300_TEXTURE_USAGE_TRANSFER;
 
             /* For texture reading, the temporary (detiled) texture is used as
              * a render target when blitting from a tiled texture. */
             if (usage & PIPE_TRANSFER_READ) {
-                template.tex_usage |= trans->render_target_usage;
+                base.tex_usage |= trans->render_target_usage;
             }
             /* For texture writing, the temporary texture is used as a sampler
              * when blitting into a tiled texture. */
             if (usage & PIPE_TRANSFER_WRITE) {
-                template.tex_usage |= PIPE_TEXTURE_USAGE_SAMPLER;
+                base.tex_usage |= PIPE_TEXTURE_USAGE_SAMPLER;
             }
 
             /* Create the temporary texture. */
             trans->detiled_texture = (struct r300_texture*)
                ctx->screen->texture_create(ctx->screen,
-                                           &template);
+                                           &base);
 
             assert(!trans->detiled_texture->microtile &&
                    !trans->detiled_texture->macrotile);