diff options
Diffstat (limited to 'tools/render-test/cpu-memory-binding.h')
| -rw-r--r-- | tools/render-test/cpu-memory-binding.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/render-test/cpu-memory-binding.h b/tools/render-test/cpu-memory-binding.h index 36bc15c6b..8ca8e0681 100644 --- a/tools/render-test/cpu-memory-binding.h +++ b/tools/render-test/cpu-memory-binding.h @@ -43,6 +43,8 @@ struct CPUMemoryBinding slang::VariableLayoutReflection* getParameterByName(const char* name); slang::VariableLayoutReflection* getEntryPointParameterByName(const char* name); + /// Finds which buffer starts at the ptr index + Slang::Index findBufferIndex(const void* ptr) const; Location find(const char* name); @@ -50,6 +52,15 @@ struct CPUMemoryBinding SlangResult setNewBuffer(const Location& location, const void* initialData, size_t sizeInBytes, Buffer& outBuffer); SlangResult setObject(const Location& location, void* object); SlangResult setInplace(const Location& location, const void* data, size_t sizeInBytes); + /// Initialize memory with a 'sensible' value based on type. Pointer types become null. + SlangResult initValue(slang::TypeLayoutReflection* typeLayout, void* dst); + SlangResult initValue(const Location& location) { return initValue(location.getTypeLayout(), location.getPtr()); } + + /// Set the size of a *non fixed size* array at location. + /// A non fixed size array is reflected as having a count of 0 elements. + /// Only returns a buffer in outBuffer if a new buffer is created. + SlangResult setArrayCount(const Location& location, int count, Buffer& outBuffer); + SlangResult init(slang::ShaderReflection* reflection, int entryPointIndex); CPUMemoryBinding(); |
