summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvfx
diff options
context:
space:
mode:
authorXavier Chantry <[email protected]>2010-12-05 12:04:47 +0100
committerPatrice Mandin <[email protected]>2010-12-05 12:08:00 +0100
commitaf5345d9371e927019d51ce3ad198958f8cd42a9 (patch)
tree39bd4692e2df0a1430322c14ad6ea8be2f4b1e36 /src/gallium/drivers/nvfx
parent66d45567b4e2c6f2585789b68667e6c00b7567e1 (diff)
nvfx: fixes after array textures merge
Signed-off-by: Xavier Chantry <[email protected]> Signed-off-by: Patrice Mandin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nvfx')
-rw-r--r--src/gallium/drivers/nvfx/nvfx_miptree.c17
-rw-r--r--src/gallium/drivers/nvfx/nvfx_surface.c2
2 files changed, 10 insertions, 9 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_miptree.c b/src/gallium/drivers/nvfx/nvfx_miptree.c
index db48025d346..2f9d5538b0b 100644
--- a/src/gallium/drivers/nvfx/nvfx_miptree.c
+++ b/src/gallium/drivers/nvfx/nvfx_miptree.c
@@ -193,18 +193,19 @@ struct pipe_surface *
nvfx_miptree_surface_new(struct pipe_context *pipe, struct pipe_resource *pt,
const struct pipe_surface *surf_tmpl)
{
- struct nvfx_miptree* mt = (struct nvfx_miptree*)pt;
- struct nvfx_surface *ns;
+ struct nvfx_miptree *mt = (struct nvfx_miptree *)pt;
unsigned level = surf_tmpl->u.tex.level;
+ struct nvfx_surface *ns = NULL;
assert(surf_tmpl->u.tex.first_layer == surf_tmpl->u.tex.last_layer);
- ns = (struct nvfx_surface*)util_surfaces_get(&mt->surfaces, sizeof(struct nvfx_surface), NULL, pt,
- level, surf_tmpl->u.tex.first_layer, surf_tmpl->usage);
- if(ns->offset == ~0) {
- util_dirty_surface_init(&ns->base);
- ns->pitch = nvfx_subresource_pitch(pt, level);
- ns->offset = nvfx_subresource_offset(pt, surf_tmpl->u.tex.first_layer, level, surf_tmpl->u.tex.first_layer);
+ if(util_surfaces_get(&mt->surfaces, sizeof(struct nvfx_surface), NULL,
+ pt, level, surf_tmpl->u.tex.first_layer,
+ surf_tmpl->usage, (struct pipe_surface **)&ns)) {
+ util_dirty_surface_init(&ns->base);
+ ns->pitch = nvfx_subresource_pitch(pt, level);
+ ns->offset = nvfx_subresource_offset(pt, surf_tmpl->u.tex.first_layer, level, surf_tmpl->u.tex.first_layer);
}
+ ns->base.base.context = pipe;
return &ns->base.base;
}
diff --git a/src/gallium/drivers/nvfx/nvfx_surface.c b/src/gallium/drivers/nvfx/nvfx_surface.c
index 7f315e9da9a..6fd6c47081b 100644
--- a/src/gallium/drivers/nvfx/nvfx_surface.c
+++ b/src/gallium/drivers/nvfx/nvfx_surface.c
@@ -389,7 +389,7 @@ nvfx_surface_copy_temp(struct pipe_context* pipe, struct pipe_surface* surf, int
base_vertex = nvfx->base_vertex;
box.x = box.y = 0;
- assert(surf->u.tex.first_layer = surf->u.tex.last_layer);
+ assert(surf->u.tex.first_layer == surf->u.tex.last_layer);
box.width = surf->width;
box.height = surf->height;
box.depth = 1;