|
@@ -1520,12 +1520,6 @@ bool SpirvEmitter::validateVKAttributes(const NamedDecl *decl) {
|
|
}
|
|
}
|
|
|
|
|
|
if (decl->getAttr<VKInputAttachmentIndexAttr>()) {
|
|
if (decl->getAttr<VKInputAttachmentIndexAttr>()) {
|
|
- if (!spvContext.isPS()) {
|
|
|
|
- emitError("SubpassInput(MS) only allowed in pixel shader",
|
|
|
|
- decl->getLocation());
|
|
|
|
- success = false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if (!decl->isExternallyVisible()) {
|
|
if (!decl->isExternallyVisible()) {
|
|
emitError("SubpassInput(MS) must be externally visible",
|
|
emitError("SubpassInput(MS) must be externally visible",
|
|
decl->getLocation());
|
|
decl->getLocation());
|
|
@@ -1795,6 +1789,14 @@ void SpirvEmitter::doVarDecl(const VarDecl *decl) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (decl->getAttr<VKInputAttachmentIndexAttr>()) {
|
|
|
|
+ if (!spvContext.isPS()) {
|
|
|
|
+ // SubpassInput(MS) variables are only allowed in pixel shaders. In this
|
|
|
|
+ // case, we avoid create the declaration because it should not be used.
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
SpirvVariable *var = nullptr;
|
|
SpirvVariable *var = nullptr;
|
|
|
|
|
|
// The contents in externally visible variables can be updated via the
|
|
// The contents in externally visible variables can be updated via the
|
|
@@ -3860,6 +3862,11 @@ SpirvEmitter::processGetSamplePosition(const CXXMemberCallExpr *expr) {
|
|
|
|
|
|
SpirvInstruction *
|
|
SpirvInstruction *
|
|
SpirvEmitter::processSubpassLoad(const CXXMemberCallExpr *expr) {
|
|
SpirvEmitter::processSubpassLoad(const CXXMemberCallExpr *expr) {
|
|
|
|
+ if (!spvContext.isPS()) {
|
|
|
|
+ emitError("SubpassInput(MS) only allowed in pixel shader",
|
|
|
|
+ expr->getExprLoc());
|
|
|
|
+ return nullptr;
|
|
|
|
+ }
|
|
const auto *object = expr->getImplicitObjectArgument()->IgnoreParens();
|
|
const auto *object = expr->getImplicitObjectArgument()->IgnoreParens();
|
|
SpirvInstruction *sample =
|
|
SpirvInstruction *sample =
|
|
expr->getNumArgs() == 1 ? doExpr(expr->getArg(0)) : nullptr;
|
|
expr->getNumArgs() == 1 ? doExpr(expr->getArg(0)) : nullptr;
|