Skip to content

Commit 7be17d4

Browse files
authored
rename DescriptorHandle::handle to DescriptorHandle::value (#338)
1 parent 8014f6c commit 7be17d4

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

include/slang-rhi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ enum class DescriptorHandleAccess
535535
struct DescriptorHandle
536536
{
537537
DescriptorHandleType type = DescriptorHandleType::Undefined;
538-
uint64_t handle;
538+
uint64_t value;
539539

540540
explicit operator bool() const { return type != DescriptorHandleType::Undefined; }
541541
};

src/d3d12/d3d12-bindless-descriptor-set.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Result BindlessDescriptorSet::allocBufferHandle(
9090
return SLANG_E_INVALID_ARG;
9191
}
9292

93-
outHandle->handle = m_srvUavHeapOffset + slot;
93+
outHandle->value = m_srvUavHeapOffset + slot;
9494

9595
return SLANG_OK;
9696
}
@@ -129,7 +129,7 @@ Result BindlessDescriptorSet::allocTextureHandle(
129129
return SLANG_E_INVALID_ARG;
130130
}
131131

132-
outHandle->handle = m_srvUavHeapOffset + m_firstTextureHandle + slot;
132+
outHandle->value = m_srvUavHeapOffset + m_firstTextureHandle + slot;
133133

134134
return SLANG_OK;
135135
}
@@ -148,7 +148,7 @@ Result BindlessDescriptorSet::allocSamplerHandle(ISampler* sampler, DescriptorHa
148148
);
149149

150150
outHandle->type = DescriptorHandleType::Sampler;
151-
outHandle->handle = m_samplerHeapOffset + slot;
151+
outHandle->value = m_samplerHeapOffset + slot;
152152

153153
return SLANG_OK;
154154
}
@@ -170,7 +170,7 @@ Result BindlessDescriptorSet::allocAccelerationStructureHandle(
170170
);
171171

172172
outHandle->type = DescriptorHandleType::AccelerationStructure;
173-
outHandle->handle = m_srvUavHeapOffset + m_firstAccelerationStructureHandle + slot;
173+
outHandle->value = m_srvUavHeapOffset + m_firstAccelerationStructureHandle + slot;
174174

175175
return SLANG_OK;
176176
}
@@ -181,15 +181,15 @@ Result BindlessDescriptorSet::freeHandle(const DescriptorHandle& handle)
181181
{
182182
case DescriptorHandleType::Buffer:
183183
case DescriptorHandleType::RWBuffer:
184-
return m_bufferAllocator.free(handle.handle - m_srvUavHeapOffset);
184+
return m_bufferAllocator.free(handle.value - m_srvUavHeapOffset);
185185
case DescriptorHandleType::Texture:
186186
case DescriptorHandleType::RWTexture:
187-
return m_textureAllocator.free(handle.handle - m_srvUavHeapOffset - m_firstTextureHandle);
187+
return m_textureAllocator.free(handle.value - m_srvUavHeapOffset - m_firstTextureHandle);
188188
case DescriptorHandleType::Sampler:
189-
return m_samplerAllocator.free(handle.handle - m_samplerHeapOffset);
189+
return m_samplerAllocator.free(handle.value - m_samplerHeapOffset);
190190
case DescriptorHandleType::AccelerationStructure:
191191
return m_accelerationStructureAllocator.free(
192-
handle.handle - m_srvUavHeapOffset - m_firstAccelerationStructureHandle
192+
handle.value - m_srvUavHeapOffset - m_firstAccelerationStructureHandle
193193
);
194194
default:
195195
return SLANG_E_INVALID_ARG;

src/shader-object.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ Result ShaderObject::setDescriptorHandle(const ShaderOffset& offset, const Descr
327327
return SLANG_E_INVALID_ARG;
328328
}
329329

330-
::memcpy(m_data.data() + offset.uniformOffset, &handle.handle, 8);
330+
::memcpy(m_data.data() + offset.uniformOffset, &handle.value, 8);
331331

332332
incrementVersion();
333333

src/vulkan/vk-bindless-descriptor-set.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ Result BindlessDescriptorSet::allocBufferHandle(
196196
const auto& api = m_device->m_api;
197197
api.vkUpdateDescriptorSets(api.m_device, 1, &write, 0, nullptr);
198198

199-
outHandle->handle = slot;
199+
outHandle->value = slot;
200200

201201
return SLANG_OK;
202202
}
@@ -241,7 +241,7 @@ Result BindlessDescriptorSet::allocTextureHandle(
241241
const auto& api = m_device->m_api;
242242
api.vkUpdateDescriptorSets(api.m_device, 1, &write, 0, nullptr);
243243

244-
outHandle->handle = m_firstTextureHandle + slot;
244+
outHandle->value = m_firstTextureHandle + slot;
245245

246246
return SLANG_OK;
247247
}
@@ -269,7 +269,7 @@ Result BindlessDescriptorSet::allocSamplerHandle(ISampler* sampler, DescriptorHa
269269
api.vkUpdateDescriptorSets(api.m_device, 1, &write, 0, nullptr);
270270

271271
outHandle->type = DescriptorHandleType::Sampler;
272-
outHandle->handle = slot;
272+
outHandle->value = slot;
273273

274274
return SLANG_OK;
275275
}
@@ -302,7 +302,7 @@ Result BindlessDescriptorSet::allocAccelerationStructureHandle(
302302
api.vkUpdateDescriptorSets(api.m_device, 1, &write, 0, nullptr);
303303

304304
outHandle->type = DescriptorHandleType::AccelerationStructure;
305-
outHandle->handle = m_firstAccelerationStructureHandle + slot;
305+
outHandle->value = m_firstAccelerationStructureHandle + slot;
306306

307307
return SLANG_OK;
308308
}
@@ -313,14 +313,14 @@ Result BindlessDescriptorSet::freeHandle(const DescriptorHandle& handle)
313313
{
314314
case DescriptorHandleType::Buffer:
315315
case DescriptorHandleType::RWBuffer:
316-
return m_bufferAllocator.free(handle.handle);
316+
return m_bufferAllocator.free(handle.value);
317317
case DescriptorHandleType::Texture:
318318
case DescriptorHandleType::RWTexture:
319-
return m_textureAllocator.free(handle.handle - m_firstTextureHandle);
319+
return m_textureAllocator.free(handle.value - m_firstTextureHandle);
320320
case DescriptorHandleType::Sampler:
321-
return m_samplerAllocator.free(handle.handle);
321+
return m_samplerAllocator.free(handle.value);
322322
case DescriptorHandleType::AccelerationStructure:
323-
return m_accelerationStructureAllocator.free(handle.handle - m_firstAccelerationStructureHandle);
323+
return m_accelerationStructureAllocator.free(handle.value - m_firstAccelerationStructureHandle);
324324
default:
325325
return SLANG_E_INVALID_ARG;
326326
}

0 commit comments

Comments
 (0)