Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/GPU_texture.h
| Show All 10 Lines | |||||
| #include "GPU_state.h" | #include "GPU_state.h" | ||||
| struct GPUVertBuf; | struct GPUVertBuf; | ||||
| /** Opaque type hiding blender::gpu::Texture. */ | /** Opaque type hiding blender::gpu::Texture. */ | ||||
| typedef struct GPUTexture GPUTexture; | typedef struct GPUTexture GPUTexture; | ||||
| /** Opaque type hiding blender::gpu::PixelBuffer. */ | |||||
| typedef struct GPUPixelBuffer GPUPixelBuffer; | |||||
| /** | /** | ||||
| * GPU Samplers state | * GPU Samplers state | ||||
| * - Specify the sampler state to bind a texture with. | * - Specify the sampler state to bind a texture with. | ||||
| * - Internally used by textures. | * - Internally used by textures. | ||||
| * - All states are created at startup to avoid runtime costs. | * - All states are created at startup to avoid runtime costs. | ||||
| */ | */ | ||||
| typedef enum eGPUSamplerState { | typedef enum eGPUSamplerState { | ||||
| GPU_SAMPLER_DEFAULT = 0, | GPU_SAMPLER_DEFAULT = 0, | ||||
| ▲ Show 20 Lines • Show All 252 Lines • ▼ Show 20 Lines | void GPU_texture_update_sub(GPUTexture *tex, | ||||
| eGPUDataFormat data_format, | eGPUDataFormat data_format, | ||||
| const void *pixels, | const void *pixels, | ||||
| int offset_x, | int offset_x, | ||||
| int offset_y, | int offset_y, | ||||
| int offset_z, | int offset_z, | ||||
| int width, | int width, | ||||
| int height, | int height, | ||||
| int depth); | int depth); | ||||
| /* Update from API Buffer. */ | |||||
| void GPU_texture_update_sub_from_pixel_buffer(GPUTexture *tex, | |||||
| eGPUDataFormat data_format, | |||||
| GPUPixelBuffer *pix_buf, | |||||
| int offset_x, | |||||
| int offset_y, | |||||
| int offset_z, | |||||
| int width, | |||||
| int height, | |||||
| int depth); | |||||
| /** | /** | ||||
| * Makes data interpretation aware of the source layout. | * Makes data interpretation aware of the source layout. | ||||
| * Skipping pixels correctly when changing rows when doing partial update. | * Skipping pixels correctly when changing rows when doing partial update. | ||||
| */ | */ | ||||
| void GPU_unpack_row_length_set(uint len); | void GPU_unpack_row_length_set(uint len); | ||||
| void *GPU_texture_read(GPUTexture *tex, eGPUDataFormat data_format, int miplvl); | void *GPU_texture_read(GPUTexture *tex, eGPUDataFormat data_format, int miplvl); | ||||
| /** | /** | ||||
| ▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | |||||
| void GPU_texture_get_mipmap_size(GPUTexture *tex, int lvl, int *size); | void GPU_texture_get_mipmap_size(GPUTexture *tex, int lvl, int *size); | ||||
| /* Utilities. */ | /* Utilities. */ | ||||
| size_t GPU_texture_component_len(eGPUTextureFormat format); | size_t GPU_texture_component_len(eGPUTextureFormat format); | ||||
| size_t GPU_texture_dataformat_size(eGPUDataFormat data_format); | size_t GPU_texture_dataformat_size(eGPUDataFormat data_format); | ||||
| /* GPU Pixel Buffer. */ | |||||
| GPUPixelBuffer *GPU_pixel_buffer_create(uint size); | |||||
| void GPU_pixel_buffer_free(GPUPixelBuffer *pix_buf); | |||||
| void *GPU_pixel_buffer_map(GPUPixelBuffer *pix_buf); | |||||
| void GPU_pixel_buffer_unmap(GPUPixelBuffer *pix_buf); | |||||
| uint GPU_pixel_buffer_size(GPUPixelBuffer *pix_buf); | |||||
| int64_t GPU_pixel_buffer_get_native_handle(GPUPixelBuffer *pix_buf); | |||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| } | } | ||||
| #endif | #endif | ||||