Skip to content

Commit 7a354ea

Browse files
Revert "Refactoring accessor usage in examples"
1 parent 69f7f90 commit 7a354ea

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

10_CountingSort/app_resources/prefix_sum_shader.comp.hlsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ groupshared uint32_t sdata[BucketCount];
1111

1212
struct SharedAccessor
1313
{
14-
void get(const uint32_t index, NBL_REF_ARG(uint32_t) value)
14+
uint32_t get(const uint32_t index)
1515
{
16-
value = sdata[index];
16+
return sdata[index];
1717
}
1818

1919
void set(const uint32_t index, const uint32_t value)
@@ -46,7 +46,7 @@ void main(uint32_t3 ID : SV_GroupThreadID, uint32_t3 GroupID : SV_GroupID)
4646
params.minimum = pushData.minimum;
4747
params.maximum = pushData.maximum;
4848

49-
using Counter = nbl::hlsl::sort::counting < WorkgroupSize, BucketCount, PtrAccessor, PtrAccessor, PtrAccessor, SharedAccessor, PtrAccessor::type_t>;
49+
using Counter = nbl::hlsl::sort::counting < WorkgroupSize, BucketCount, PtrAccessor, PtrAccessor, PtrAccessor, SharedAccessor>;
5050
Counter counter = Counter::create(nbl::hlsl::glsl::gl_WorkGroupID().x);
5151

5252
const Ptr input_ptr = Ptr::create(pushData.inputKeyAddress);

10_CountingSort/app_resources/scatter_shader.comp.hlsl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ groupshared uint32_t sdata[BucketCount];
1111

1212
struct SharedAccessor
1313
{
14-
void get(const uint32_t index, NBL_REF_ARG(uint32_t) value)
14+
uint32_t get(const uint32_t index)
1515
{
16-
value = sdata[index];
16+
return sdata[index];
1717
}
1818

1919
void set(const uint32_t index, const uint32_t value)
@@ -34,7 +34,6 @@ struct SharedAccessor
3434

3535
struct DoublePtrAccessor
3636
{
37-
using type_t = uint32_t;
3837
static DoublePtrAccessor create(const PtrAccessor input, const PtrAccessor output)
3938
{
4039
DoublePtrAccessor accessor;
@@ -43,9 +42,9 @@ struct DoublePtrAccessor
4342
return accessor;
4443
}
4544

46-
void get(const uint64_t index, NBL_REF_ARG(uint32_t) value)
45+
uint32_t get(const uint64_t index)
4746
{
48-
input.get(index, value);
47+
return input.get(index);
4948
}
5049

5150
void set(const uint64_t index, const uint32_t value)
@@ -70,7 +69,7 @@ void main(uint32_t3 ID : SV_GroupThreadID, uint32_t3 GroupID : SV_GroupID)
7069
params.minimum = pushData.minimum;
7170
params.maximum = pushData.maximum;
7271

73-
using Counter = nbl::hlsl::sort::counting < WorkgroupSize, BucketCount, DoublePtrAccessor, DoublePtrAccessor, PtrAccessor, SharedAccessor, DoublePtrAccessor::type_t>;
72+
using Counter = nbl::hlsl::sort::counting < WorkgroupSize, BucketCount, DoublePtrAccessor, DoublePtrAccessor, PtrAccessor, SharedAccessor>;
7473
Counter counter = Counter::create(nbl::hlsl::glsl::gl_WorkGroupID().x);
7574

7675
const Ptr input_key_ptr = Ptr::create(pushData.inputKeyAddress);

23_ArithmeticUnitTest/app_resources/testWorkgroup.comp.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ groupshared uint32_t scratch[ScratchSz];
1717
template<uint16_t offset>
1818
struct ScratchProxy
1919
{
20-
void get(const uint32_t ix, NBL_REF_ARG(uint32_t) value)
20+
uint32_t get(const uint32_t ix)
2121
{
22-
value = scratch[ix+offset];
22+
return scratch[ix+offset];
2323
}
2424
void set(const uint32_t ix, const uint32_t value)
2525
{

0 commit comments

Comments
 (0)