|
|
@@ -15,8 +15,7 @@ namespace anki
|
|
|
/// @addtogroup graphics
|
|
|
/// @{
|
|
|
|
|
|
-/// The draw indirect structure for index drawing, also the parameters of a
|
|
|
-/// regular drawcall
|
|
|
+/// The draw indirect structure for index drawing, also the parameters of a regular drawcall
|
|
|
class DrawElementsIndirectInfo
|
|
|
{
|
|
|
public:
|
|
|
@@ -24,11 +23,7 @@ public:
|
|
|
{
|
|
|
}
|
|
|
|
|
|
- DrawElementsIndirectInfo(U32 count,
|
|
|
- U32 instanceCount,
|
|
|
- U32 firstIndex,
|
|
|
- U32 baseVertex,
|
|
|
- U32 baseInstance)
|
|
|
+ DrawElementsIndirectInfo(U32 count, U32 instanceCount, U32 firstIndex, U32 baseVertex, U32 baseInstance)
|
|
|
: m_count(count)
|
|
|
, m_instanceCount(instanceCount)
|
|
|
, m_firstIndex(firstIndex)
|
|
|
@@ -44,8 +39,7 @@ public:
|
|
|
U32 m_baseInstance = 0;
|
|
|
};
|
|
|
|
|
|
-/// The draw indirect structure for arrays drawing, also the parameters of a
|
|
|
-/// regular drawcall
|
|
|
+/// The draw indirect structure for arrays drawing, also the parameters of a regular drawcall
|
|
|
class DrawArraysIndirectInfo
|
|
|
{
|
|
|
public:
|
|
|
@@ -53,8 +47,7 @@ public:
|
|
|
{
|
|
|
}
|
|
|
|
|
|
- DrawArraysIndirectInfo(
|
|
|
- U32 count, U32 instanceCount, U32 first, U32 baseInstance)
|
|
|
+ DrawArraysIndirectInfo(U32 count, U32 instanceCount, U32 first, U32 baseInstance)
|
|
|
: m_count(count)
|
|
|
, m_instanceCount(instanceCount)
|
|
|
, m_first(first)
|
|
|
@@ -68,8 +61,7 @@ public:
|
|
|
U32 m_baseInstance = 0;
|
|
|
};
|
|
|
|
|
|
-/// Command buffer initialization hints. They are used to optimize the
|
|
|
-/// allocators of a command buffer.
|
|
|
+/// Command buffer initialization hints. They are used to optimize the allocators of a command buffer.
|
|
|
class CommandBufferInitHints
|
|
|
{
|
|
|
friend class CommandBufferImpl;
|
|
|
@@ -158,20 +150,14 @@ public:
|
|
|
void endRenderPass();
|
|
|
|
|
|
/// Bind resources.
|
|
|
- void bindResourceGroup(
|
|
|
- ResourceGroupPtr rc, U slot, const TransientMemoryInfo* dynInfo);
|
|
|
+ void bindResourceGroup(ResourceGroupPtr rc, U slot, const TransientMemoryInfo* dynInfo);
|
|
|
/// @}
|
|
|
|
|
|
/// @name Jobs
|
|
|
/// @{
|
|
|
- void drawElements(U32 count,
|
|
|
- U32 instanceCount = 1,
|
|
|
- U32 firstIndex = 0,
|
|
|
- U32 baseVertex = 0,
|
|
|
- U32 baseInstance = 0);
|
|
|
+ void drawElements(U32 count, U32 instanceCount = 1, U32 firstIndex = 0, U32 baseVertex = 0, U32 baseInstance = 0);
|
|
|
|
|
|
- void drawArrays(
|
|
|
- U32 count, U32 instanceCount = 1, U32 first = 0, U32 baseInstance = 0);
|
|
|
+ void drawArrays(U32 count, U32 instanceCount = 1, U32 first = 0, U32 baseInstance = 0);
|
|
|
|
|
|
void drawElementsConditional(OcclusionQueryPtr query,
|
|
|
U32 count,
|
|
|
@@ -180,11 +166,8 @@ public:
|
|
|
U32 baseVertex = 0,
|
|
|
U32 baseInstance = 0);
|
|
|
|
|
|
- void drawArraysConditional(OcclusionQueryPtr query,
|
|
|
- U32 count,
|
|
|
- U32 instanceCount = 1,
|
|
|
- U32 first = 0,
|
|
|
- U32 baseInstance = 0);
|
|
|
+ void drawArraysConditional(
|
|
|
+ OcclusionQueryPtr query, U32 count, U32 instanceCount = 1, U32 first = 0, U32 baseInstance = 0);
|
|
|
|
|
|
void dispatchCompute(U32 groupCountX, U32 groupCountY, U32 groupCountZ);
|
|
|
|
|
|
@@ -194,31 +177,22 @@ public:
|
|
|
/// Generate mipmaps only for 3D textures.
|
|
|
void generateMipmaps3d(TexturePtr tex);
|
|
|
|
|
|
- void copyTextureSurfaceToTextureSurface(TexturePtr src,
|
|
|
- const TextureSurfaceInfo& srcSurf,
|
|
|
- TexturePtr dest,
|
|
|
- const TextureSurfaceInfo& destSurf);
|
|
|
+ void copyTextureSurfaceToTextureSurface(
|
|
|
+ TexturePtr src, const TextureSurfaceInfo& srcSurf, TexturePtr dest, const TextureSurfaceInfo& destSurf);
|
|
|
|
|
|
- void copyTextureVolumeToTextureVolume(TexturePtr src,
|
|
|
- const TextureVolumeInfo& srcVol,
|
|
|
- TexturePtr dest,
|
|
|
- const TextureVolumeInfo& destVol);
|
|
|
+ void copyTextureVolumeToTextureVolume(
|
|
|
+ TexturePtr src, const TextureVolumeInfo& srcVol, TexturePtr dest, const TextureVolumeInfo& destVol);
|
|
|
|
|
|
void clearTexture(TexturePtr tex, const ClearValue& clearValue);
|
|
|
|
|
|
- void clearTextureSurface(TexturePtr tex,
|
|
|
- const TextureSurfaceInfo& surf,
|
|
|
- const ClearValue& clearValue);
|
|
|
+ void clearTextureSurface(TexturePtr tex, const TextureSurfaceInfo& surf, const ClearValue& clearValue);
|
|
|
|
|
|
- void clearTextureVolume(TexturePtr tex,
|
|
|
- const TextureVolumeInfo& vol,
|
|
|
- const ClearValue& clearValue);
|
|
|
+ void clearTextureVolume(TexturePtr tex, const TextureVolumeInfo& vol, const ClearValue& clearValue);
|
|
|
|
|
|
/// Fill a buffer with some value.
|
|
|
/// @param[in,out] buff The buffer to fill.
|
|
|
/// @param offset From where to start filling. Must be multiple of 4.
|
|
|
- /// @param size The bytes to fill. Must be multiple of 4 or MAX_PTR_SIZE to
|
|
|
- /// indicate the whole buffer.
|
|
|
+ /// @param size The bytes to fill. Must be multiple of 4 or MAX_PTR_SIZE to indicate the whole buffer.
|
|
|
/// @param value The value to fill the buffer with.
|
|
|
void fillBuffer(BufferPtr buff, PtrSize offset, PtrSize size, U32 value);
|
|
|
/// @}
|
|
|
@@ -226,71 +200,41 @@ public:
|
|
|
/// @name Resource upload
|
|
|
/// @{
|
|
|
|
|
|
- /// Upload data to a texture surface. It's the base of all texture surface
|
|
|
- /// upload methods.
|
|
|
- void uploadTextureSurface(TexturePtr tex,
|
|
|
- const TextureSurfaceInfo& surf,
|
|
|
- const TransientMemoryToken& token);
|
|
|
-
|
|
|
- /// Same as uploadTextureSurface but it will perform the transient
|
|
|
- /// allocation as well. If that allocation fails expect the defaul OOM
|
|
|
- /// behaviour (crash).
|
|
|
- void uploadTextureSurfaceData(TexturePtr tex,
|
|
|
- const TextureSurfaceInfo& surf,
|
|
|
- void*& data,
|
|
|
- PtrSize& dataSize);
|
|
|
-
|
|
|
- /// Same as uploadTextureSurfaceData but it will return a nullptr in @a data
|
|
|
- /// if there is a OOM condition.
|
|
|
- void tryUploadTextureSurfaceData(TexturePtr tex,
|
|
|
- const TextureSurfaceInfo& surf,
|
|
|
- void*& data,
|
|
|
- PtrSize& dataSize);
|
|
|
-
|
|
|
- /// Same as uploadTextureSurface but it will perform the transient
|
|
|
- /// allocation and copy to it the @a data. If that allocation fails expect
|
|
|
- /// the defaul OOM behaviour (crash).
|
|
|
- void uploadTextureSurfaceCopyData(TexturePtr tex,
|
|
|
- const TextureSurfaceInfo& surf,
|
|
|
- void* data,
|
|
|
- PtrSize dataSize);
|
|
|
-
|
|
|
- /// Upload data to a texture volume. It's the base of all texture volume
|
|
|
- /// upload methods.
|
|
|
- void uploadTextureVolume(TexturePtr tex,
|
|
|
- const TextureVolumeInfo& vol,
|
|
|
- const TransientMemoryToken& token);
|
|
|
-
|
|
|
- /// Same as uploadTextureVolume but it will perform the transient
|
|
|
- /// allocation and copy to it the @a data. If that allocation fails expect
|
|
|
- /// the defaul OOM behaviour (crash).
|
|
|
- void uploadTextureVolumeCopyData(TexturePtr tex,
|
|
|
- const TextureVolumeInfo& surf,
|
|
|
- void* data,
|
|
|
- PtrSize dataSize);
|
|
|
+ /// Upload data to a texture surface. It's the base of all texture surface upload methods.
|
|
|
+ void uploadTextureSurface(TexturePtr tex, const TextureSurfaceInfo& surf, const TransientMemoryToken& token);
|
|
|
+
|
|
|
+ /// Same as uploadTextureSurface but it will perform the transient allocation as well. If that allocation fails
|
|
|
+ /// expect the defaul OOM behaviour (crash).
|
|
|
+ void uploadTextureSurfaceData(TexturePtr tex, const TextureSurfaceInfo& surf, void*& data, PtrSize& dataSize);
|
|
|
+
|
|
|
+ /// Same as uploadTextureSurfaceData but it will return a nullptr in @a data if there is a OOM condition.
|
|
|
+ void tryUploadTextureSurfaceData(TexturePtr tex, const TextureSurfaceInfo& surf, void*& data, PtrSize& dataSize);
|
|
|
+
|
|
|
+ /// Same as uploadTextureSurface but it will perform the transient allocation and copy to it the @a data. If that
|
|
|
+ /// allocation fails expect the defaul OOM behaviour (crash).
|
|
|
+ void uploadTextureSurfaceCopyData(TexturePtr tex, const TextureSurfaceInfo& surf, void* data, PtrSize dataSize);
|
|
|
+
|
|
|
+ /// Upload data to a texture volume. It's the base of all texture volume upload methods.
|
|
|
+ void uploadTextureVolume(TexturePtr tex, const TextureVolumeInfo& vol, const TransientMemoryToken& token);
|
|
|
+
|
|
|
+ /// Same as uploadTextureVolume but it will perform the transient allocation and copy to it the @a data. If that
|
|
|
+ /// allocation fails expect the defaul OOM behaviour (crash).
|
|
|
+ void uploadTextureVolumeCopyData(TexturePtr tex, const TextureVolumeInfo& surf, void* data, PtrSize dataSize);
|
|
|
|
|
|
/// Upload data to a buffer.
|
|
|
- void uploadBuffer(
|
|
|
- BufferPtr buff, PtrSize offset, const TransientMemoryToken& token);
|
|
|
+ void uploadBuffer(BufferPtr buff, PtrSize offset, const TransientMemoryToken& token);
|
|
|
/// @}
|
|
|
|
|
|
/// @name Sync
|
|
|
/// @{
|
|
|
- void setTextureSurfaceBarrier(TexturePtr tex,
|
|
|
- TextureUsageBit prevUsage,
|
|
|
- TextureUsageBit nextUsage,
|
|
|
- const TextureSurfaceInfo& surf);
|
|
|
-
|
|
|
- void setTextureVolumeBarrier(TexturePtr tex,
|
|
|
- TextureUsageBit prevUsage,
|
|
|
- TextureUsageBit nextUsage,
|
|
|
- const TextureVolumeInfo& vol);
|
|
|
-
|
|
|
- void setBufferBarrier(BufferPtr buff,
|
|
|
- BufferUsageBit prevUsage,
|
|
|
- BufferUsageBit nextUsage,
|
|
|
- PtrSize offset,
|
|
|
- PtrSize size);
|
|
|
+ void setTextureSurfaceBarrier(
|
|
|
+ TexturePtr tex, TextureUsageBit prevUsage, TextureUsageBit nextUsage, const TextureSurfaceInfo& surf);
|
|
|
+
|
|
|
+ void setTextureVolumeBarrier(
|
|
|
+ TexturePtr tex, TextureUsageBit prevUsage, TextureUsageBit nextUsage, const TextureVolumeInfo& vol);
|
|
|
+
|
|
|
+ void setBufferBarrier(
|
|
|
+ BufferPtr buff, BufferUsageBit prevUsage, BufferUsageBit nextUsage, PtrSize offset, PtrSize size);
|
|
|
/// @}
|
|
|
|
|
|
/// @name Other
|