summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_texture.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-01-28 20:25:27 -0700
committerBrian Paul <[email protected]>2011-01-28 20:25:27 -0700
commit1dd8e2757852682af44b63193c89dff3c09c7703 (patch)
treead28b37ea23d575482f8d915d717135ed58f0709 /src/mesa/state_tracker/st_texture.h
parent80777743b7b6238f034b8cb81d8d907d74929334 (diff)
st/mesa: fix texture array dimensions
For 1D/2D texture arrays use the pipe_resource::array_size field. In OpenGL 1D arrays texture use the height dimension as the array size and 2D array textures use the depth dimension as the array size. Gallium uses a special array_size field instead. When setting up gallium textures or comparing Mesa textures to gallium textures we need to be extra careful that we're comparing the right fields. The new st_gl_texture_dims_to_pipe_dims() function maps OpenGL texture dimensions to gallium texture dimensions and simplifies this quite a bit.
Diffstat (limited to 'src/mesa/state_tracker/st_texture.h')
-rw-r--r--src/mesa/state_tracker/st_texture.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_texture.h b/src/mesa/state_tracker/st_texture.h
index 5eae7ab7298..d50c3c9af79 100644
--- a/src/mesa/state_tracker/st_texture.h
+++ b/src/mesa/state_tracker/st_texture.h
@@ -71,7 +71,10 @@ struct st_texture_object
*/
GLuint lastLevel;
- /** The size of the level=0 mipmap image */
+ /** The size of the level=0 mipmap image.
+ * Note that the number of 1D array layers will be in height0 and the
+ * number of 2D array layers will be in depth0, as in GL.
+ */
GLuint width0, height0, depth0;
/* On validation any active images held in main memory or in other
@@ -172,6 +175,16 @@ st_texture_create(struct st_context *st,
GLuint tex_usage );
+extern void
+st_gl_texture_dims_to_pipe_dims(GLenum texture,
+ GLuint widthIn,
+ GLuint heightIn,
+ GLuint depthIn,
+ GLuint *widthOut,
+ GLuint *heightOut,
+ GLuint *depthOut,
+ GLuint *layersOut);
+
/* Check if an image fits into an existing texture object.
*/
extern GLboolean