Add assertion that samplers cannot be subpass inputs.
Based on some code archaeology, we believe that textures (not samplers) should always be used for subpass inputs. Change-Id: Ida461e20f3b4f236918e72076e9c008ac280b8ef Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529609 Commit-Queue: John Stiles <johnstiles@google.com> Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
This commit is contained in:
parent
abf84fd342
commit
ad235abc1b
@ -889,14 +889,14 @@ SpvId SPIRVCodeGenerator::getType(const Type& rawType, const MemoryLayout& layou
|
||||
break;
|
||||
}
|
||||
case Type::TypeKind::kSampler: {
|
||||
if (type->dimensions() != SpvDimSubpassData) {
|
||||
// Subpass inputs should use the Texture type, not a Sampler.
|
||||
SkASSERT(type->dimensions() != SpvDimSubpassData);
|
||||
if (type->dimensions() == SpvDimBuffer) {
|
||||
fCapabilities |= 1ULL << SpvCapabilitySampledBuffer;
|
||||
}
|
||||
SpvId imageTypeId = this->getType(type->textureType(), layout);
|
||||
this->writeInstruction(SpvOpTypeSampledImage, result, imageTypeId,
|
||||
fConstantBuffer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Type::TypeKind::kSeparateSampler: {
|
||||
|
Loading…
Reference in New Issue
Block a user