diff options
Diffstat (limited to 'source/slang/slang-parameter-binding.cpp')
| -rw-r--r-- | source/slang/slang-parameter-binding.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/source/slang/slang-parameter-binding.cpp b/source/slang/slang-parameter-binding.cpp index 07875c183..db323ff6e 100644 --- a/source/slang/slang-parameter-binding.cpp +++ b/source/slang/slang-parameter-binding.cpp @@ -1912,6 +1912,33 @@ static RefPtr<TypeLayout> processEntryPointVaryingParameter( return arrayTypeLayout; } + else if( auto meshOutputType = as<MeshOutputType>(type) ) + { + // TODO: Ellie, revisit + // Note: Bad Things will happen if we have an array input + // without a semantic already being enforced. + + // We use the first element to derive the layout for the element type + auto elementTypeLayout = processEntryPointVaryingParameter(context, meshOutputType->getElementType(), state, varLayout); + + RefPtr<ArrayTypeLayout> arrayTypeLayout = new ArrayTypeLayout(); + arrayTypeLayout->elementTypeLayout = elementTypeLayout; + arrayTypeLayout->type = arrayType; + + // TODO: Ellie, this is probably not the right place to handle this + // On GLSL the indices type is built in and as such doesn't consume + // resources. + if(!isKhronosTarget(context->getTargetRequest()) || !as<IndicesType>(type)) + { + for (auto rr : elementTypeLayout->resourceInfos) + { + // TODO: Ellie, explain why only one slot is consumed here + arrayTypeLayout->findOrAddResourceInfo(rr.kind)->count = rr.count; + } + } + + return arrayTypeLayout; + } // Ignore a bunch of types that don't make sense here... else if (auto textureType = as<TextureType>(type)) { return nullptr; } else if(auto samplerStateType = as<SamplerStateType>(type)) { return nullptr; } |
