diff options
Diffstat (limited to 'source/slang/slang-emit-spirv.cpp')
| -rw-r--r-- | source/slang/slang-emit-spirv.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp index 376a828cd..b9627e1ee 100644 --- a/source/slang/slang-emit-spirv.cpp +++ b/source/slang/slang-emit-spirv.cpp @@ -6848,15 +6848,14 @@ struct SPIRVEmitContext : public SourceEmitterBase, public SPIRVEmitSharedContex { baseStructType = as<IRStructType>(ptrType->getValueType()); baseId = getID(ensureInst(base)); + SLANG_ASSERT( + as<IRPtrTypeBase>(fieldAddress->getFullType())->getAddressSpace() == + ptrType->getAddressSpace() && + "field_address requires base and result to have same address space."); } else { - baseStructType = as<IRStructType>(base->getDataType()); - - auto structPtrType = builder.getPtrType(baseStructType); - auto varInst = emitOpVariable(parent, nullptr, structPtrType, SpvStorageClassFunction); - emitOpStore(parent, nullptr, varInst, base); - baseId = getID(varInst); + SLANG_UNEXPECTED("field_address requires base to be an address."); } SLANG_ASSERT(baseStructType && "field_address requires base to be a struct."); auto fieldId = emitIntConstant( |
