class GpuParameterSet

Contains descriptions for all parameters in a set of programs (ones for each stage) and allows you to write and read those parameters.

All parameter values are stored internally on the CPU, and are only submitted to the GPU once the parameters are bound to the pipeline.

Public

Methods

~GpuParameterSet

~GpuParameterSet() noexcept

staticCreate

static SPtr<GpuParameterSet> Create(const SPtr<GpuPipelineParameterSetLayout> &parameterSetLayout, u32 setIndex = 0)

Creates a new set of GPU parameters using an object describing the parameters.

parameterSetLayout
Description of GPU parameters for a specific GPU pipeline state.
setIndex
Index of the parameter set within the pipeline.

~TGpuParameterSet<IsRenderProxy>

virtual ~TGpuParameterSet<IsRenderProxy>()

GetStructParameter

void GetStructParameter(const StringView &name, TGpuParameterStruct<IsRenderProxy> &output) const

GetSampledTextureParameter

void GetSampledTextureParameter(const StringView &name, TGpuParameterSampledTexture<IsRenderProxy> &output) const

GetStorageTextureParameter

void GetStorageTextureParameter(const StringView &name, TGpuParameterStorageTexture<IsRenderProxy> &output) const

GetStorageBufferParameter

void GetStorageBufferParameter(const StringView &name, TGpuParameterStorageBuffer<IsRenderProxy> &output) const

GetUniformBufferParameter

void GetUniformBufferParameter(const StringView &name, TGpuParameterUniformBuffer<IsRenderProxy> &output) const

GetSamplerStateParameter

void GetSamplerStateParameter(const StringView &name, TGpuParameterSampler<IsRenderProxy> &output) const

TryGetStructParameter

bool TryGetStructParameter(const StringView &name, TGpuParameterStruct<IsRenderProxy> &output) const

TryGetSampledTextureParameter

bool TryGetSampledTextureParameter(const StringView &name, TGpuParameterSampledTexture<IsRenderProxy> &output) const

TryGetStorageTextureParameter

bool TryGetStorageTextureParameter(const StringView &name, TGpuParameterStorageTexture<IsRenderProxy> &output) const

TryGetStorageBufferParameter

bool TryGetStorageBufferParameter(const StringView &name, TGpuParameterStorageBuffer<IsRenderProxy> &output) const

TryGetUniformBufferParameter

bool TryGetUniformBufferParameter(const StringView &name, TGpuParameterUniformBuffer<IsRenderProxy> &output) const

TryGetSamplerStateParameter

bool TryGetSamplerStateParameter(const StringView &name, TGpuParameterSampler<IsRenderProxy> &output) const

GetUniformBuffer

UniformBufferType GetUniformBuffer(u32 slot, u32 arrayIndex = 0) const

Gets a uniform buffer from the specified slot/array index combination.

GetSampledTexture

TextureType GetSampledTexture(u32 slot, u32 arrayIndex = 0) const

Gets a texture bound to the specified slot/array index combination.

GetStorageTexture

TextureType GetStorageTexture(u32 slot, u32 arrayIndex = 0) const

Gets a storage texture bound to the specified slot/array index combination.

GetStorageBuffer

BufferType GetStorageBuffer(u32 slot, u32 arrayIndex = 0) const

Gets a buffer bound to the specified slot/array index combination.

GetSamplerState

SPtr<SamplerState> GetSamplerState(u32 slot, u32 arrayIndex = 0) const

Gets a sampler state bound to the specified slot/array index combination.

GetTextureSurface

const TextureSurface &GetTextureSurface(u32 slot, u32 arrayIndex = 0) const

Gets information that determines which texture surfaces to bind as a sampled texture parameter.

GetStorageTextureSurface

const TextureSurface &GetStorageTextureSurface(u32 slot, u32 arrayIndex = 0) const

Gets information that determines which texture surfaces to bind as a storage texture parameter.

SetUniformBuffer

virtual bool SetUniformBuffer(u32 slot, const UniformBufferType &buffer, u32 arrayIndex = 0, u32 offset = 0)

