@@ -33,7 +33,9 @@ struct TransferLoop
33
33
34
34
void copyLoop (uint baseInvocationIndex, uint propertyId, TransferRequest transferRequest, uint dispatchSize)
35
35
{
36
- uint lastInvocation = min (transferRequest.elementCount, globals.endOffset);
36
+ uint64_t elementCount = uint64_t (transferRequest.elementCount32)
37
+ | uint64_t (transferRequest.elementCountExtra) << 32 ;
38
+ uint lastInvocation = min (elementCount, globals.endOffset);
37
39
for (uint invocationIndex = globals.beginOffset + baseInvocationIndex; invocationIndex < lastInvocation; invocationIndex += dispatchSize)
38
40
{
39
41
iteration (propertyId, transferRequest.propertySize, transferRequest.srcAddr, transferRequest.dstAddr, invocationIndex);
@@ -106,12 +108,13 @@ void main(uint32_t3 dispatchId)
106
108
transferRequest.dstIndexAddr = vk::RawBufferLoad<uint64_t>(globals.transferCommandsAddress + sizeof (uint64_t) * 3 );
107
109
// Remaining elements are part of the same bitfield
108
110
// TODO: Do this only using raw buffer load?
109
- uint64_t bitfieldType = vk::RawBufferLoad<uint64_t>(globals.transferCommandsAddress + sizeof (uint64_t) * 4 );
110
- transferRequest.elementCount = bitfieldType;
111
- transferRequest.propertySize = bitfieldType >> 35 ;
112
- transferRequest.fill = bitfieldType >> (35 + 24 );
113
- transferRequest.srcIndexSizeLog2 = bitfieldType >> (35 + 24 + 1 );
114
- transferRequest.dstIndexSizeLog2 = bitfieldType >> (35 + 24 + 1 + 2 );
111
+ uint2 bitfieldType = vk::RawBufferLoad<uint2 >(globals.transferCommandsAddress + sizeof (uint64_t) * 4 );
112
+ transferRequest.elementCount32 = bitfieldType;
113
+ transferRequest.elementCountExtra = bitfieldType;
114
+ transferRequest.propertySize = bitfieldType >> 3 ;
115
+ transferRequest.fill = bitfieldType >> (3 + 24 );
116
+ transferRequest.srcIndexSizeLog2 = bitfieldType >> (3 + 24 + 1 );
117
+ transferRequest.dstIndexSizeLog2 = bitfieldType >> (3 + 24 + 1 + 2 );
115
118
116
119
const uint dispatchSize = nbl::hlsl::device_capabilities_traits<device_capabilities>::maxOptimallyResidentWorkgroupInvocations;
117
120
const bool fill = transferRequest.fill == 1 ;
0 commit comments