diff options
Diffstat (limited to 'tools/gfx/vulkan/vk-shader-object.cpp')
| -rw-r--r-- | tools/gfx/vulkan/vk-shader-object.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/tools/gfx/vulkan/vk-shader-object.cpp b/tools/gfx/vulkan/vk-shader-object.cpp index 3c452c59c..31422429b 100644 --- a/tools/gfx/vulkan/vk-shader-object.cpp +++ b/tools/gfx/vulkan/vk-shader-object.cpp @@ -321,7 +321,7 @@ void ShaderObjectImpl::writeBufferDescriptor( Offset bufferOffset, Size bufferSize) { - auto descriptorSet = context.descriptorSets[offset.bindingSet]; + auto descriptorSet = (*context.descriptorSets)[offset.bindingSet]; VkDescriptorBufferInfo bufferInfo = {}; if (buffer) @@ -359,7 +359,7 @@ void ShaderObjectImpl::writePlainBufferDescriptor( VkDescriptorType descriptorType, ArrayView<RefPtr<ResourceViewInternalBase>> resourceViews) { - auto descriptorSet = context.descriptorSets[offset.bindingSet]; + auto descriptorSet = (*context.descriptorSets)[offset.bindingSet]; Index count = resourceViews.getCount(); for (Index i = 0; i < count; ++i) @@ -398,7 +398,7 @@ void ShaderObjectImpl::writeTexelBufferDescriptor( VkDescriptorType descriptorType, ArrayView<RefPtr<ResourceViewInternalBase>> resourceViews) { - auto descriptorSet = context.descriptorSets[offset.bindingSet]; + auto descriptorSet = (*context.descriptorSets)[offset.bindingSet]; Index count = resourceViews.getCount(); for (Index i = 0; i < count; ++i) @@ -432,7 +432,7 @@ void ShaderObjectImpl::writeTextureSamplerDescriptor( VkDescriptorType descriptorType, ArrayView<CombinedTextureSamplerSlot> slots) { - auto descriptorSet = context.descriptorSets[offset.bindingSet]; + auto descriptorSet = (*context.descriptorSets)[offset.bindingSet]; Index count = slots.getCount(); for (Index i = 0; i < count; ++i) @@ -473,7 +473,7 @@ void ShaderObjectImpl::writeAccelerationStructureDescriptor( VkDescriptorType descriptorType, ArrayView<RefPtr<ResourceViewInternalBase>> resourceViews) { - auto descriptorSet = context.descriptorSets[offset.bindingSet]; + auto descriptorSet = (*context.descriptorSets)[offset.bindingSet]; Index count = resourceViews.getCount(); for (Index i = 0; i < count; ++i) @@ -511,7 +511,7 @@ void ShaderObjectImpl::writeTextureDescriptor( VkDescriptorType descriptorType, ArrayView<RefPtr<ResourceViewInternalBase>> resourceViews) { - auto descriptorSet = context.descriptorSets[offset.bindingSet]; + auto descriptorSet = (*context.descriptorSets)[offset.bindingSet]; Index count = resourceViews.getCount(); for (Index i = 0; i < count; ++i) @@ -548,7 +548,7 @@ void ShaderObjectImpl::writeSamplerDescriptor( VkDescriptorType descriptorType, ArrayView<RefPtr<SamplerStateImpl>> samplers) { - auto descriptorSet = context.descriptorSets[offset.bindingSet]; + auto descriptorSet = (*context.descriptorSets)[offset.bindingSet]; Index count = samplers.getCount(); for (Index i = 0; i < count; ++i) @@ -865,8 +865,7 @@ Result ShaderObjectImpl::allocateDescriptorSets( // we can bind all the descriptor sets to the pipeline when the // time comes. // - context.descriptorSets[context.descriptorSetCounter] = descriptorSetHandle; - context.descriptorSetCounter++; + (*context.descriptorSets).add(descriptorSetHandle); } return SLANG_OK; @@ -884,7 +883,7 @@ Result ShaderObjectImpl::bindAsParameterBlock( // not the sets for any parent object(s). // BindingOffset offset = inOffset; - offset.bindingSet = context.descriptorSetCounter; + offset.bindingSet = (uint32_t)context.descriptorSets->getCount(); offset.binding = 0; // TODO: We should also be writing to `offset.pending` here, @@ -901,7 +900,7 @@ Result ShaderObjectImpl::bindAsParameterBlock( // SLANG_RETURN_ON_FAIL(allocateDescriptorSets(encoder, context, offset, specializedLayout)); - assert(offset.bindingSet < context.descriptorSetCounter); + assert(offset.bindingSet < (uint32_t)context.descriptorSets->getCount()); SLANG_RETURN_ON_FAIL(bindAsConstantBuffer(encoder, context, offset, specializedLayout)); return SLANG_OK; |
