@@ -526,3 +526,64 @@ TEST(RootSignature, ParseStaticSamplers) {
526
526
EXPECT_EQ (Storage.size (), 144u );
527
527
EXPECT_TRUE (memcmp (Buffer, Storage.data (), 144u ) == 0 );
528
528
}
529
+
530
+ TEST (RootSignature, ParseStaticSamplersV13) {
531
+ SmallString<128 > Storage;
532
+
533
+ // First read a fully explicit yaml with all sizes and offsets provided
534
+ ASSERT_TRUE (convert (Storage, R"( --- !dxcontainer
535
+ Header:
536
+ Hash: [ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
537
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 ]
538
+ Version:
539
+ Major: 1
540
+ Minor: 0
541
+ PartCount: 1
542
+ PartOffsets: [ 60 ]
543
+ Parts:
544
+ - Name: RTS0
545
+ Size: 76
546
+ RootSignature:
547
+ Version: 3
548
+ NumRootParameters: 0
549
+ RootParametersOffset: 24
550
+ NumStaticSamplers: 1
551
+ StaticSamplersOffset: 24
552
+ Parameters: []
553
+ Samplers:
554
+ - Filter: MinLinearMagMipPoint
555
+ AddressU: Wrap
556
+ AddressV: Mirror
557
+ AddressW: MirrorOnce
558
+ MipLODBias: 1.23
559
+ MaxAnisotropy: 20
560
+ ComparisonFunc: LessEqual
561
+ BorderColor: TransparentBlack
562
+ MinLOD: 4.56
563
+ MaxLOD: 8.90
564
+ ShaderRegister: 31
565
+ RegisterSpace: 32
566
+ ShaderVisibility: Mesh
567
+ SAMPLER_FLAG_UINT_BORDER_COLOR: true
568
+ AllowInputAssemblerInputLayout: true
569
+ DenyGeometryShaderRootAccess: true
570
+ )" ));
571
+
572
+ uint8_t Buffer[] = {
573
+ 0x44 , 0x58 , 0x42 , 0x43 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
574
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 ,
575
+ 0x90 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0x3c , 0x00 , 0x00 , 0x00 ,
576
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
577
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
578
+ 0x52 , 0x54 , 0x53 , 0x30 , 0x4c , 0x00 , 0x00 , 0x00 , 0x02 , 0x00 , 0x00 , 0x00 ,
579
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x18 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 ,
580
+ 0x18 , 0x00 , 0x00 , 0x00 , 0x11 , 0x00 , 0x00 , 0x00 , 0x10 , 0x00 , 0x00 , 0x00 ,
581
+ 0x01 , 0x00 , 0x00 , 0x00 , 0x02 , 0x00 , 0x00 , 0x00 , 0x05 , 0x00 , 0x00 , 0x00 ,
582
+ 0xa4 , 0x70 , 0x9d , 0x3f , 0x14 , 0x00 , 0x00 , 0x00 , 0x04 , 0x00 , 0x00 , 0x00 ,
583
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x85 , 0xeb , 0x91 , 0x40 , 0x66 , 0x66 , 0x0e , 0x41 ,
584
+ 0x1f , 0x00 , 0x00 , 0x00 , 0x20 , 0x00 , 0x00 , 0x00 , 0x07 , 0x00 , 0x00 , 0x00 ,
585
+ 0x01 };
586
+
587
+ EXPECT_EQ (Storage.size (), 148U );
588
+ EXPECT_TRUE (memcmp (Buffer, Storage.data (), 148U ) == 0 );
589
+ }
0 commit comments