Skip to content

Commit 68bd7c6

Browse files
PipelineResourceSignatureVkImpl: code cleanup
1 parent 7a4c2ca commit 68bd7c6

2 files changed

Lines changed: 117 additions & 149 deletions

File tree

Graphics/GraphicsEngineVulkan/include/PipelineResourceSignatureVkImpl.hpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,16 @@ ASSERT_SIZEOF(ImmutableSamplerAttribsVk, 8, "The struct is used in serialization
6464
/// - DescriptorSet binding and cache allocation
6565
/// - Shared emulated buffer (created in the Signature, shared by all SRBs)
6666
///
67-
/// Push constant selection is deferred to PSO creation time. At PSO creation,
68-
/// one inline constant may be selected to use vkCmdPushConstants based on:
69-
/// 1. SPIR-V reflection (ResourceType::PushConstant in shader)
70-
/// 2. First inline constant as fallback (converted via PatchShader)
67+
/// Push constant selection is deferred to PSO creation time, when
68+
/// one inline constant is selected to be the native push constant block.
7169
struct InlineConstantBufferAttribsVk
7270
{
73-
Uint32 ResIndex = 0; // Resource index in the signature (used for matching)
71+
Uint32 ResIndex = 0; // Resource index in the signature
7472
Uint32 DescrSet = 0; // Descriptor set index
7573
Uint32 BindingIndex = 0; // Binding index within the descriptor set
7674
Uint32 NumConstants = 0; // Number of 32-bit constants
7775

78-
// Shared buffer created in the Signature (similar to D3D11)
76+
// Shared buffer created in the Signature.
7977
// All SRBs reference this same buffer to reduce memory usage.
8078
RefCntAutoPtr<BufferVkImpl> pBuffer;
8179
};
@@ -157,10 +155,10 @@ class PipelineResourceSignatureVkImpl final : public PipelineResourceSignatureBa
157155
VkDescriptorSet vkDynamicDescriptorSet) const;
158156

159157
// Returns the number of inline constant buffers
160-
Uint32 GetNumInlineConstantBufferAttribs() const { return m_NumInlineConstantBufferAttribs; }
158+
Uint32 GetNumInlineConstantBuffers() const { return m_NumInlineConstantBuffers; }
161159

162160
// Returns the inline constant buffer attributes
163-
const InlineConstantBufferAttribsVk* GetInlineConstantBufferAttribs() const { return m_InlineConstantBufferAttribs.get(); }
161+
const InlineConstantBufferAttribsVk* GetInlineConstantBuffers() const { return m_InlineConstantBuffers.get(); }
164162

165163
#ifdef DILIGENT_DEVELOPMENT
166164
/// Verifies committed resource using the SPIRV resource attributes from the PSO.
@@ -180,7 +178,7 @@ class PipelineResourceSignatureVkImpl final : public PipelineResourceSignatureBa
180178

181179
bool HasInlineConstants() const
182180
{
183-
return m_NumInlineConstantBufferAttribs != 0;
181+
return m_NumInlineConstantBuffers != 0;
184182
}
185183

186184
private:
@@ -228,13 +226,13 @@ class PipelineResourceSignatureVkImpl final : public PipelineResourceSignatureBa
228226
Uint16 m_DynamicStorageBufferCount = 0;
229227

230228
// Number of inline constant buffers
231-
Uint16 m_NumInlineConstantBufferAttribs = 0;
229+
Uint16 m_NumInlineConstantBuffers = 0;
232230

233231
// The total number of inline constants (32-bit values) in all inline constant buffers
234232
Uint16 m_TotalInlineConstants = 0;
235233

236234
// Inline constant buffer attributes
237-
std::unique_ptr<InlineConstantBufferAttribsVk[]> m_InlineConstantBufferAttribs;
235+
std::unique_ptr<InlineConstantBufferAttribsVk[]> m_InlineConstantBuffers;
238236
};
239237

240238
template <> Uint32 PipelineResourceSignatureVkImpl::GetDescriptorSetIndex<PipelineResourceSignatureVkImpl::DESCRIPTOR_SET_ID_STATIC_MUTABLE>() const;

0 commit comments

Comments
 (0)