aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/swrast/s_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/swrast/s_context.h')
-rw-r--r--mesalib/src/mesa/swrast/s_context.h35
1 files changed, 26 insertions, 9 deletions
diff --git a/mesalib/src/mesa/swrast/s_context.h b/mesalib/src/mesa/swrast/s_context.h
index 2f7a2b531..9520185b2 100644
--- a/mesalib/src/mesa/swrast/s_context.h
+++ b/mesalib/src/mesa/swrast/s_context.h
@@ -17,9 +17,10 @@
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
*/
@@ -137,11 +138,24 @@ struct swrast_texture_image
/** used for mipmap LOD computation */
GLfloat WidthScale, HeightScale, DepthScale;
- /** These fields only valid when texture memory is mapped */
- GLint RowStride; /**< Padded width in units of texels */
- GLuint *ImageOffsets; /**< if 3D texture: array [Depth] of offsets to
- each 2D slice in 'Data', in texels */
- GLubyte *Map; /**< Pointer to mapped image memory */
+ /**
+ * Byte stride between rows in ImageSlices.
+ *
+ * For compressed textures, this is the byte stride between one row of
+ * blocks and the next row of blocks.
+ *
+ * Only valid while one of the ImageSlices is mapped, and must be the same
+ * between all slices.
+ */
+ GLint RowStride;
+ /**
+ * When a texture image is mapped for swrast, this array contains pointers
+ * to the beginning of each slice.
+ *
+ * For swrast-allocated textures, these pointers will always stay
+ * initialized to point within Buffer.
+ */
+ void **ImageSlices;
/** Malloc'd texture memory */
GLubyte *Buffer;
@@ -299,7 +313,7 @@ typedef struct
/** Internal hooks, kept up to date by the same mechanism as above.
*/
blend_func BlendFunc;
- texture_sample_func TextureSample[MAX_TEXTURE_IMAGE_UNITS];
+ texture_sample_func TextureSample[MAX_COMBINED_TEXTURE_IMAGE_UNITS];
/** Buffer for saving the sampled texture colors.
* Needed for GL_ARB_texture_env_crossbar implementation.
@@ -379,6 +393,9 @@ _swrast_map_textures(struct gl_context *ctx);
extern void
_swrast_unmap_textures(struct gl_context *ctx);
+extern unsigned int
+_swrast_teximage_slice_height(struct gl_texture_image *texImage);
+
extern void
_swrast_map_texture(struct gl_context *ctx, struct gl_texture_object *texObj);