Skip to content

Conversation

@hzqst
Copy link
Contributor

@hzqst hzqst commented Dec 30, 2025

  • Extends PipelineStateVkImpl::ShaderStageInfo with ShaderResources so shader reflection data can be reconstructed/updated after SPIR-V patching (e.g., UBO → push constants).

  • Introduces PushConstantInfoVk and stores push-constant metadata in PipelineLayoutVk; PipelineLayoutVk::Create(...) now configures VkPipelineLayoutCreateInfo.pPushConstantRanges (and validates size vs maxPushConstantsSize).

  • Adds logic in Vulkan PSO creation to derive push-constant info from signatures and to patch shaders via ConvertUBOToPushConstants, updating both SPIR-V and the associated shader resources.

  • Tweaks validation so push constants are validated but skip descriptor-set resource cache checks; fixes descriptor counting to use ResDesc.GetArraySize().

  • Adds ShaderVkImpl::CreateSPIRVShaderResources(const std::vector<uint32_t>&) to rebuild SPIRVShaderResources from SPIR-V after ShaderVkImpl::Initialize.

  • Persists CI-derived state (EntryPoint, LoadConstantBufferReflection) so reconstructed resources match the original reflection configuration.

  • Changes GetShaderResources() to return a null shared_ptr while compiling asynchronously instead of asserting.

  • Updates SerializedPipelineStateImpl::PatchShadersVk to also transfer ShaderResources into PipelineStateVkImpl::ShaderStageInfo, ensuring archived/serialized Vulkan PSOs keep the per-stage reflection/resources alongside shaders and SPIR-V.

… it can be reconstructed in "PatchShaderConvertUniformBufferToPushConstant" later.

2. Add push constants info to "PipelineLayoutVk" and setup "PipelineLayoutCI.pPushConstantRanges" properly.
…ShaderResources from SPIRV even after ShaderVkImpl::Initialize.
}

void PipelineLayoutVk::Create(RenderDeviceVkImpl* pDeviceVk, RefCntAutoPtr<PipelineResourceSignatureVkImpl> ppSignatures[], Uint32 SignatureCount) noexcept(false)
void PipelineLayoutVk::Create(RenderDeviceVkImpl* pDeviceVk,

Check notice

Code scanning / CodeQL

No raw arrays in interfaces Note

Raw arrays should not be used in interfaces. A container class should be used instead.
Uint32 ArraySize = Attribs.ArraySize;
if (Flags & PIPELINE_RESOURCE_FLAG_INLINE_CONSTANTS)
{
VERIFY(Flags == PIPELINE_RESOURCE_FLAG_INLINE_CONSTANTS, "INLINE_CONSTANTS flag cannot be combined with other flags.");

Check warning

Code scanning / PREfast

Use 'bitwise and' to check if a flag is set. Warning

Use 'bitwise and' to check if a flag is set.
@hzqst hzqst marked this pull request as ready for review December 30, 2025 08:22
@hzqst hzqst changed the title ShaderVk, PipelineLayoutVk, PipelineStateVkImpl update. ShaderVk, PipelineLayoutVk, PipelineStateVkImpl update, based on #729 Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant