1 /************************************************************************** 2 * 3 * Copyright 2007 VMware, Inc. 4 * All Rights Reserved. 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a 7 * copy of this software and associated documentation files (the 8 * "Software"), to deal in the Software without restriction, including 9 * without limitation the rights to use, copy, modify, merge, publish, 10 * distribute, sub license, and/or sell copies of the Software, and to 11 * permit persons to whom the Software is furnished to do so, subject to 12 * the following conditions: 13 * 14 * The above copyright notice and this permission notice (including the 15 * next paragraph) shall be included in all copies or substantial portions 16 * of the Software. 17 * 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR 22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 * 26 **************************************************************************/ 27 28 29 #ifndef ST_CB_TEXTURE_H 30 #define ST_CB_TEXTURE_H 31 32 33 #include "main/glheader.h" 34 35 struct dd_function_table; 36 struct gl_context; 37 struct gl_texture_object; 38 struct gl_texture_image; 39 struct pipe_context; 40 struct st_context; 41 struct gl_renderbuffer; 42 struct gl_pixelstore_attrib; 43 struct gl_memory_object; 44 struct gl_sampler_object; 45 46 extern enum pipe_texture_target 47 gl_target_to_pipe(GLenum target); 48 49 unsigned 50 st_get_blit_mask(GLenum srcFormat, GLenum dstFormat); 51 52 extern GLboolean 53 st_finalize_texture(struct gl_context *ctx, 54 struct pipe_context *pipe, 55 struct gl_texture_object *tObj, 56 GLuint cubeMapFace); 57 58 void st_FreeTextureImageBuffer(struct gl_context *ctx, 59 struct gl_texture_image *texImage); 60 void st_MapTextureImage(struct gl_context *ctx, 61 struct gl_texture_image *texImage, 62 GLuint slice, GLuint x, GLuint y, GLuint w, GLuint h, 63 GLbitfield mode, 64 GLubyte **mapOut, GLint *rowStrideOut); 65 void st_UnmapTextureImage(struct gl_context *ctx, 66 struct gl_texture_image *texImage, 67 GLuint slice); 68 GLboolean st_AllocTextureImageBuffer(struct gl_context *ctx, 69 struct gl_texture_image *texImage); 70 void st_TexSubImage(struct gl_context *ctx, GLuint dims, 71 struct gl_texture_image *texImage, 72 GLint xoffset, GLint yoffset, GLint zoffset, 73 GLint width, GLint height, GLint depth, 74 GLenum format, GLenum type, const void *pixels, 75 const struct gl_pixelstore_attrib *unpack); 76 void st_TexImage(struct gl_context * ctx, GLuint dims, 77 struct gl_texture_image *texImage, 78 GLenum format, GLenum type, const void *pixels, 79 const struct gl_pixelstore_attrib *unpack); 80 void st_CompressedTexSubImage(struct gl_context *ctx, GLuint dims, 81 struct gl_texture_image *texImage, 82 GLint x, GLint y, GLint z, 83 GLsizei w, GLsizei h, GLsizei d, 84 GLenum format, GLsizei imageSize, const void *data); 85 void st_CompressedTexImage(struct gl_context *ctx, GLuint dims, 86 struct gl_texture_image *texImage, 87 GLsizei imageSize, const void *data); 88 void st_GetTexSubImage(struct gl_context * ctx, 89 GLint xoffset, GLint yoffset, GLint zoffset, 90 GLsizei width, GLsizei height, GLint depth, 91 GLenum format, GLenum type, void * pixels, 92 struct gl_texture_image *texImage); 93 void st_CopyTexSubImage(struct gl_context *ctx, GLuint dims, 94 struct gl_texture_image *texImage, 95 GLint destX, GLint destY, GLint slice, 96 struct gl_renderbuffer *rb, 97 GLint srcX, GLint srcY, GLsizei width, GLsizei height); 98 GLboolean st_AllocTextureStorage(struct gl_context *ctx, 99 struct gl_texture_object *texObj, 100 GLsizei levels, GLsizei width, 101 GLsizei height, GLsizei depth); 102 GLboolean st_TestProxyTexImage(struct gl_context *ctx, GLenum target, 103 GLuint numLevels, GLint level, 104 mesa_format format, GLuint numSamples, 105 GLint width, GLint height, GLint depth); 106 GLboolean st_TextureView(struct gl_context *ctx, 107 struct gl_texture_object *texObj, 108 struct gl_texture_object *origTexObj); 109 void st_ClearTexSubImage(struct gl_context *ctx, 110 struct gl_texture_image *texImage, 111 GLint xoffset, GLint yoffset, GLint zoffset, 112 GLsizei width, GLsizei height, GLsizei depth, 113 const void *clearValue); 114 GLboolean st_SetTextureStorageForMemoryObject(struct gl_context *ctx, 115 struct gl_texture_object *texObj, 116 struct gl_memory_object *memObj, 117 GLsizei levels, GLsizei width, 118 GLsizei height, GLsizei depth, 119 GLuint64 offset); 120 121 GLboolean st_GetSparseTextureVirtualPageSize(struct gl_context *ctx, 122 GLenum target, mesa_format format, 123 unsigned index, int *x, int *y, int *z); 124 void st_TexturePageCommitment(struct gl_context *ctx, 125 struct gl_texture_object *tex_obj, 126 int level, int xoffset, int yoffset, int zoffset, 127 int width, int height, int depth, bool commit); 128 #endif /* ST_CB_TEXTURE_H */ 129