Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect the bind point supplied to vkCmdBindDescriptorSets / vkCmdPushDescriptorSets #1898

Merged
merged 1 commit into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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