diff options
author | Rob Clark <[email protected]> | 2018-02-27 12:59:57 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2018-03-05 08:05:33 -0500 |
commit | 9a62536108514434c22ec189ecf273eb09fc7d77 (patch) | |
tree | ba831d9e62d602cebdab30d6159ac0b499b4977b | |
parent | d7af35a7f3b4237f8be2fc89ae22b57116ac3024 (diff) |
freedreno: surfaces can be PIPE_BUFFER
At least for clover.
Signed-off-by: Rob Clark <[email protected]>
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_surface.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_surface.c b/src/gallium/drivers/freedreno/freedreno_surface.c index 5ebc4937ed8..1295fc26599 100644 --- a/src/gallium/drivers/freedreno/freedreno_surface.c +++ b/src/gallium/drivers/freedreno/freedreno_surface.c @@ -44,7 +44,6 @@ fd_create_surface(struct pipe_context *pctx, if (!surface) return NULL; - debug_assert(surf_tmpl->u.tex.first_layer == surf_tmpl->u.tex.last_layer); struct pipe_surface *psurf = &surface->base; unsigned level = surf_tmpl->u.tex.level; @@ -56,9 +55,16 @@ fd_create_surface(struct pipe_context *pctx, psurf->format = surf_tmpl->format; psurf->width = u_minify(ptex->width0, level); psurf->height = u_minify(ptex->height0, level); - psurf->u.tex.level = level; - psurf->u.tex.first_layer = surf_tmpl->u.tex.first_layer; - psurf->u.tex.last_layer = surf_tmpl->u.tex.last_layer; + + if (ptex->target == PIPE_BUFFER) { + psurf->u.buf.first_element = surf_tmpl->u.buf.first_element; + psurf->u.buf.last_element = surf_tmpl->u.buf.last_element; + } else { + debug_assert(surf_tmpl->u.tex.first_layer == surf_tmpl->u.tex.last_layer); + psurf->u.tex.level = level; + psurf->u.tex.first_layer = surf_tmpl->u.tex.first_layer; + psurf->u.tex.last_layer = surf_tmpl->u.tex.last_layer; + } // TODO DBG("TODO: %ux%u", psurf->width, psurf->height); |