X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fsvga%2Fsvga_resource_texture.c;h=9830e79d1060109e6223b783abac10bb4a3421b5;hb=36ea744f58e5b436c45ed857bd92bbb472e641d5;hp=4eb1068e2260f7359c0655339a94cf490a775a6e;hpb=0950086376b1c8b7fb89eda81ed7f2f06dee58bc;p=mesa.git diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c index 4eb1068e226..9830e79d106 100644 --- a/src/gallium/drivers/svga/svga_resource_texture.c +++ b/src/gallium/drivers/svga/svga_resource_texture.c @@ -196,9 +196,6 @@ svga_transfer_dma(struct svga_context *svga, } - - - static boolean svga_texture_get_handle(struct pipe_screen *screen, struct pipe_resource *texture, @@ -236,11 +233,6 @@ svga_texture_destroy(struct pipe_screen *screen, } - - - - - /* XXX: Still implementing this as if it was a screen function, but * can now modify it to queue transfers on the context. */ @@ -259,7 +251,7 @@ svga_texture_get_transfer(struct pipe_context *pipe, unsigned nblocksy = util_format_get_nblocksy(texture->format, box->height); /* We can't map texture storage directly */ - if (usage & (PIPE_TRANSFER_MAP_DIRECTLY | PIPE_TRANSFER_MAP_PERMANENTLY)) + if (usage & PIPE_TRANSFER_MAP_DIRECTLY) return NULL; assert(box->depth == 1); @@ -396,9 +388,6 @@ svga_texture_transfer_destroy(struct pipe_context *pipe, } - - - struct u_resource_vtbl svga_texture_vtbl = { svga_texture_get_handle, /* get_handle */ @@ -412,8 +401,6 @@ struct u_resource_vtbl svga_texture_vtbl = }; - - struct pipe_resource * svga_texture_create(struct pipe_screen *screen, const struct pipe_resource *template) @@ -446,8 +433,7 @@ svga_texture_create(struct pipe_screen *screen, tex->key.numFaces = 1; } - /* XXX: Disabled for now */ - tex->key.cachable = 0; + tex->key.cachable = 1; if (template->bind & PIPE_BIND_SAMPLER_VIEW) tex->key.flags |= SVGA3D_SURFACE_HINT_TEXTURE; @@ -467,16 +453,19 @@ svga_texture_create(struct pipe_screen *screen, } /* - * XXX: Never pass the SVGA3D_SURFACE_HINT_RENDERTARGET hint. Mesa cannot + * Note: Previously we never passed the + * SVGA3D_SURFACE_HINT_RENDERTARGET hint. Mesa cannot * know beforehand whether a texture will be used as a rendertarget or not * and it always requests PIPE_BIND_RENDER_TARGET, therefore * passing the SVGA3D_SURFACE_HINT_RENDERTARGET here defeats its purpose. + * + * However, this was changed since other state trackers + * (XA for example) uses it accurately and certain device versions + * relies on it in certain situations to render correctly. */ -#if 0 if((template->bind & PIPE_BIND_RENDER_TARGET) && !util_format_is_s3tc(template->format)) tex->key.flags |= SVGA3D_SURFACE_HINT_RENDERTARGET; -#endif if(template->bind & PIPE_BIND_DEPTH_STENCIL) tex->key.flags |= SVGA3D_SURFACE_HINT_DEPTHSTENCIL; @@ -504,8 +493,6 @@ error1: } - - struct pipe_resource * svga_texture_from_handle(struct pipe_screen *screen, const struct pipe_resource *template, @@ -568,4 +555,3 @@ svga_texture_from_handle(struct pipe_screen *screen, return &tex->b.b; } -