71# define DEBUG_NAME_LEN 64
73# define DEBUG_NAME_LEN 8
77#define GPU_TEX_MAX_FBO_ATTACHED 32
91#ifndef GPU_NO_USE_PY_REFERENCES
163 GPUPixelBuffer *pixbuf) = 0;
308 BLI_assert_msg(0,
"Texture cannot be attached to a framebuffer because of its type");
319 bool use_stencil) = 0;
325 return reinterpret_cast<GPUTexture *
>(vert);
329 return reinterpret_cast<Texture *
>(vert);
333 return reinterpret_cast<const Texture *
>(vert);
354 return reinterpret_cast<GPUPixelBuffer *
>(pixbuf);
362 return reinterpret_cast<const PixelBuffer *
>(pixbuf);
414 return (3 * 10 + 2) / 8;
416 return (11 + 11 + 10) / 8;
419 return (32 + 8 + 24) / 8;
423 return (3 * 8 + 8) / 8;
466 return (3 * 9 + 5) / 8;
735 switch (data_format) {
771 switch (tex_format) {
890 switch (tex_format) {
995 switch (tex_format) {
1064 BLI_assert_msg(0,
"This texture format is not compatible with framebuffer attachment.");
1076 BLI_assert_msg(0,
"This texture format is not compatible with framebuffer attachment.");
1085 if (
format->attr_len == 0) {
1089 switch (
format->attrs[0].comp_len) {
1091 switch (
format->attrs[0].comp_type) {
1111 switch (
format->attrs[0].comp_type) {
1134 switch (
format->attrs[0].comp_type) {
1144 switch (
format->attrs[0].fetch_mode) {
1167 BLI_assert_msg(0,
"Unsupported vertex format for buffer texture");
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
MINLINE int max_ii(int a, int b)
#define ENUM_OPERATORS(_type, _max)
@ GPU_DATA_2_10_10_10_REV
BMesh const char void * data
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
virtual ~PixelBuffer()=default
virtual GPUPixelBufferNativeHandle get_native_handle()=0
virtual size_t get_size()=0
virtual void mip_range_set(int min, int max)=0
virtual uint gl_bindcode_get() const =0
GPUSamplerState sampler_state
void attach_to(FrameBuffer *fb, GPUAttachmentType type)
bool init_view(GPUTexture *src, eGPUTextureFormat format, eGPUTextureType type, int mip_start, int mip_len, int layer_start, int layer_len, bool cube_as_array, bool use_stencil)
virtual bool init_internal(GPUTexture *src, int mip_offset, int layer_offset, bool use_stencil)=0
virtual bool init_internal(VertBuf *vbo)=0
int mip_width_get(int mip) const
eGPUTextureFormat format_
int mip_depth_get(int mip) const
eGPUTextureFormatFlag format_flag_get() const
virtual void * read(int mip, eGPUDataFormat format)=0
virtual void generate_mipmap()=0
eGPUTextureFormat format_get() const
eGPUTextureFormatFlag format_flag_
void update(eGPUDataFormat format, const void *data)
eGPUTextureUsage gpu_image_usage_flags_
eGPUTextureUsage usage_get() const
char name_[DEBUG_NAME_LEN]
FrameBuffer * fb_[GPU_TEX_MAX_FBO_ATTACHED]
int dimensions_count() const
virtual void swizzle_set(const char swizzle_mask[4])=0
virtual void update_sub(int offset[3], int extent[3], eGPUDataFormat format, GPUPixelBuffer *pixbuf)=0
GPUAttachmentType fb_attachment_[GPU_TEX_MAX_FBO_ATTACHED]
GPUAttachmentType attachment_type(int slot) const
bool init_1D(int w, int layers, int mip_len, eGPUTextureFormat format)
int mip_height_get(int mip) const
virtual void clear(eGPUDataFormat format, const void *data)=0
eGPUTextureType type_get() const
bool init_buffer(VertBuf *vbo, eGPUTextureFormat format)
virtual bool init_internal()=0
bool init_cubemap(int w, int layers, int mip_len, eGPUTextureFormat format)
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
void usage_set(eGPUTextureUsage usage_flags)
bool init_3D(int w, int h, int d, int mip_len, eGPUTextureFormat format)
Texture(const char *name)
void detach_from(FrameBuffer *fb)
bool init_2D(int w, int h, int layers, int mip_len, eGPUTextureFormat format)
@ 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)
static Context * unwrap(GPUContext *ctx)
size_t to_block_size(eGPUTextureFormat data_type)
static GPUContext * wrap(Context *ctx)
constexpr bool validate_data_format(eGPUTextureFormat tex_format, eGPUDataFormat data_format)
@ GPU_FORMAT_NORMALIZED_INTEGER
@ GPU_FORMAT_DEPTH_STENCIL
eGPUFrameBufferBits to_framebuffer_bits(eGPUTextureFormat tex_format)
int to_bytesize(const DataFormat format)
eGPUTextureFormatFlag to_format_flag(eGPUTextureFormat format)
int to_component_len(eGPUTextureFormat format)
constexpr DataFormat to_data_format(TextureFormat format)
constexpr TextureFormat to_texture_format(TextureTargetFormat format)
static constexpr GPUSamplerState default_sampler()