Skip to content

Commit

Permalink
Respect the bind point supplied to vkCmdPushDescriptorSets
Browse files Browse the repository at this point in the history
  • Loading branch information
etang-cw committed May 12, 2023
1 parent fbaba84 commit 9612d76
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 87 deletions.
2 changes: 1 addition & 1 deletion MoltenVK/MoltenVK/Commands/MVKCmdPipeline.mm
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@
}

void MVKCmdPushDescriptorSet::encode(MVKCommandEncoder* cmdEncoder) {
_pipelineLayout->pushDescriptorSet(cmdEncoder, _descriptorWrites.contents(), _set);
_pipelineLayout->pushDescriptorSet(cmdEncoder, _pipelineBindPoint, _descriptorWrites.contents(), _set);
}

MVKCmdPushDescriptorSet::~MVKCmdPushDescriptorSet() {
Expand Down
10 changes: 10 additions & 0 deletions MoltenVK/MoltenVK/GPUObjects/MVKDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,15 @@ class MVKDescriptorSetLayoutBinding : public MVKBaseDeviceObject {

/** Encodes the descriptors in the descriptor set that are specified by this layout, */
void bind(MVKCommandEncoder* cmdEncoder,
VkPipelineBindPoint pipelineBindPoint,
MVKDescriptorSet* descSet,
MVKShaderResourceBinding& dslMTLRezIdxOffsets,
MVKArrayRef<uint32_t> dynamicOffsets,
uint32_t& dynamicOffsetIndex);

/** Encodes this binding layout and the specified descriptor on the specified command encoder immediately. */
void push(MVKCommandEncoder* cmdEncoder,
VkPipelineBindPoint pipelineBindPoint,
uint32_t& dstArrayElement,
uint32_t& descriptorCount,
uint32_t& descriptorsPushed,
Expand Down Expand Up @@ -207,6 +209,7 @@ class MVKDescriptor : public MVKBaseObject {

/** Encodes this descriptor (based on its layout binding index) on the the command encoder. */
virtual void bind(MVKCommandEncoder* cmdEncoder,
VkPipelineBindPoint pipelineBindPoint,
MVKDescriptorSetLayoutBinding* mvkDSLBind,
uint32_t elementIndex,
bool stages[],
Expand Down Expand Up @@ -273,6 +276,7 @@ class MVKBufferDescriptor : public MVKDescriptor {

public:
void bind(MVKCommandEncoder* cmdEncoder,
VkPipelineBindPoint pipelineBindPoint,
MVKDescriptorSetLayoutBinding* mvkDSLBind,
uint32_t elementIndex,
bool stages[],
Expand Down Expand Up @@ -362,6 +366,7 @@ class MVKInlineUniformBlockDescriptor : public MVKDescriptor {
VkDescriptorType getDescriptorType() override { return VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT; }

void bind(MVKCommandEncoder* cmdEncoder,
VkPipelineBindPoint pipelineBindPoint,
MVKDescriptorSetLayoutBinding* mvkDSLBind,
uint32_t elementIndex,
bool stages[],
Expand Down Expand Up @@ -411,6 +416,7 @@ class MVKImageDescriptor : public MVKDescriptor {

public:
void bind(MVKCommandEncoder* cmdEncoder,
VkPipelineBindPoint pipelineBindPoint,
MVKDescriptorSetLayoutBinding* mvkDSLBind,
uint32_t elementIndex,
bool stages[],
Expand Down Expand Up @@ -491,6 +497,7 @@ class MVKSamplerDescriptorMixin {

protected:
void bind(MVKCommandEncoder* cmdEncoder,
VkPipelineBindPoint pipelineBindPoint,
MVKDescriptorSetLayoutBinding* mvkDSLBind,
uint32_t elementIndex,
bool stages[],
Expand Down Expand Up @@ -538,6 +545,7 @@ class MVKSamplerDescriptor : public MVKDescriptor, public MVKSamplerDescriptorMi
VkDescriptorType getDescriptorType() override { return VK_DESCRIPTOR_TYPE_SAMPLER; }

void bind(MVKCommandEncoder* cmdEncoder,
VkPipelineBindPoint pipelineBindPoint,
MVKDescriptorSetLayoutBinding* mvkDSLBind,
uint32_t elementIndex,
bool stages[],
Expand Down Expand Up @@ -585,6 +593,7 @@ class MVKCombinedImageSamplerDescriptor : public MVKImageDescriptor, public MVKS
VkDescriptorType getDescriptorType() override { return VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; }

void bind(MVKCommandEncoder* cmdEncoder,
VkPipelineBindPoint pipelineBindPoint,
MVKDescriptorSetLayoutBinding* mvkDSLBind,
uint32_t elementIndex,
bool stages[],
Expand Down Expand Up @@ -630,6 +639,7 @@ class MVKTexelBufferDescriptor : public MVKDescriptor {

public:
void bind(MVKCommandEncoder* cmdEncoder,
VkPipelineBindPoint pipelineBindPoint,
MVKDescriptorSetLayoutBinding* mvkDSLBind,
uint32_t elementIndex,
bool stages[],
Expand Down
Loading

0 comments on commit 9612d76

Please sign in to comment.