}
-
-
-
static boolean
svga_texture_get_handle(struct pipe_screen *screen,
struct pipe_resource *texture,
}
-
-
-
-
-
/* XXX: Still implementing this as if it was a screen function, but
* can now modify it to queue transfers on the context.
*/
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);
}
-
-
-
struct u_resource_vtbl svga_texture_vtbl =
{
svga_texture_get_handle, /* get_handle */
};
-
-
struct pipe_resource *
svga_texture_create(struct pipe_screen *screen,
const struct pipe_resource *template)
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;
}
/*
- * 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;
}
-
-
struct pipe_resource *
svga_texture_from_handle(struct pipe_screen *screen,
const struct pipe_resource *template,
return &tex->b.b;
}
-