Closed LU-JOHN closed 3 months ago
Issue fixed by calculating "Memory Size" with (element size)*(bit_ceil(# elements)). "Memory Size" field is not needed.
"Memory Size" field not added.
@MrSidims in a prior call you asked that a description for how to calculate the memory size be documented somewhere, perhaps in the DebugInfo spec. Do you want to track that in a separate issue? Or, should this issue be reopened, and only closed once the right documentation is in place?
The NonSemantic.Shader.DebugInfo.100 describes DebugTypeVector as having Base Type and Component Count fields. We would like to add a Memory Size field to record the amount of space in bits is needed for the vector in memory.
transTypeVector() in SPIRVToLLVMDbgTran.cpp already has a FIXME that needs this information to cleanly know that 3 and 4-element vectors take the same amount of memory space in OpenCL.
This Memory Size field is also needed because Clang can generate debug info that accesses this padding space. Without a fix LLVM IR validation will report an access that is outside of the variable.