Textures
Typedefs
-
typedef BaseTexture Texture
-
typedef BaseTexture CubeTexture
-
typedef BaseTexture VolTexture
-
typedef BaseTexture ArrayTexture
Enums
-
enum class ChannelDType
Values:
-
enumerator NONE
-
enumerator UNORM
-
enumerator SNORM
-
enumerator UFLOAT
-
enumerator SFLOAT
-
enumerator UINT
-
enumerator SINT
-
enumerator NONE
-
enum [anonymous]
Values:
-
enumerator TEXLOCK_DISCARD
-
enumerator TEXLOCK_RAWDATA
-
enumerator TEXLOCK_NO_DIRTY_UPDATE
-
enumerator TEXLOCK_NOSYSLOCK
-
enumerator TEXLOCK_READ
-
enumerator TEXLOCK_WRITE
-
enumerator TEXLOCK_READWRITE
-
enumerator TEXLOCK_RWMASK
-
enumerator TEXLOCK_NOOVERWRITE
-
enumerator TEXLOCK_DELSYSMEMCOPY
-
enumerator TEXLOCK_SYSTEXLOCK
-
enumerator TEXLOCK_UPDATEFROMSYSTEX
-
enumerator TEXLOCK_DONOTUPDATEON9EXBYDEFAULT
-
enumerator TEXLOCK_COPY_STAGING
-
enumerator TEXLOCK_DEFAULT
-
enumerator TEXLOCK_DISCARD
Functions
- bool __forceinline is_alpha_texformat (unsigned flags)
- bool __forceinline is_bc_texformat (unsigned flags)
-
uint32_t auto_mip_levels_count(uint32_t w, uint32_t h, uint32_t min_size)
-
void apply_gen_tex_props(BaseTexture *t, const struct TextureMetaData &tmd, bool force_addr_from_tmd = true)
-
uint32_t parse_tex_format(const char *name, uint32_t default_fmt)
-
const TextureFormatDesc &get_tex_format_desc(uint32_t fmt)
-
const char *get_tex_format_name(uint32_t fmt)
-
uint32_t get_tex_channel_value(const void *pixel, const TextureChannelFormatDesc &channel)
-
float channel_bits_to_float(uint32_t bits, ChannelDType type, const TextureChannelFormatDesc &channel)
Variables
-
bool (*d3d_load_ddsx_tex_contents)(BaseTexture *tex, TEXTUREID tid, TEXTUREID paired_tid, const ddsx::Header &hdr, IGenLoad &crd, int q_id, int start_lev, unsigned tex_ld_lev)
load texture content from DDSx stream using DDSx header for previously allocated texture
-
bool (*d3d_load_ddsx_to_slice)(BaseTexture *tex, int slice, const ddsx::Header &hdr, IGenLoad &crd, int q_id, int start_lev, unsigned tex_ld_lev)
load texture content from DDSx stream using DDSx header to specified slice of previously allocated array texture
-
struct TextureChannelFormatDesc
-
struct TextureFormatDesc
Public Functions
-
inline bool hasAlpha() const
-
inline bool isDepth() const
-
inline int rgbaChannelsCount() const
-
inline int channelsCount() const
Public Members
-
uint32_t dagorTextureFormat
-
uint16_t bytesPerElement
-
bool isBlockFormat
-
uint8_t elementWidth
-
uint8_t elementHeight
-
ChannelDType mainChannelsType
-
ChannelDType stencilChannelType
-
TextureChannelFormatDesc stencil
-
inline bool hasAlpha() const
-
struct TextureInfo
Public Members
-
unsigned short w = 1
width, height, depth (for VOLTEX), array slices (slice count for ARRTEX or 6 for CUBETEX)
-
unsigned short h = 1
-
unsigned short d = 1
-
unsigned short a = 1
-
unsigned short mipLevels = 0
all mips and res type
-
unsigned short resType = 0
-
unsigned cflg = 0
texture creation flags
-
unsigned short w = 1
-
class BaseTexture : public D3dResource
Public Functions
-
inline virtual bool setReloadCallback(IReloadData*)
-
virtual int generateMips() = 0
-
virtual int update(BaseTexture *src) = 0
-
inline int calcSubResIdx(int level, int slice = 0) const
-
virtual int updateSubRegion(BaseTexture *src, int src_subres_idx, int src_x, int src_y, int src_z, int src_w, int src_h, int src_d, int dest_subres_idx, int dest_x, int dest_y, int dest_z) = 0
-
virtual int level_count() const = 0
-
virtual int texaddr(int addrmode) = 0
-
virtual int texaddru(int addrmode) = 0
-
virtual int texaddrv(int addrmode) = 0
-
inline virtual int texaddrw(int)
-
virtual int texbordercolor(E3DCOLOR) = 0
-
virtual int texfilter(int filtermode) = 0
-
virtual int texmipmap(int mipmapmode) = 0
-
virtual int texlod(float mipmaplod) = 0
-
virtual int texmiplevel(int minlevel, int maxlevel) = 0
-
virtual int setAnisotropy(int level) = 0
-
inline virtual bool isCubeArray() const
-
inline virtual void setReadStencil(bool)
-
inline virtual void setTID(TEXTUREID)
-
inline virtual TEXTUREID getTID() const
-
inline const char *getTexName() const
-
inline virtual void setResApiName(const char*) const
-
virtual int lockimg(void**, int &stride_bytes, int level, unsigned flags) = 0
-
virtual int lockimg(void**, int &stride_bytes, int layer, int level, unsigned flags) = 0
-
inline virtual int unlockimg()
-
inline int unlock()
-
inline virtual int lockbox(void**, int&, int&, int, unsigned)
-
inline virtual int unlockbox()
-
inline virtual bool addDirtyRect(const RectInt&)
-
virtual int getinfo(TextureInfo &info, int level = 0) const = 0
-
template<typename T>
inline int lockimgEx(T **p, int &stride_bytes, int level = 0, unsigned flags = TEXLOCK_DEFAULT)
-
inline virtual BaseTexture *makeTmpTexResCopy(int, int, int, int, bool = false)
created temporary BaseTexture with texture res object with given dimensions (texture format and texture subtype is used from original)
-
inline virtual void replaceTexResObject(BaseTexture *&new_tex)
replaces texture res object with new one of new_tex and then destroys new_tex (destruction may be delayed by driver)
-
inline virtual bool allocateTex()
forces allocation of texture resource; return true if tex allocated and ready for use
-
inline virtual void discardTex()
discards texture and returns it to STUB state
-
inline virtual bool downSize(int width, int height, int depth, int mips, unsigned start_src_level, unsigned level_offset)
-
inline virtual bool upSize(int width, int height, int depth, int mips, unsigned start_src_level, unsigned level_offset)
Public Static Functions
-
static inline int calcSubResIdx(int level, int slice, int mip_levels)
Protected Functions
-
inline ~BaseTexture() override
Protected Static Attributes
-
static constexpr int TEX_COPIED = 1 << 30
-
struct IReloadData
Public Functions
-
inline virtual ~IReloadData()
-
virtual void reloadD3dRes(BaseTexture *t) = 0
-
virtual void destroySelf() = 0
-
inline virtual ~IReloadData()
-
inline virtual bool setReloadCallback(IReloadData*)
-
namespace ddsx