X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmesa%2Fmain%2Fteximage.h;h=0ce4a30361c282498339708cfd12334f093da3e8;hb=5030d0a4f79c3309bad04cc257beb97f74f84f61;hp=42305f44f0b9670b4f33c16e5082cae9b4f4a1d5;hpb=637b6c24785d202e0f608c8dec098d63d857ae0e;p=mesa.git diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h index 42305f44f0b..0ce4a30361c 100644 --- a/src/mesa/main/teximage.h +++ b/src/mesa/main/teximage.h @@ -47,7 +47,7 @@ _mesa_is_cube_face(GLenum target) target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB); } -/** Is any of the dimensions of given texture equal to zero? */ +/** Are any of the dimensions of given texture equal to zero? */ static inline GLboolean _mesa_is_zero_size_texture(const struct gl_texture_image *texImage) { @@ -66,6 +66,9 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat ); extern GLboolean _mesa_is_proxy_texture(GLenum target); +extern bool +_mesa_is_array_texture(GLenum target); + extern struct gl_texture_image * _mesa_new_texture_image( struct gl_context *ctx ); @@ -99,13 +102,8 @@ _mesa_clear_texture_image(struct gl_context *ctx, struct gl_texture_image *texImage); -extern struct gl_texture_object * -_mesa_get_current_tex_object(struct gl_context *ctx, GLenum target); - - extern struct gl_texture_image * -_mesa_select_tex_image(struct gl_context *ctx, - const struct gl_texture_object *texObj, +_mesa_select_tex_image(const struct gl_texture_object *texObj, GLenum target, GLint level); @@ -114,6 +112,16 @@ _mesa_get_tex_image(struct gl_context *ctx, struct gl_texture_object *texObj, GLenum target, GLint level); +/** + * Return the base-level texture image for the given texture object. + */ +static inline const struct gl_texture_image * +_mesa_base_tex_image(const struct gl_texture_object *texObj) +{ + return texObj->Image[0][texObj->BaseLevel]; +} + + extern GLint _mesa_max_texture_levels(struct gl_context *ctx, GLenum target); @@ -123,6 +131,9 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level, mesa_format format, GLint width, GLint height, GLint depth, GLint border); +extern GLboolean +_mesa_target_can_be_compressed(const struct gl_context *ctx, GLenum target, + GLenum intFormat); extern GLuint _mesa_tex_target_to_face(GLenum target); @@ -157,24 +168,52 @@ _mesa_legal_texture_base_format_for_target(struct gl_context *ctx, unsigned dimensions, const char *caller); -/** - * Lock a texture for updating. See also _mesa_lock_context_textures(). - */ -static inline void -_mesa_lock_texture(struct gl_context *ctx, struct gl_texture_object *texObj) -{ - mtx_lock(&ctx->Shared->TexMutex); - ctx->Shared->TextureStateStamp++; - (void) texObj; -} +extern void +_mesa_texture_sub_image(struct gl_context *ctx, GLuint dims, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage, + GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLenum type, const GLvoid *pixels, + bool dsa); -static inline void -_mesa_unlock_texture(struct gl_context *ctx, struct gl_texture_object *texObj) -{ - (void) texObj; - mtx_unlock(&ctx->Shared->TexMutex); -} +extern void +_mesa_compressed_texture_sub_image(struct gl_context *ctx, GLuint dims, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage, + GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint zoffset, + GLsizei width, GLsizei height, + GLsizei depth, + GLenum format, GLsizei imageSize, + const GLvoid *data); + +extern void +_mesa_copy_texture_sub_image(struct gl_context *ctx, GLuint dims, + struct gl_texture_object *texObj, + GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLint x, GLint y, + GLsizei width, GLsizei height, bool dsa); +extern void +_mesa_texture_image_multisample(struct gl_context *ctx, GLuint dims, + struct gl_texture_object *texObj, + GLenum target, GLsizei samples, + GLint internalformat, GLsizei width, + GLsizei height, GLsizei depth, + GLboolean fixedsamplelocations, + GLboolean immutable, const char *func); + +extern void +_mesa_texture_buffer_range(struct gl_context *ctx, + struct gl_texture_object *texObj, + GLenum internalFormat, + struct gl_buffer_object *bufObj, + GLintptr offset, GLsizeiptr size, + const char *caller); /*@}*/ @@ -230,10 +269,31 @@ _mesa_TexSubImage3D( GLenum target, GLint level, GLenum format, GLenum type, const GLvoid *pixels ); +extern void GLAPIENTRY +_mesa_TextureSubImage1D(GLuint texture, GLint level, GLint xoffset, + GLsizei width, + GLenum format, GLenum type, + const GLvoid *pixels); + + +extern void GLAPIENTRY +_mesa_TextureSubImage2D(GLuint texture, GLint level, + GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels); + +extern void GLAPIENTRY +_mesa_TextureSubImage3D(GLuint texture, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLenum type, + const GLvoid *pixels); + extern void GLAPIENTRY -_mesa_CopyTexImage1D( GLenum target, GLint level, GLenum internalformat, - GLint x, GLint y, GLsizei width, GLint border ); +_mesa_CopyTexImage1D(GLenum target, GLint level, GLenum internalformat, + GLint x, GLint y, GLsizei width, GLint border); extern void GLAPIENTRY @@ -258,7 +318,21 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ); +extern void GLAPIENTRY +_mesa_CopyTextureSubImage1D(GLuint texture, GLint level, + GLint xoffset, GLint x, GLint y, GLsizei width); + +extern void GLAPIENTRY +_mesa_CopyTextureSubImage2D(GLuint texture, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, + GLsizei width, GLsizei height); +extern void GLAPIENTRY +_mesa_CopyTextureSubImage3D(GLuint texture, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLint x, GLint y, + GLsizei width, GLsizei height); extern void GLAPIENTRY _mesa_ClearTexSubImage( GLuint texture, GLint level, @@ -293,18 +367,37 @@ _mesa_CompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +extern void GLAPIENTRY +_mesa_CompressedTextureSubImage1D(GLuint texture, GLint level, GLint xoffset, + GLsizei width, GLenum format, + GLsizei imageSize, const GLvoid *data); + extern void GLAPIENTRY _mesa_CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +extern void GLAPIENTRY +_mesa_CompressedTextureSubImage2D(GLuint texture, GLint level, GLint xoffset, + GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLsizei imageSize, + const GLvoid *data); + extern void GLAPIENTRY _mesa_CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +extern void GLAPIENTRY +_mesa_CompressedTextureSubImage3D(GLuint texture, GLint level, GLint xoffset, + GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, + GLsizei depth, + GLenum format, GLsizei imageSize, + const GLvoid *data); extern void GLAPIENTRY _mesa_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer); @@ -313,6 +406,13 @@ extern void GLAPIENTRY _mesa_TexBufferRange(GLenum target, GLenum internalFormat, GLuint buffer, GLintptr offset, GLsizeiptr size); +extern void GLAPIENTRY +_mesa_TextureBuffer(GLuint texture, GLenum internalFormat, GLuint buffer); + +extern void GLAPIENTRY +_mesa_TextureBufferRange(GLuint texture, GLenum internalFormat, GLuint buffer, + GLintptr offset, GLsizeiptr size); + extern void GLAPIENTRY _mesa_TexImage2DMultisample(GLenum target, GLsizei samples, @@ -336,12 +436,17 @@ _mesa_TexStorage3DMultisample(GLenum target, GLsizei samples, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -bool -_mesa_compressed_texture_pixel_storage_error_check(struct gl_context *ctx, - GLint dimensions, - struct gl_pixelstore_attrib *packing, - const char *caller); - +void GLAPIENTRY +_mesa_TextureStorage2DMultisample(GLuint texture, GLsizei samples, + GLenum internalformat, GLsizei width, + GLsizei height, + GLboolean fixedsamplelocations); + +void GLAPIENTRY +_mesa_TextureStorage3DMultisample(GLuint texture, GLsizei samples, + GLenum internalformat, GLsizei width, + GLsizei height, GLsizei depth, + GLboolean fixedsamplelocations); /*@}*/ #ifdef __cplusplus