Sets an uniform buffer at the specified slot.

It is up to the caller to guarantee the provided buffer matches uniform descriptor for this slot.

slot
Slot at which to bind the buffer, as defined by the pipeline GPU program.
buffer
Buffer to bind.
arrayIndex
In case the bind point represents an array, index to bind the buffer to.
offset
Dynamic offset in the buffer, at which the to start reading the buffer.

Returns: Returns true if the operation succeeded, otherwise logs and errors and returns false.

TrySetUniformBuffer

bool TrySetUniformBuffer(const StringView &name, const UniformBufferType &uniformBuffer, u32 arrayIndex = 0, u32 offset = 0)

Equivalent to SetUniformBuffer(const String & , const UniformBufferType & , u32, u32), but doesn't warn if the parameter cannot be found.

Return true if the parameter was found.

SetSampledTexture

virtual bool SetSampledTexture(u32 slot, const TextureType &texture, const TextureSurface &surface = TextureSurface::kComplete, u32 arrayIndex = 0)

Sets a texture at the specified slot.

Returns true if the operation succeeded, otherwise logs and errors and returns false.

SetStorageTexture

virtual bool SetStorageTexture(u32 slot, const TextureType &texture, const TextureSurface &surface, u32 arrayIndex = 0)

Sets a storage texture at the specified slot.

Returns true if the operation succeeded, otherwise logs and errors and returns false.

SetStorageBuffer

virtual bool SetStorageBuffer(u32 slot, const BufferType &buffer, u32 arrayIndex = 0, GpuBufferViewInformation view = GpuBufferViewInformation())

Sets a storage buffer at the specified slot combination.

slot
Slot at which to bind the buffer, as defined by the pipeline GPU program.
buffer
Buffer to bind.
arrayIndex
In case the bind point represents an array, index to bind the buffer to.
view
Optional view information that controls how is the buffer viewed when bound to the pipeline.

Returns: Returns true if the operation succeeded, otherwise logs and errors and returns false.

SetSamplerState

virtual bool SetSamplerState(u32 slot, const SPtr<SamplerState> &sampler, u32 arrayIndex = 0)

Sets a sampler state at the specified slot.

Returns true if the operation succeeded, otherwise logs and errors and returns false.

Internal

Methods

MarkRenderProxyDataDirtyInternal

void MarkRenderProxyDataDirtyInternal() override

Marks the main thread object as dirty, causing it to sync its contents with its render thread counterpart.

MarkResourcesDirtyInternal

void MarkResourcesDirtyInternal() override

Marks the resource dependencies list as dirty and schedules it for rebuild.

Protected

Constructors

GpuParameterSet

GpuParameterSet(const SPtr<GpuPipelineParameterSetLayout> &parameterSetLayout, u32 setIndex)

Methods

GetSelf

SPtr<GpuParameterSet> GetSelf() const override

CreateRenderProxy

SPtr<render::RenderProxy> CreateRenderProxy() const override

Creates an object that contains render thread specific data and methods for this object.

Can be null if such object is not required.

CreateRenderProxySyncPacket

RenderProxySyncPacket *CreateRenderProxySyncPacket(FrameAllocator &allocator, u32 flags) override

Creates a data packet that will be used for syncing the core object with it's render proxy.

Caller must free the retrieved packet using the provided allocator when done using it.

GetListenerResources

void GetListenerResources(Vector<HResource> &resources) override

Retrieves all the resources that the class depends on.

NotifyResourceLoaded

void NotifyResourceLoaded(const HResource &resource) override

Called when a resource has been fully loaded.

NotifyResourceChanged

void NotifyResourceChanged(const HResource &resource) override

Called when the internal resource the resource handle is pointing to changes.

Fields

mUniformBufferData

UniformBufferData * mUniformBufferData

mSampledTextureData

TextureData * mSampledTextureData

mStorageTextureData

TextureData * mStorageTextureData

mStorageBufferData

StorageBufferData * mStorageBufferData

mSamplerStates

SPtr<SamplerState> * mSamplerStates