summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_surface.c
diff options
context:
space:
mode:
authorNeha Bhende <[email protected]>2016-09-01 09:40:43 -0700
committerBrian Paul <[email protected]>2016-09-17 10:08:59 -0600
commitb9f333cc8167594fa2c73a763a4e70ddf98e885f (patch)
tree308d80d2ab3f7936434a3634c6f9b62ceae90826 /src/gallium/drivers/svga/svga_surface.c
parent50baaf6bc624e78f6d92f2316a370e11d4c4d882 (diff)
svga: Add function svga_resource_type()
This function returns svga texture type for corresponding pipe texture. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_surface.c')
-rw-r--r--src/gallium/drivers/svga/svga_surface.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/gallium/drivers/svga/svga_surface.c b/src/gallium/drivers/svga/svga_surface.c
index f6a791332c9..81b0f48e53e 100644
--- a/src/gallium/drivers/svga/svga_surface.c
+++ b/src/gallium/drivers/svga/svga_surface.c
@@ -442,25 +442,7 @@ svga_validate_surface_view(struct svga_context *svga, struct svga_surface *s)
s->view_id = util_bitmask_add(svga->surface_view_id_bm);
- switch (s->base.texture->target) {
- case PIPE_TEXTURE_1D:
- case PIPE_TEXTURE_1D_ARRAY:
- resType = SVGA3D_RESOURCE_TEXTURE1D;
- break;
- case PIPE_TEXTURE_RECT:
- case PIPE_TEXTURE_2D:
- case PIPE_TEXTURE_2D_ARRAY:
- case PIPE_TEXTURE_CUBE:
- /* drawing to cube map is treated as drawing to 2D array */
- resType = SVGA3D_RESOURCE_TEXTURE2D;
- break;
- case PIPE_TEXTURE_3D:
- resType = SVGA3D_RESOURCE_TEXTURE3D;
- break;
- default:
- assert(!"Unexpected texture target");
- resType = SVGA3D_RESOURCE_TEXTURE2D;
- }
+ resType = svga_resource_type(s->base.texture->target);
if (util_format_is_depth_or_stencil(s->base.format)) {
ret = SVGA3D_vgpu10_DefineDepthStencilView(svga->swc,