This is an archive of the discontinued LLVM Phabricator instance.

[HLSL] support RWByteAddressBuffer.
Needs ReviewPublic

Authored by python3kgae on Oct 27 2022, 9:01 PM.

Details

Summary

Only RWByteAddressBuffer::Load is supported in this PR.
Implement Load by cast handle to uint8_t ptr first.
Then add the byte address to get target address.
Cast the target address to target type ptr and deref.

struct RWByteAddressBuffer {

void *handle;
template<typename T> Load(uint i) {
   return *((T*)(((uint8_t*)handle) + i));
}

};

Allow ref/ptr use for HLSLExternalSemaSource to skip the check when Location is invalid.

Also add HLSLResourceHelper to share code for RWByteAddressBuffer and RWBuffer.

Diff Detail

Event Timeline

python3kgae created this revision.Oct 27 2022, 9:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2022, 9:01 PM
Herald added a subscriber: Anastasia. · View Herald Transcript
python3kgae requested review of this revision.Oct 27 2022, 9:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2022, 9:01 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Rebase and update test.