diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-10-11 14:14:08 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-11 14:14:08 -0400 |
| commit | 9c17d0be79834a8ebe2888aed8905bae355cb674 (patch) | |
| tree | f0ebf7d256f43af686f63c6375f2a53bd12dc1a3 /tools/render-test/cpu-memory-binding.h | |
| parent | deeb8647012fc6362f1bb33842cf0842e16f13b7 (diff) | |
Support for unbounded array of arrays (#1078)
* WIP: Unsized arrays on CPU.
* unbounded-array-of-array working on CPU.
* Remove some left over comments.
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(); |
