llvmpipe: Update for changes in master.
authorJosé Fonseca <jfonseca@vmware.com>
Sat, 29 Aug 2009 08:17:51 +0000 (09:17 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Sat, 29 Aug 2009 08:21:42 +0000 (09:21 +0100)
src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c
src/gallium/drivers/llvmpipe/lp_texture.c
src/gallium/drivers/llvmpipe/lp_tile_cache.c

index 0c837188cac983311b4a1ea50900e13cf3138792..bce26607f9095ec1a4dcc2b52d33e23988fdb22b 100644 (file)
@@ -255,15 +255,15 @@ emit_tex( struct lp_build_tgsi_soa_context *bld,
 
    switch (inst->InstructionExtTexture.Texture) {
    case TGSI_TEXTURE_1D:
-   case TGSI_TEXTURE_SHADOW1D:
       num_coords = 1;
       break;
    case TGSI_TEXTURE_2D:
    case TGSI_TEXTURE_RECT:
-   case TGSI_TEXTURE_SHADOW2D:
-   case TGSI_TEXTURE_SHADOWRECT:
       num_coords = 2;
       break;
+   case TGSI_TEXTURE_SHADOW1D:
+   case TGSI_TEXTURE_SHADOW2D:
+   case TGSI_TEXTURE_SHADOWRECT:
    case TGSI_TEXTURE_3D:
    case TGSI_TEXTURE_CUBE:
       num_coords = 3;
@@ -1167,7 +1167,7 @@ emit_instruction(
       return 0;
       break;
 
-   case TGSI_OPCODE_LOOP:
+   case TGSI_OPCODE_BGNFOR:
       return 0;
       break;
 
@@ -1183,7 +1183,7 @@ emit_instruction(
       return 0;
       break;
 
-   case TGSI_OPCODE_ENDLOOP:
+   case TGSI_OPCODE_ENDFOR:
       return 0;
       break;
 
index 169fe87b78efd3591aeabcf8d480e855f8e15b03..18e348d69e0bcf9c95793bb50f43fd3104eb95d1 100644 (file)
 /* Simple, maximally packed layout.
  */
 
-static unsigned minify( unsigned d )
-{
-   return MAX2(1, d>>1);
-}
-
 
 /* Conventional allocation path for non-display textures:
  */
@@ -102,6 +97,7 @@ llvmpipe_displaytarget_layout(struct pipe_screen *screen,
 {
    unsigned usage = (PIPE_BUFFER_USAGE_CPU_READ_WRITE |
                      PIPE_BUFFER_USAGE_GPU_READ_WRITE);
+   unsigned tex_usage = lpt->base.tex_usage;
 
    pf_get_block(lpt->base.format, &lpt->base.block);
    lpt->base.nblocksx[0] = pf_get_nblocksx(&lpt->base.block, lpt->base.width[0]);  
@@ -112,6 +108,7 @@ llvmpipe_displaytarget_layout(struct pipe_screen *screen,
                                                 lpt->base.height[0],
                                                 lpt->base.format,
                                                 usage,
+                                                tex_usage,
                                                 &lpt->stride[0]);
 
    return lpt->buffer != NULL;
@@ -139,7 +136,8 @@ llvmpipe_texture_create(struct pipe_screen *screen,
    if(lpt->base.format == PIPE_FORMAT_Z16_UNORM)
       lpt->base.format = PIPE_FORMAT_Z32_UNORM;
 
-   if (lpt->base.tex_usage & PIPE_TEXTURE_USAGE_DISPLAY_TARGET) {
+   if (lpt->base.tex_usage & (PIPE_TEXTURE_USAGE_DISPLAY_TARGET |
+                              PIPE_TEXTURE_USAGE_PRIMARY)) {
       if (!llvmpipe_displaytarget_layout(screen, lpt))
          goto fail;
    }
index 23bf6088579506f56a25dd6b576458f1b93a3b91..143afec3d35313da6335383dc518980854ebea50 100644 (file)
@@ -220,7 +220,7 @@ lp_flush_tile_cache(struct llvmpipe_tile_cache *tc)
             if(!dst)
                continue;
 
-            pipe_fill_rect(dst, &pt->block, pt->stride,
+            util_fill_rect(dst, &pt->block, pt->stride,
                            x, y, tw,  th,
                            tc->clear_val);