diff options
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/nvfx/nvfx_miptree.c | 17 | ||||
-rw-r--r-- | src/gallium/drivers/nvfx/nvfx_surface.c | 2 |
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; |