Commit bd8b43a9 authored by Brian Paul's avatar Brian Paul

gallium: add new pipe_screen::can_create_resource() function

Used to implement proxy textures.  If a gallium driver doesn't implement
this function we'll just continue to use the core Mesa fallback code.

Without this hook we really have no good way to implement OpenGL proxy
textures with gallium drivers.
Reviewed-by: Jose Fonseca's avatarJose Fonseca <>
parent a0fc7620
......@@ -358,6 +358,16 @@ the maximum allowed legal value is 32.
Returns TRUE if all usages can be satisfied.
Check if a resource can actually be created (but don't actually allocate any
memory). This is used to implement OpenGL's proxy textures. Typically, a
driver will simply check if the total size of the given resource is less than
some limit.
.. _resource_create:
......@@ -137,6 +137,14 @@ struct pipe_screen {
enum pipe_format format,
enum pipe_video_profile profile );
* Check if we can actually create the given resource (test the dimension,
* overall size, etc). Used to implement proxy textures.
* \return TRUE if size is OK, FALSE if too large.
boolean (*can_create_resource)(struct pipe_screen *screen,
const struct pipe_resource *templat);
* Create a new texture object, using the given template info.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment