Skip to content

Commit 4a97c07

Browse files
committed
Fix PipelineIndexStride and StageIndexStride calculation
Fix PipelineIndexStride and StageIndexStride calculation in SetPipelineIndexStride and SetStageIndexStride methods by using max instead of min to ensure the stride is at least the size of the appropriate VkPipelineCache entry index.
1 parent c99a555 commit 4a97c07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pcwriter.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ class VKSCPipelineCacheHeaderWriter
385385
// If the user wishes to store additional per-pipeline metadata in the index, the stride should be increased accordingly.
386386
void setPipelineIndexStride(uint32_t stride)
387387
{
388-
m_PipelineIndexStride = std::min(static_cast<uint32_t>(sizeof(VkPipelineCacheSafetyCriticalIndexEntry)), stride);
388+
m_PipelineIndexStride = std::max(static_cast<uint32_t>(sizeof(VkPipelineCacheSafetyCriticalIndexEntry)), stride);
389389
}
390390

391391
// set the offset in bytes into the pipeline cache where the pipeline index should be written.
@@ -405,7 +405,7 @@ class VKSCPipelineCacheHeaderWriter
405405
// If the user wishes to store additional per-stage metadata in the index, the stride should be increased accordingly.
406406
void setStageIndexStride(uint32_t stride)
407407
{
408-
m_StageIndexStride = std::min(static_cast<uint32_t>(sizeof(VkPipelineCacheStageValidationIndexEntry)), stride);
408+
m_StageIndexStride = std::max(static_cast<uint32_t>(sizeof(VkPipelineCacheStageValidationIndexEntry)), stride);
409409
}
410410

411411
// set the vendorID

0 commit comments

Comments
 (0)