KhronosGroup / SPIRV-Registry

SPIR-V specs
109 stars 72 forks source link

NonSemantic.Shader.DebugInfo.100 & TypeVector sizes #249

Closed LU-JOHN closed 3 months ago

LU-JOHN commented 4 months ago

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.

LU-JOHN commented 3 months ago

Issue fixed by calculating "Memory Size" with (element size)*(bit_ceil(# elements)). "Memory Size" field is not needed.

LU-JOHN commented 3 months ago

"Memory Size" field not added.

bashbaug commented 3 months ago

@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?