diff options
Diffstat (limited to 'source/blender/gpu/GPU_texture.h')
-rw-r--r-- | source/blender/gpu/GPU_texture.h | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h index 341abeba72f..1ddf801e166 100644 --- a/source/blender/gpu/GPU_texture.h +++ b/source/blender/gpu/GPU_texture.h @@ -41,7 +41,7 @@ extern "C" { struct Image; struct ImageUser; struct PreviewImage; -struct Gwn_VertBuf; +struct GPUVertBuf; struct GPUFrameBuffer; typedef struct GPUTexture GPUTexture; @@ -144,8 +144,23 @@ typedef enum GPUTextureFormat { GPU_DEPTH_COMPONENT16, } GPUTextureFormat; +typedef enum GPUDataFormat { + GPU_DATA_FLOAT, + GPU_DATA_INT, + GPU_DATA_UNSIGNED_INT, + GPU_DATA_UNSIGNED_BYTE, + GPU_DATA_UNSIGNED_INT_24_8, + GPU_DATA_10_11_11_REV, +} GPUDataFormat; + unsigned int GPU_texture_memory_usage_get(void); +/* TODO make it static function again. (create function with GPUDataFormat exposed) */ +GPUTexture *GPU_texture_create_nD( + int w, int h, int d, int n, const void *pixels, + GPUTextureFormat tex_format, GPUDataFormat gpu_data_format, int samples, + const bool can_rescale, char err_out[256]); + GPUTexture *GPU_texture_create_1D( int w, GPUTextureFormat data_type, const float *pixels, char err_out[256]); GPUTexture *GPU_texture_create_2D( @@ -159,7 +174,7 @@ GPUTexture *GPU_texture_create_3D( GPUTexture *GPU_texture_create_cube( int w, GPUTextureFormat data_type, const float *pixels, char err_out[256]); GPUTexture *GPU_texture_create_from_vertbuf( - struct Gwn_VertBuf *vert); + struct GPUVertBuf *vert); GPUTexture *GPU_texture_create_buffer( GPUTextureFormat data_type, const uint buffer); @@ -168,22 +183,21 @@ GPUTexture *GPU_texture_from_blender( struct Image *ima, struct ImageUser *iuser, int textarget, bool is_data, double time); GPUTexture *GPU_texture_from_preview(struct PreviewImage *prv, int mipmap); -void GPU_texture_update(GPUTexture *tex, const void *pixels); +void GPU_texture_add_mipmap(GPUTexture *tex, GPUDataFormat gpu_data_format, int miplvl, const void *pixels); + +void GPU_texture_update(GPUTexture *tex, GPUDataFormat data_format, const void *pixels); void GPU_texture_update_sub( - GPUTexture *tex, const void *pixels, + GPUTexture *tex, GPUDataFormat gpu_data_format, const void *pixels, int offset_x, int offset_y, int offset_z, int width, int height, int depth); +void *GPU_texture_read(GPUTexture *tex, GPUDataFormat gpu_data_format, int miplvl); + void GPU_invalid_tex_init(void); void GPU_invalid_tex_bind(int mode); void GPU_invalid_tex_free(void); void GPU_texture_free(GPUTexture *tex); -void GPU_texture_orphans_init(void); -void GPU_texture_orphans_exit(void); -/* This has to be called from a thread with an ogl context bound. */ -void GPU_texture_orphans_delete(void); - void GPU_texture_ref(GPUTexture *tex); void GPU_texture_bind(GPUTexture *tex, int number); void GPU_texture_unbind(GPUTexture *tex); @@ -202,6 +216,7 @@ int GPU_texture_detach_framebuffer(GPUTexture *tex, struct GPUFrameBuffer *fb); int GPU_texture_target(const GPUTexture *tex); int GPU_texture_width(const GPUTexture *tex); int GPU_texture_height(const GPUTexture *tex); +int GPU_texture_layers(const GPUTexture *tex); GPUTextureFormat GPU_texture_format(const GPUTexture *tex); int GPU_texture_samples(const GPUTexture *tex); bool GPU_texture_cube(const GPUTexture *tex); @@ -210,6 +225,8 @@ bool GPU_texture_stencil(const GPUTexture *tex); bool GPU_texture_integer(const GPUTexture *tex); int GPU_texture_opengl_bindcode(const GPUTexture *tex); +void GPU_texture_get_mipmap_size(GPUTexture *tex, int lvl, int *size); + #ifdef __cplusplus } #endif |