@@ -385,6 +385,8 @@ struct StateReplayer::Impl
385
385
bool parse_sample_locations_info (const Value &state, VkSampleLocationsInfoEXT **out_info) FOSSILIZE_WARN_UNUSED;
386
386
bool parse_pipeline_robustness (const Value &state, VkPipelineRobustnessCreateInfoEXT **out_info) FOSSILIZE_WARN_UNUSED;
387
387
bool parse_depth_clamp_control (const Value &state, VkPipelineViewportDepthClampControlCreateInfoEXT **out_info) FOSSILIZE_WARN_UNUSED;
388
+ bool parse_rendering_attachment_location_info (const Value &state, VkRenderingAttachmentLocationInfoKHR **out_info) FOSSILIZE_WARN_UNUSED;
389
+ bool parse_rendering_input_attachment_index_info (const Value &state, VkRenderingInputAttachmentIndexInfoKHR **out_info) FOSSILIZE_WARN_UNUSED;
388
390
bool parse_uints (const Value &attachments, const uint32_t **out_uints) FOSSILIZE_WARN_UNUSED;
389
391
bool parse_sints (const Value &attachments, const int32_t **out_uints) FOSSILIZE_WARN_UNUSED;
390
392
const char *duplicate_string (const char *str, size_t len);
@@ -536,6 +538,10 @@ struct StateRecorder::Impl
536
538
void *copy_pnext_struct (const VkPipelineViewportDepthClampControlCreateInfoEXT *create_info,
537
539
ScratchAllocator &alloc,
538
540
const DynamicStateInfo *dynamic_state_info) FOSSILIZE_WARN_UNUSED;
541
+ void *copy_pnext_struct (const VkRenderingAttachmentLocationInfoKHR *create_info,
542
+ ScratchAllocator &alloc) FOSSILIZE_WARN_UNUSED;
543
+ void *copy_pnext_struct (const VkRenderingInputAttachmentIndexInfoKHR *create_info,
544
+ ScratchAllocator &alloc) FOSSILIZE_WARN_UNUSED;
539
545
template <typename T>
540
546
void *copy_pnext_struct_simple (const T *create_info, ScratchAllocator &alloc) FOSSILIZE_WARN_UNUSED;
541
547
@@ -836,6 +842,43 @@ static void hash_pnext_struct(const StateRecorder *, Hasher &h,
836
842
h.u32 (0 );
837
843
}
838
844
845
+ static void hash_pnext_struct (const StateRecorder *, Hasher &h,
846
+ const VkRenderingAttachmentLocationInfoKHR &info)
847
+ {
848
+ h.u32 (info.colorAttachmentCount );
849
+ if (info.pColorAttachmentLocations )
850
+ {
851
+ for (uint32_t i = 0 ; i < info.colorAttachmentCount ; i++)
852
+ h.u32 (info.pColorAttachmentLocations [i]);
853
+ }
854
+ else
855
+ h.u32 (0 );
856
+ }
857
+
858
+ static void hash_pnext_struct (const StateRecorder *, Hasher &h,
859
+ const VkRenderingInputAttachmentIndexInfoKHR &info)
860
+ {
861
+ h.u32 (info.colorAttachmentCount );
862
+
863
+ if (info.pColorAttachmentInputIndices )
864
+ {
865
+ for (uint32_t i = 0 ; i < info.colorAttachmentCount ; i++)
866
+ h.u32 (info.pColorAttachmentInputIndices [i]);
867
+ }
868
+ else
869
+ h.u32 (0 );
870
+
871
+ if (info.pDepthInputAttachmentIndex )
872
+ h.u32 (*info.pDepthInputAttachmentIndex );
873
+ else
874
+ h.u32 (0xffff ); // Use an arbitrary invalid attachment value.
875
+
876
+ if (info.pStencilInputAttachmentIndex )
877
+ h.u32 (*info.pStencilInputAttachmentIndex );
878
+ else
879
+ h.u32 (0xffff ); // Use an arbitrary invalid attachment value.
880
+ }
881
+
839
882
static bool hash_pnext_chain_pdf2 (const StateRecorder *recorder, Hasher &h, const void *pNext)
840
883
{
841
884
while ((pNext = pnext_chain_pdf2_skip_ignored_entries (pNext)) != nullptr )
@@ -1658,6 +1701,14 @@ static bool hash_pnext_chain(const StateRecorder *recorder, Hasher &h, const voi
1658
1701
hash_pnext_struct (recorder, h, *static_cast <const VkPipelineViewportDepthClampControlCreateInfoEXT *>(pNext), dynamic_state_info);
1659
1702
break ;
1660
1703
1704
+ case VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO_KHR:
1705
+ hash_pnext_struct (recorder, h, *static_cast <const VkRenderingAttachmentLocationInfoKHR *>(pNext));
1706
+ break ;
1707
+
1708
+ case VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO_KHR:
1709
+ hash_pnext_struct (recorder, h, *static_cast <const VkRenderingInputAttachmentIndexInfoKHR *>(pNext));
1710
+ break ;
1711
+
1661
1712
default :
1662
1713
log_error_pnext_chain (" Unsupported pNext found, cannot hash." , pNext);
1663
1714
return false ;
@@ -4819,6 +4870,52 @@ bool StateReplayer::Impl::parse_depth_clamp_control(const Value &state, VkPipeli
4819
4870
return true ;
4820
4871
}
4821
4872
4873
+ bool StateReplayer::Impl::parse_rendering_attachment_location_info (const Value &state, VkRenderingAttachmentLocationInfoKHR **out_info)
4874
+ {
4875
+ auto *info = allocator.allocate_cleared <VkRenderingAttachmentLocationInfoKHR>();
4876
+ info->colorAttachmentCount = state[" colorAttachmentCount" ].GetUint ();
4877
+ if (state.HasMember (" colorAttachmentLocations" ))
4878
+ {
4879
+ auto *locs = allocator.allocate_n_cleared <uint32_t >(info->colorAttachmentCount );
4880
+ for (uint32_t i = 0 ; i < info->colorAttachmentCount ; i++)
4881
+ locs[i] = state[" colorAttachmentLocations" ][i].GetUint ();
4882
+ info->pColorAttachmentLocations = locs;
4883
+ }
4884
+
4885
+ *out_info = info;
4886
+ return true ;
4887
+ }
4888
+
4889
+ bool StateReplayer::Impl::parse_rendering_input_attachment_index_info (const Value &state, VkRenderingInputAttachmentIndexInfoKHR **out_info)
4890
+ {
4891
+ auto *info = allocator.allocate_cleared <VkRenderingInputAttachmentIndexInfoKHR>();
4892
+ info->colorAttachmentCount = state[" colorAttachmentCount" ].GetUint ();
4893
+ if (state.HasMember (" colorAttachmentInputIndices" ))
4894
+ {
4895
+ auto *locs = allocator.allocate_n <uint32_t >(info->colorAttachmentCount );
4896
+ for (uint32_t i = 0 ; i < info->colorAttachmentCount ; i++)
4897
+ locs[i] = state[" colorAttachmentInputIndices" ][i].GetUint ();
4898
+ info->pColorAttachmentInputIndices = locs;
4899
+ }
4900
+
4901
+ if (state.HasMember (" depthInputAttachmentIndex" ))
4902
+ {
4903
+ auto *loc = allocator.allocate <uint32_t >();
4904
+ *loc = state[" depthInputAttachmentIndex" ].GetUint ();
4905
+ info->pDepthInputAttachmentIndex = loc;
4906
+ }
4907
+
4908
+ if (state.HasMember (" stencilInputAttachmentIndex" ))
4909
+ {
4910
+ auto *loc = allocator.allocate <uint32_t >();
4911
+ *loc = state[" stencilInputAttachmentIndex" ].GetUint ();
4912
+ info->pStencilInputAttachmentIndex = loc;
4913
+ }
4914
+
4915
+ *out_info = info;
4916
+ return true ;
4917
+ }
4918
+
4822
4919
bool StateReplayer::Impl::parse_mutable_descriptor_type (const Value &state,
4823
4920
VkMutableDescriptorTypeCreateInfoEXT **out_info)
4824
4921
{
@@ -5245,6 +5342,24 @@ bool StateReplayer::Impl::parse_pnext_chain(
5245
5342
break ;
5246
5343
}
5247
5344
5345
+ case VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO_KHR:
5346
+ {
5347
+ VkRenderingAttachmentLocationInfoKHR *info = nullptr ;
5348
+ if (!parse_rendering_attachment_location_info (next, &info))
5349
+ return false ;
5350
+ new_struct = reinterpret_cast <VkBaseInStructure *>(info);
5351
+ break ;
5352
+ }
5353
+
5354
+ case VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO_KHR:
5355
+ {
5356
+ VkRenderingInputAttachmentIndexInfoKHR *info = nullptr ;
5357
+ if (!parse_rendering_input_attachment_index_info (next, &info))
5358
+ return false ;
5359
+ new_struct = reinterpret_cast <VkBaseInStructure *>(info);
5360
+ break ;
5361
+ }
5362
+
5248
5363
default :
5249
5364
LOGE_LEVEL (" Failed to parse pNext chain for sType: %d\n " , int (sType ));
5250
5365
return false ;
@@ -5907,6 +6022,26 @@ void *StateRecorder::Impl::copy_pnext_struct(const VkPipelineViewportDepthClampC
5907
6022
return clamp_control;
5908
6023
}
5909
6024
6025
+ void *StateRecorder::Impl::copy_pnext_struct (const VkRenderingAttachmentLocationInfoKHR *info, ScratchAllocator &alloc)
6026
+ {
6027
+ auto *loc_info = copy (info, 1 , alloc);
6028
+ if (loc_info->pColorAttachmentLocations )
6029
+ loc_info->pColorAttachmentLocations = copy (loc_info->pColorAttachmentLocations , info->colorAttachmentCount , alloc);
6030
+ return loc_info;
6031
+ }
6032
+
6033
+ void *StateRecorder::Impl::copy_pnext_struct (const VkRenderingInputAttachmentIndexInfoKHR *info, ScratchAllocator &alloc)
6034
+ {
6035
+ auto *loc_info = copy (info, 1 , alloc);
6036
+ if (loc_info->pColorAttachmentInputIndices )
6037
+ loc_info->pColorAttachmentInputIndices = copy (loc_info->pColorAttachmentInputIndices , info->colorAttachmentCount , alloc);
6038
+ if (loc_info->pDepthInputAttachmentIndex )
6039
+ loc_info->pDepthInputAttachmentIndex = copy (loc_info->pDepthInputAttachmentIndex , 1 , alloc);
6040
+ if (loc_info->pStencilInputAttachmentIndex )
6041
+ loc_info->pStencilInputAttachmentIndex = copy (loc_info->pStencilInputAttachmentIndex , 1 , alloc);
6042
+ return loc_info;
6043
+ }
6044
+
5910
6045
template <typename T>
5911
6046
void *StateRecorder::Impl::copy_pnext_struct_simple (const T *create_info, ScratchAllocator &alloc)
5912
6047
{
@@ -6245,6 +6380,20 @@ bool StateRecorder::Impl::copy_pnext_chain(const void *pNext, ScratchAllocator &
6245
6380
break ;
6246
6381
}
6247
6382
6383
+ case VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO_KHR:
6384
+ {
6385
+ auto *ci = static_cast <const VkRenderingAttachmentLocationInfoKHR *>(pNext);
6386
+ *ppNext = static_cast <VkBaseInStructure *>(copy_pnext_struct (ci, alloc));
6387
+ break ;
6388
+ }
6389
+
6390
+ case VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO_KHR:
6391
+ {
6392
+ auto *ci = static_cast <const VkRenderingInputAttachmentIndexInfoKHR *>(pNext);
6393
+ *ppNext = static_cast <VkBaseInStructure *>(copy_pnext_struct (ci, alloc));
6394
+ break ;
6395
+ }
6396
+
6248
6397
default :
6249
6398
LOGE_LEVEL (" Cannot copy unknown pNext sType: %d.\n " , int (pin->sType ));
6250
6399
return false ;
@@ -9428,6 +9577,49 @@ static bool json_value(const VkPipelineViewportDepthClampControlCreateInfoEXT &c
9428
9577
return true ;
9429
9578
}
9430
9579
9580
+ template <typename Allocator>
9581
+ static bool json_value (const VkRenderingAttachmentLocationInfoKHR &create_info, Allocator &alloc, Value *out_value)
9582
+ {
9583
+ Value value (kObjectType );
9584
+ value.AddMember (" sType" , create_info.sType , alloc);
9585
+ value.AddMember (" colorAttachmentCount" , create_info.colorAttachmentCount , alloc);
9586
+
9587
+ if (create_info.pColorAttachmentLocations )
9588
+ {
9589
+ Value range (kArrayType );
9590
+ for (uint32_t i = 0 ; i < create_info.colorAttachmentCount ; i++)
9591
+ range.PushBack (create_info.pColorAttachmentLocations [i], alloc);
9592
+ value.AddMember (" colorAttachmentLocations" , range, alloc);
9593
+ }
9594
+
9595
+ *out_value = value;
9596
+ return true ;
9597
+ }
9598
+
9599
+ template <typename Allocator>
9600
+ static bool json_value (const VkRenderingInputAttachmentIndexInfoKHR &create_info, Allocator &alloc, Value *out_value)
9601
+ {
9602
+ Value value (kObjectType );
9603
+ value.AddMember (" sType" , create_info.sType , alloc);
9604
+ value.AddMember (" colorAttachmentCount" , create_info.colorAttachmentCount , alloc);
9605
+
9606
+ if (create_info.pColorAttachmentInputIndices )
9607
+ {
9608
+ Value range (kArrayType );
9609
+ for (uint32_t i = 0 ; i < create_info.colorAttachmentCount ; i++)
9610
+ range.PushBack (create_info.pColorAttachmentInputIndices [i], alloc);
9611
+ value.AddMember (" colorAttachmentInputIndices" , range, alloc);
9612
+ }
9613
+
9614
+ if (create_info.pDepthInputAttachmentIndex )
9615
+ value.AddMember (" depthInputAttachmentIndex" , *create_info.pDepthInputAttachmentIndex , alloc);
9616
+ if (create_info.pStencilInputAttachmentIndex )
9617
+ value.AddMember (" stencilInputAttachmentIndex" , *create_info.pStencilInputAttachmentIndex , alloc);
9618
+
9619
+ *out_value = value;
9620
+ return true ;
9621
+ }
9622
+
9431
9623
template <typename Allocator>
9432
9624
static bool json_value (const VkSubpassDescriptionDepthStencilResolve &create_info, Allocator &alloc, Value *out_value);
9433
9625
template <typename Allocator>
@@ -9643,6 +9835,16 @@ static bool pnext_chain_json_value(const void *pNext, Allocator &alloc, Value *o
9643
9835
return false ;
9644
9836
break ;
9645
9837
9838
+ case VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_LOCATION_INFO_KHR:
9839
+ if (!json_value (*static_cast <const VkRenderingAttachmentLocationInfoKHR *>(pNext), alloc, &next))
9840
+ return false ;
9841
+ break ;
9842
+
9843
+ case VK_STRUCTURE_TYPE_RENDERING_INPUT_ATTACHMENT_INDEX_INFO_KHR:
9844
+ if (!json_value (*static_cast <const VkRenderingInputAttachmentIndexInfoKHR *>(pNext), alloc, &next))
9845
+ return false ;
9846
+ break ;
9847
+
9646
9848
default :
9647
9849
log_error_pnext_chain (" Unsupported pNext found, cannot hash sType." , pNext);
9648
9850
return false ;
0 commit comments