LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::BindFlags Struct Reference

Flags for Buffer and Texture resources that describe for which purposes they will be used. More...

#include <ResourceFlags.h>

Public Types

enum  {
  VertexBuffer = (1 << 0) , IndexBuffer = (1 << 1) , ConstantBuffer = (1 << 2) , StreamOutputBuffer = (1 << 3) ,
  IndirectBuffer = (1 << 4) , Sampled = (1 << 5) , Storage = (1 << 6) , ColorAttachment = (1 << 7) ,
  DepthStencilAttachment = (1 << 8) , CombinedSampler = (1 << 9) , CopySrc = (1 << 10) , CopyDst = (1 << 11) ,
  TexelBuffer = (1 << 12)
}

Detailed Description

Flags for Buffer and Texture resources that describe for which purposes they will be used.

Remarks
Resources can be created with both input and output binding flags, but they cannot be used together when the resource is bound. See the following table for compatibility:
Binding type Binding flags
Input BindFlags::Sampled, BindFlags::CopySrc, BindFlags::VertexBuffer, BindFlags::IndexBuffer, BindFlags::ConstantBuffer, BindFlags::IndirectBuffer
Output BindFlags::Storage, BindFlags::CopyDst, BindFlags::ColorAttachment, BindFlags::DepthStencilAttachment, BindFlags::StreamOutputBuffer
See also
BufferDescriptor::bindFlags
TextureDescriptor::bindFlags
BindingDescriptor::bindFlags

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
VertexBuffer 

The resource can be used to bind a stream of vertices.

Remarks
This can only be used for Buffer resources.
See also
CommandBuffer::SetVertexBuffer
IndexBuffer 

The resource can be used to bind a stream of indices.

Remarks
This can only be used for Buffer resources.
See also
CommandBuffer::SetIndexBuffer
ConstantBuffer 

The resource can be used to bind a set of constants.

Remarks
This can only be used for Buffer resources and must not be combined with any other bind flags except for CopySrc and CopyDst.
StreamOutputBuffer 

The resource can be used to bind an output stream buffer (also referred to as "transform feedback").

Remarks
This can only be used for Buffer resources.
See also
CommandBuffer::BeginStreamOutput
IndirectBuffer 

Hint to the renderer that the resource will hold the arguments for indirect commands.

Remarks
This can only be used for Buffer resources.
See also
CommandBuffer::DrawIndirect
CommandBuffer::DrawIndexedIndirect
CommandBuffer::DispatchIndirect
Sampled 

The resource can be used to bind a buffer or texture for read access.

Remarks
This can be used for Buffer resources (e.g. samplerBuffer in GLSL, or StructuredBuffer in HLSL) and Texture resources (e.g. sampler2D in GLSL, or Texture2D in HLSL).
Storage 

The resource can be used to bind a buffer or texture for unordered read/write access.

Remarks
This can be used for Buffer resources (e.g. buffer in GLSL, or RWStructuredBuffer in HLSL) and Texture resources (e.g. image2D in GLSL, or RWTexture2D in HLSL).
See also
CommandBuffer::ResourceBarrier
PipelineLayoutDescriptor::barrierFlags
ColorAttachment 

Texture can be used as render target color attachment.

Remarks
This can only be used for Texture resources.
Note
This cannot be used together with the BindFlags::DepthStencilAttachment flag.
See also
AttachmentDescriptor::texture
AttachmentDescriptor::format
DepthStencilAttachment 

Texture can be used as render target depth-stencil attachment.

Remarks
This can only be used for Texture resources.
Note
This cannot be used together with the BindFlags::ColorAttachment flag.
See also
AttachmentDescriptor::texture
AttachmentDescriptor::format
CombinedSampler 

Specifies a resource as a combination of a Texture and Sampler (e.g. sampler2D in GLSL).

Remarks
This is only used for shader reflection and ignored by resource creation.
Note
Only supported with: OpenGL, Vulkan.
See also
ShaderResourceReflection::binding
CopySrc 

Specifies a resource can be used as source for a copy command.

See also
CommandBuffer::CopyBuffer
CommandBuffer::CopyBufferFromTexture
CommandBuffer::CopyTexture
CommandBuffer::CopyTextureFromBuffer
CopyDst 

Specifies a resource can be used as destination for a copy or fill command.

See also
CommandBuffer::CopyBuffer
CommandBuffer::CopyBufferFromTexture
CommandBuffer::CopyTexture
CommandBuffer::CopyTextureFromBuffer
CommandBuffer::FillBuffer
TexelBuffer 

Specifies a resource is bound as texel buffer.

Remarks
This is only used by the Vulkan backend at the moment to workaround the restriction that resource heaps need to know their exact descriptor types at creation time. It is not necessary to create buffers with this flag, only the pipeline layout needs to know about this flag.
See also
PipelineLayoutDescriptor::heapBindings
Note
Only required for: Vulkan
Todo
This is a workaround for the Vulkan backend and should eventually be removed.

The documentation for this struct was generated from the following file: