22struct TextureSubresourceInfo;
73 return this->width == dims.
width && this->height == dims.
height && this->depth == dims.
depth;
258#ifdef WITH_NEBULA_EDITOR
270 if (
string ==
"Texture1D")
return Texture1D;
271 else if (
string ==
"Texture2D")
return Texture2D;
272 else if (
string ==
"Texture3D")
return Texture3D;
273 else if (
string ==
"TextureCube")
return TextureCube;
279 n_error(
"Unknown texture type '%s'",
string.AsCharPtr());
313extern TextureId
Red2D;
Nebula's dynamic array class.
Definition array.h:60
const SizeT Size() const
get number of elements in array
Definition array.h:880
A StringAtom.
Definition stringatom.h:22
void __cdecl n_error(const char *msg,...)
This function is called when a serious situation is encountered which requires abortion of the applic...
Definition debug.cc:138
#define _DECL_ACQUIRE_RELEASE(ty)
Definition idallocator.h:88
Acceleration structures are used to enable ray tracing on the GPU by dividing the scene into a BVH.
Definition accelerationstructure.h:24
ImageLayout
Definition config.h:97
SizeT TextureSparseGetNumPages(const CoreGraphics::TextureId id, IndexT layer, IndexT mip)
get the number of pages for a given layer and mip
Definition vktexture.cc:972
TextureSparsePageSize TextureSparseGetPageSize(const CoreGraphics::TextureId id)
get the texture page size, which is constant for the whole texture
Definition vktexture.cc:918
void TextureSparseCommitChanges(const CoreGraphics::TextureId id)
commit texture sparse page updates
Definition vktexture.cc:1162
TextureType
texture types
Definition texture.h:30
@ Texture3D
Definition texture.h:35
@ Texture1D
Definition texture.h:33
@ Texture1DArray
Definition texture.h:38
@ InvalidTextureType
Definition texture.h:31
@ TextureCube
Definition texture.h:36
@ TextureCubeArray
Definition texture.h:40
@ Texture2DArray
Definition texture.h:39
@ Texture2D
Definition texture.h:34
const TextureSparsePage & TextureSparseGetPage(const CoreGraphics::TextureId id, IndexT layer, IndexT mip, IndexT pageIndex)
get texture page
Definition vktexture.cc:959
void TextureGenerateMipmaps(const CoreGraphics::CmdBufferId cmdBuf, const TextureId id)
generate mipmaps for texture
Definition texture.cc:33
bool TextureUpdate(const CoreGraphics::CmdBufferId cmd, CoreGraphics::TextureId tex, const SizeT width, SizeT height, SizeT mip, SizeT layer, const void *data, SizeT dataSize)
Update texture from data buffer, returns true if there is enough upload heap space.
Definition texture.cc:119
void TextureSparseEvictMip(const CoreGraphics::TextureId id, IndexT layer, IndexT mip)
evict a whole mip
Definition vktexture.cc:1080
SizeT TextureGetNumLayers(const TextureId id)
get number of layers
Definition vktexture.cc:822
CoreGraphics::PixelFormat::Code TextureGetPixelFormat(const TextureId id)
get texture pixel format
Definition vktexture.cc:795
void TextureSparseEvict(const CoreGraphics::TextureId id, IndexT layer, IndexT mip, IndexT pageIndex)
evict a page
Definition vktexture.cc:1001
TextureDimensions TextureGetDimensions(const TextureId id)
get texture dimensions
Definition vktexture.cc:776
Util::StringAtom TextureGetName(const TextureId id)
Get name of texture.
Definition vktexture.cc:766
TextureId Black2D
Definition texture.cc:15
TextureType TextureTypeFromString(const Util::String &string)
Definition texture.h:268
TextureId White1D
Definition texture.cc:14
const CoreGraphics::ImageLayout TextureGetDefaultLayout(const TextureId id)
get default texture layout
Definition vktexture.cc:858
TextureId Blue2D
Definition texture.cc:24
TextureUsage
type of texture usage
Definition texture.h:56
@ SampleTexture
Definition texture.h:58
@ InvalidTextureUsage
Definition texture.h:57
@ RenderTexture
Definition texture.h:59
@ ReadWriteTexture
Definition texture.h:60
@ DeviceExclusive
Definition texture.h:63
@ TransferSourceTexture
Definition texture.h:61
@ TransferDestinationTexture
Definition texture.h:62
TextureCubeFace
cube map face
Definition texture.h:45
@ NegX
Definition texture.h:47
@ NegY
Definition texture.h:49
@ NegZ
Definition texture.h:51
@ PosY
Definition texture.h:48
@ PosX
Definition texture.h:46
@ PosZ
Definition texture.h:50
TextureId White1DArray
Definition texture.cc:19
static const ubyte TextureAutoMips
Definition texture.h:98
TextureUsage TextureUsageFromString(const Util::String &string)
Definition texture.h:288
void TextureSparseMakeResident(const CoreGraphics::TextureId id, IndexT layer, IndexT mip, IndexT pageIndex)
make a page resident
Definition vktexture.cc:1041
void TextureSetHighestLod(const CoreGraphics::TextureId id, uint lod)
Set highest LOD on texture.
Definition vktexture.cc:1439
TextureId White3D
Definition texture.cc:18
SizeT TextureGetNumMips(const TextureId id)
get number of mips
Definition vktexture.cc:813
void TextureClearDepthStencil(const CoreGraphics::CmdBufferId cmd, const CoreGraphics::TextureId id, float depth, uint stencil, const CoreGraphics::ImageLayout layout, const CoreGraphics::TextureSubresourceInfo &subres)
clear texture with depth-stencil
Definition vktexture.cc:1414
TextureId White2DArray
Definition texture.cc:20
TextureId Red2D
Definition texture.cc:22
TextureId Green2D
Definition texture.cc:23
uint TextureGetStencilBindlessHandle(const TextureId id)
get bindless texture handle
Definition vktexture.cc:876
const CoreGraphics::TextureId TextureGetAlias(const TextureId id)
get texture alias, returns invalid id if not aliased
Definition vktexture.cc:840
IndexT TextureSparseGetMaxMip(const CoreGraphics::TextureId id)
get highest sparse mip
Definition vktexture.cc:989
TextureRelativeDimensions TextureGetRelativeDimensions(const TextureId id)
get texture relative dimensions
Definition vktexture.cc:786
void TextureClearColor(const CoreGraphics::CmdBufferId cmd, const CoreGraphics::TextureId id, Math::vec4 color, const CoreGraphics::ImageLayout layout, const CoreGraphics::TextureSubresourceInfo &subres)
clear texture with color
Definition vktexture.cc:1390
void DestroyTexture(const TextureId id)
destroy vertex buffer
Definition vktexture.cc:752
void TextureSparseMakeMipResident(const CoreGraphics::TextureId id, IndexT layer, IndexT mip)
make a whole mip resident
Definition vktexture.cc:1121
TextureChannelMapping
Definition texture.h:83
IndexT TextureSparseGetPageIndex(const CoreGraphics::TextureId id, IndexT layer, IndexT mip, IndexT x, IndexT y, IndexT z)
get the page index at a given coordinate
Definition vktexture.cc:936
TextureId White2D
Definition texture.cc:16
const CoreGraphics::TextureUsage TextureGetUsage(const TextureId id)
get texture usage
Definition vktexture.cc:849
uint TextureGetBindlessHandle(const TextureId id)
get bindless texture handle
Definition vktexture.cc:867
TextureId WhiteCube
Definition texture.cc:17
const Util::Array< CoreGraphics::TextureId > & TextureGetCreated()
Definition texture.cc:214
TextureId WhiteCubeArray
Definition texture.cc:21
SizeT TextureGetNumSamples(const TextureId id)
get sample count
Definition vktexture.cc:831
TextureType TextureGetType(const TextureId id)
get texture type
Definition vktexture.cc:804
const TextureId CreateTexture(const TextureCreateInfo &info)
create new vertex buffer with intended usage, access and CPU syncing parameters, together with size o...
Definition vktexture.cc:606
void TextureWindowResized(const TextureId id)
If texture is bound to the window resolution, reset the internal texture without mucking with the tex...
Definition vktexture.cc:887
TextureCreateInfoAdjusted TextureGetAdjustedInfo(const TextureCreateInfo &info)
helper function to setup RenderTextureInfo, already implemented
Definition texture.cc:149
@ None
Definition resourceloader.h:51
Compile time configuration options for the CoreGraphics subsystem.
Graphics memory interface.
#define RESOURCE_ID_TYPE(type)
Definition resourceid.h:41
#define __ImplementEnumBitOperators(type)
Definition commandbuffer.h:155
uint stencil
Definition texture.h:102
float depth
Definition texture.h:101
float heightScale
Definition texture.h:162
CoreGraphics::WindowId window
Definition texture.h:163
float widthScale
Definition texture.h:162
float depthScale
Definition texture.h:162
float width
Definition texture.h:140
Util::StringAtom tag
Definition texture.h:135
uint mips
Definition texture.h:141
Math::uint4 clearColorU4
Definition texture.h:147
const void * data
Definition texture.h:136
bool windowRelative
Definition texture.h:151
bool sparse
Definition texture.h:153
DepthStencilClear clearDepthStencil
Definition texture.h:149
Math::float4 clearColorF4
Definition texture.h:146
CoreGraphics::TextureSwizzle swizzle
Definition texture.h:157
bool allowCast
Definition texture.h:154
uint samples
Definition texture.h:142
bool clear
Definition texture.h:143
bool bindless
Definition texture.h:152
CoreGraphics::TextureType type
Definition texture.h:138
TextureCreateInfo()
Definition texture.h:107
CoreGraphics::TextureUsage usage
Definition texture.h:134
CoreGraphics::ImageLayout defaultLayout
Definition texture.h:156
CoreGraphics::PixelFormat::Code format
Definition texture.h:139
Resources::ResourceName name
Definition texture.h:133
SizeT dataSize
Definition texture.h:137
Math::int4 clearColorI4
Definition texture.h:148
float depth
Definition texture.h:140
uint minMip
Definition texture.h:141
float height
Definition texture.h:140
CoreGraphics::TextureId alias
Definition texture.h:155
uint layers
Definition texture.h:141
SizeT width
Definition texture.h:69
SizeT height
Definition texture.h:69
bool operator==(const TextureDimensions &dims) const
Definition texture.h:71
SizeT depth
Definition texture.h:69
texture type
Definition texture.h:25
float height
Definition texture.h:79
float width
Definition texture.h:79
float depth
Definition texture.h:79
TextureSparsePageSize extent
Definition texture.h:179
TextureSparsePageOffset offset
Definition texture.h:178
CoreGraphics::Alloc alloc
Definition texture.h:180
uint z
Definition texture.h:173
uint y
Definition texture.h:173
uint x
Definition texture.h:173
uint height
Definition texture.h:168
uint depth
Definition texture.h:168
uint width
Definition texture.h:168
TextureChannelMapping alpha
Definition texture.h:95
TextureChannelMapping red
Definition texture.h:95
TextureChannelMapping blue
Definition texture.h:95
TextureChannelMapping green
Definition texture.h:95
A 4D vector.
Definition vec4.h:24
Nebula's universal string class.
Definition string.h:50
unsigned char ubyte
Definition types.h:34
int SizeT
Definition types.h:49
unsigned int uint
Definition types.h:31
int IndexT
Definition types.h:48