summaryrefslogtreecommitdiffstats
path: root/tools/render-test/cpu-compute-util.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-10-11 14:14:08 -0400
committerGitHub <noreply@github.com>2019-10-11 14:14:08 -0400
commit9c17d0be79834a8ebe2888aed8905bae355cb674 (patch)
treef0ebf7d256f43af686f63c6375f2a53bd12dc1a3 /tools/render-test/cpu-compute-util.cpp
parentdeeb8647012fc6362f1bb33842cf0842e16f13b7 (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-compute-util.cpp')
-rw-r--r--tools/render-test/cpu-compute-util.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/tools/render-test/cpu-compute-util.cpp b/tools/render-test/cpu-compute-util.cpp
index 688e6b254..ef5755275 100644
--- a/tools/render-test/cpu-compute-util.cpp
+++ b/tools/render-test/cpu-compute-util.cpp
@@ -191,9 +191,24 @@ static CPUComputeUtil::Resource* _newOneTexture2D(int elemCount)
const auto kind = typeLayout->getKind();
switch (kind)
{
- case slang::TypeReflection::Kind::Vector:
- case slang::TypeReflection::Kind::Matrix:
case slang::TypeReflection::Kind::Array:
+ {
+ auto elementCount = int(typeLayout->getElementCount());
+ if (elementCount == 0)
+ {
+ if (srcEntry.type == ShaderInputType::Array)
+ {
+ // We need to set the size
+ CPUMemoryBinding::Buffer buffer;
+ SLANG_RETURN_ON_FAIL(binding.setArrayCount(location, srcEntry.arrayDesc.size, buffer));
+ }
+ break;
+ }
+ SLANG_RETURN_ON_FAIL(binding.setInplace(location, srcEntry.bufferData.getBuffer(), srcEntry.bufferData.getCount() * sizeof(unsigned int)));
+ break;
+ }
+ case slang::TypeReflection::Kind::Vector:
+ case slang::TypeReflection::Kind::Matrix:
case slang::TypeReflection::Kind::Scalar:
case slang::TypeReflection::Kind::Struct:
{