Nameless Engine
|
#include <ShaderResource.h>
Public Member Functions | |
size_t | getOriginalResourceSizeInBytes () const |
![]() | |
virtual std::optional< Error > | changeUsedPipelines (const std::unordered_set< Pipeline * > &pipelinesToUse)=0 |
std::string | getResourceName () const |
Protected Member Functions | |
ShaderCpuWriteResource (const std::string &sResourceName, size_t iOriginalResourceSizeInBytes, const std::function< void *()> &onStartedUpdatingResource, const std::function< void()> &onFinishedUpdatingResource) | |
![]() | |
ShaderResourceBase (const std::string &sResourceName) | |
virtual std::optional< Error > | onAfterAllPipelinesRefreshedResources ()=0 |
Protected Attributes | |
std::function< void *()> | onStartedUpdatingResource |
std::function< void()> | onFinishedUpdatingResource |
size_t | iOriginalResourceSizeInBytes = 0 |
Friends | |
class | ShaderCpuWriteResourceManager |
References a single (non-array) shader resource (that is written in a shader file) that has CPU write access available (can be updated from the CPU side).
|
protected |
Constructs not fully initialized resource.
sResourceName | Name of the resource we are referencing (should be exactly the same as the resource name written in the shader file we are referencing). |
iOriginalResourceSizeInBytes | Original size of the resource (not padded). |
onStartedUpdatingResource | Function that will be called when started updating resource data. Function returns pointer to data of the specified resource data size that needs to be copied into the resource. |
onFinishedUpdatingResource | Function that will be called when finished updating (usually used for unlocking resource data mutex). |
|
inline |
Returns original size of the resource (not padded).
|
protected |
Original size of the resource (not padded).
|
protected |
Function to call when finished updating (usually used for unlocking resource data mutex).
|
protected |
Function used to update resource data. Returns pointer to data of size iOriginalResourceSizeInBytes that needs to be copied into resource data storage (GPU resource).