63 # define DEBUG_NAME_LEN 64
65 # define DEBUG_NAME_LEN 8
69 #define GPU_TEX_MAX_FBO_ATTACHED 16
255 return reinterpret_cast<Texture *
>(vert);
259 return reinterpret_cast<const Texture *
>(vert);
262 #undef DEBUG_NAME_LEN
312 BLI_assert(!
"Texture format incorrect or unsupported\n");
329 BLI_assert(!
"Texture format is not a compressed format\n");
391 switch (data_format) {
403 BLI_assert(!
"Data format incorrect or unsupported\n");
416 switch (tex_format) {
450 switch (tex_format) {
483 switch (tex_format) {
499 BLI_assert(!
"Incorrect vertex format for buffer texture");
502 switch (
format->attrs[0].comp_len) {
504 switch (
format->attrs[0].comp_type) {
524 switch (
format->attrs[0].comp_type) {
547 switch (
format->attrs[0].comp_type) {
557 switch (
format->attrs[0].fetch_mode) {
580 BLI_assert(!
"Unsupported vertex format for buffer texture");
MINLINE int max_ii(int a, int b)
#define ENUM_OPERATORS(_type, _max)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
struct GPUTexture GPUTexture
@ GPU_DATA_2_10_10_10_REV
struct GPUVertBuf GPUVertBuf
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
bool init_3D(int w, int h, int d, eGPUTextureFormat format)
eGPUTextureFormatFlag format_flag_get(void) const
virtual void mip_range_set(int min, int max)=0
bool init_1D(int w, int layers, eGPUTextureFormat format)
virtual bool init_internal(GPUVertBuf *vbo)=0
virtual bool init_internal(void)=0
void attach_to(FrameBuffer *fb, GPUAttachmentType type)
int width_get(void) const
int mip_width_get(int mip) const
int depth_get(void) const
eGPUTextureFormat format_
int mip_depth_get(int mip) const
bool init_cubemap(int w, int layers, eGPUTextureFormat format)
eGPUTextureType type_get(void) const
eGPUTextureFormatFlag format_flag_
void update(eGPUDataFormat format, const void *data)
int height_get(void) const
char name_[DEBUG_NAME_LEN]
FrameBuffer * fb_[GPU_TEX_MAX_FBO_ATTACHED]
bool init_2D(int w, int h, int layers, eGPUTextureFormat format)
virtual void swizzle_set(const char swizzle_mask[4])=0
bool init_buffer(GPUVertBuf *vbo, eGPUTextureFormat format)
GPUAttachmentType fb_attachment_[GPU_TEX_MAX_FBO_ATTACHED]
GPUAttachmentType attachment_type(int slot) const
virtual void generate_mipmap(void)=0
eGPUSamplerState sampler_state
int mip_height_get(int mip) const
eGPUTextureFormat format_get(void) const
virtual void clear(eGPUDataFormat format, const void *data)=0
int layer_count(void) const
int dimensions_count(void) const
virtual void * read(int mip, eGPUDataFormat format)=0
virtual void update_sub(int mip, int offset[3], int extent[3], eGPUDataFormat format, const void *data)=0
void mip_size_get(int mip, int r_size[3]) const
virtual void copy_to(Texture *tex)=0
virtual uint gl_bindcode_get(void) const =0
Texture(const char *name)
void detach_from(FrameBuffer *fb)
@ GPU_FB_DEPTH_STENCIL_ATTACHMENT
@ GPU_FB_COLOR_ATTACHMENT0
@ GPU_FB_DEPTH_ATTACHMENT
#define GPU_TEX_MAX_FBO_ATTACHED
BLI_INLINE float fb(float length, float L)
bool validate_data_format(eGPUTextureFormat tex_format, eGPUDataFormat data_format)
size_t to_block_size(eGPUTextureFormat data_type)
static GPUContext * wrap(Context *ctx)
static Context * unwrap(GPUContext *ctx)
@ GPU_FORMAT_DEPTH_STENCIL
eGPUFrameBufferBits to_framebuffer_bits(eGPUTextureFormat tex_format)
eGPUDataFormat to_data_format(eGPUTextureFormat tex_format)
static eGPUTextureFormat to_texture_format(const GPUVertFormat *format)
eGPUTextureFormatFlag to_format_flag(eGPUTextureFormat format)
static size_t to_bytesize(GPUIndexBufType type)
int to_component_len(eGPUTextureFormat format)