Browse Source

nouveau: Work around nv04-nv40 miptrees not matching nouveau_miptree.

Thanks to Bob Gleitsmann for the patch.

I'll clean this up in a better way later if noone else beats me to it.
tags/7.8-rc1
Younes Manton 16 years ago
parent
commit
c574f515f0

+ 2
- 1
src/gallium/drivers/nv04/nv04_miptree.c View File

@@ -55,7 +55,7 @@ nv04_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
FREE(mt);
return NULL;
}
mt->bo = nouveau_bo(mt->buffer);
return &mt->base;
}

@@ -81,6 +81,7 @@ nv04_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
mt->level[0].image_offset = CALLOC(1, sizeof(unsigned));

pipe_buffer_reference(&mt->buffer, pb);
mt->bo = nouveau_bo(mt->buffer);
return &mt->base;
}


+ 1
- 0
src/gallium/drivers/nv04/nv04_state.h View File

@@ -31,6 +31,7 @@ struct nv04_rasterizer_state {

struct nv04_miptree {
struct pipe_texture base;
struct nouveau_bo *bo;

struct pipe_buffer *buffer;
uint total_size;

+ 2
- 0
src/gallium/drivers/nv10/nv10_miptree.c View File

@@ -67,6 +67,7 @@ nv10_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
mt->level[0].image_offset = CALLOC(1, sizeof(unsigned));

pipe_buffer_reference(&mt->buffer, pb);
mt->bo = nouveau_bo(mt->buffer);
return &mt->base;
}

@@ -90,6 +91,7 @@ nv10_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt)
FREE(mt);
return NULL;
}
mt->bo = nouveau_bo(mt->buffer);
return &mt->base;
}

+ 1
- 0
src/gallium/drivers/nv10/nv10_state.h View File

@@ -126,6 +126,7 @@ struct nv10_depth_stencil_alpha_state {

struct nv10_miptree {
struct pipe_texture base;
struct nouveau_bo *bo;

struct pipe_buffer *buffer;
uint total_size;

+ 2
- 0
src/gallium/drivers/nv20/nv20_miptree.c View File

@@ -77,6 +77,7 @@ nv20_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
mt->level[0].image_offset = CALLOC(1, sizeof(unsigned));

pipe_buffer_reference(&mt->buffer, pb);
mt->bo = nouveau_bo(mt->buffer);
return &mt->base;
}

@@ -132,6 +133,7 @@ nv20_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt)
FREE(mt);
return NULL;
}
mt->bo = nouveau_bo(mt->buffer);
return &mt->base;
}

+ 1
- 0
src/gallium/drivers/nv20/nv20_state.h View File

@@ -126,6 +126,7 @@ struct nv20_depth_stencil_alpha_state {

struct nv20_miptree {
struct pipe_texture base;
struct nouveau_bo *bo;

struct pipe_buffer *buffer;
uint total_size;

+ 2
- 0
src/gallium/drivers/nv30/nv30_miptree.c View File

@@ -115,6 +115,7 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
FREE(mt);
return NULL;
}
mt->bo = nouveau_bo(mt->buffer);

return &mt->base;
}
@@ -144,6 +145,7 @@ nv30_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;

pipe_buffer_reference(&mt->buffer, pb);
mt->bo = nouveau_bo(mt->buffer);
return &mt->base;
}


+ 1
- 0
src/gallium/drivers/nv30/nv30_state.h View File

@@ -72,6 +72,7 @@ struct nv30_fragment_program {

struct nv30_miptree {
struct pipe_texture base;
struct nouveau_bo *bo;

struct pipe_buffer *buffer;
uint total_size;

+ 4
- 1
src/gallium/drivers/nv40/nv40_miptree.c View File

@@ -5,6 +5,8 @@

#include "nv40_context.h"



static void
nv40_miptree_layout(struct nv40_miptree *mt)
{
@@ -109,7 +111,7 @@ nv40_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
FREE(mt);
return NULL;
}
mt->bo = nouveau_bo(mt->buffer);
return &mt->base;
}

@@ -138,6 +140,7 @@ nv40_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt,
mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;

pipe_buffer_reference(&mt->buffer, pb);
mt->bo = nouveau_bo(mt->buffer);
return &mt->base;
}


+ 1
- 0
src/gallium/drivers/nv40/nv40_state.h View File

@@ -75,6 +75,7 @@ struct nv40_fragment_program {

struct nv40_miptree {
struct pipe_texture base;
struct nouveau_bo *bo;

struct pipe_buffer *buffer;
uint total_size;

Loading…
Cancel
Save