[Mesa-dev] [PATCH] nv50, nvc0: allow to create resources other than buffers

Samuel Pitoiset samuel.pitoiset at gmail.com
Wed Nov 25 09:19:50 PST 2015


For the compute support, we might create 1D/2D/3D textures. This fixes
an assertion when executing src/gallium/tests/trivial/compute.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/gallium/drivers/nouveau/nv50/nv50_resource.c | 2 --
 src/gallium/drivers/nouveau/nvc0/nvc0_resource.c | 2 --
 2 files changed, 4 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nv50/nv50_resource.c b/src/gallium/drivers/nouveau/nv50/nv50_resource.c
index 325c19f..5d415ae7 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_resource.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_resource.c
@@ -68,8 +68,6 @@ nv50_surface_create(struct pipe_context *pipe,
                     struct pipe_resource *pres,
                     const struct pipe_surface *templ)
 {
-   /* surfaces are assumed to be miptrees all over the place. */
-   assert(pres->target != PIPE_BUFFER);
    if (unlikely(pres->target == PIPE_BUFFER))
       return nv50_surface_from_buffer(pipe, pres, templ);
    return nv50_miptree_surface_new(pipe, pres, templ);
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c b/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c
index 15c803c..7fbc6e1 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c
@@ -37,8 +37,6 @@ nvc0_surface_create(struct pipe_context *pipe,
                     struct pipe_resource *pres,
                     const struct pipe_surface *templ)
 {
-   /* surfaces are assumed to be miptrees all over the place. */
-   assert(pres->target != PIPE_BUFFER);
    if (unlikely(pres->target == PIPE_BUFFER))
       return nv50_surface_from_buffer(pipe, pres, templ);
    return nvc0_miptree_surface_new(pipe, pres, templ);
-- 
2.6.2



More information about the mesa-dev mailing list