Skip to content

Commit 279c220

Browse files
committed
Temp fix for last compilation issue
1 parent 1707158 commit 279c220

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

include/nbl/builtin/hlsl/property_pool/copy.comp.hlsl

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ struct TransferLoop
3333

3434
void copyLoop(uint baseInvocationIndex, uint propertyId, TransferRequest transferRequest, uint dispatchSize)
3535
{
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);
3739
for (uint invocationIndex = globals.beginOffset + baseInvocationIndex; invocationIndex < lastInvocation; invocationIndex += dispatchSize)
3840
{
3941
iteration(propertyId, transferRequest.propertySize, transferRequest.srcAddr, transferRequest.dstAddr, invocationIndex);
@@ -106,12 +108,13 @@ void main(uint32_t3 dispatchId)
106108
transferRequest.dstIndexAddr = vk::RawBufferLoad<uint64_t>(globals.transferCommandsAddress + sizeof(uint64_t) * 3);
107109
// Remaining elements are part of the same bitfield
108110
// 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);
115118

116119
const uint dispatchSize = nbl::hlsl::device_capabilities_traits<device_capabilities>::maxOptimallyResidentWorkgroupInvocations;
117120
const bool fill = transferRequest.fill == 1;

include/nbl/builtin/hlsl/property_pool/transfer.hlsl

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,19 @@ struct TransferRequest
1515
uint64_t dstAddr;
1616
uint64_t srcIndexAddr; // IOTA default
1717
uint64_t dstIndexAddr; // IOTA default
18-
uint64_t elementCount : 35; // allow up to 64GB IGPUBuffers
19-
uint64_t propertySize : 24; // all the leftover bits (just use bytes now)
20-
uint64_t fill : 1;
21-
// 0=uint8, 1=uint16, 2=uint32, 3=uint64
22-
uint64_t srcIndexSizeLog2 : 2;
23-
uint64_t dstIndexSizeLog2 : 2;
18+
// TODO: go back to this ideal layout when things work
19+
//uint64_t elementCount : 35; // allow up to 64GB IGPUBuffers
20+
//uint64_t propertySize : 24; // all the leftover bits (just use bytes now)
21+
//uint64_t fill : 1;
22+
//// 0=uint8, 1=uint16, 2=uint32, 3=uint64
23+
//uint64_t srcIndexSizeLog2 : 2;
24+
//uint64_t dstIndexSizeLog2 : 2;
25+
uint32_t elementCount32; // 32 first bits
26+
uint32_t elementCountExtra : 3; // 3 last bits
27+
uint32_t propertySize : 24;
28+
uint32_t fill: 1;
29+
uint32_t srcIndexSizeLog2 : 2;
30+
uint32_t dstIndexSizeLog2 : 2;
2431
};
2532

2633
struct GlobalPushContants

0 commit comments

Comments
 (0)