@@ -354,3 +354,116 @@ TEST(RootSignature, ParseRootDescriptorsV11) {
354
354
EXPECT_EQ (Storage.size (), 133u );
355
355
EXPECT_TRUE (memcmp (Buffer, Storage.data (), 133u ) == 0 );
356
356
}
357
+
358
+ TEST (RootSignature, ParseDescriptorTableV10) {
359
+ SmallString<128 > Storage;
360
+
361
+ // First read a fully explicit yaml with all sizes and offsets provided
362
+ ASSERT_TRUE (convert (Storage, R"( --- !dxcontainer
363
+ Header:
364
+ Hash: [ 0x32, 0x9A, 0x53, 0xD8, 0xEC, 0xBE, 0x35, 0x6F, 0x5,
365
+ 0x39, 0xE1, 0xFE, 0x31, 0x20, 0xF0, 0xC1 ]
366
+ Version:
367
+ Major: 1
368
+ Minor: 0
369
+ FileSize: 133
370
+ PartCount: 1
371
+ PartOffsets: [ 36 ]
372
+ Parts:
373
+ - Name: RTS0
374
+ Size: 89
375
+ RootSignature:
376
+ Version: 1
377
+ NumRootParameters: 1
378
+ RootParametersOffset: 24
379
+ NumStaticSamplers: 0
380
+ StaticSamplersOffset: 60
381
+ Parameters:
382
+ - ParameterType: 0 # SRV
383
+ ShaderVisibility: 3 # Domain
384
+ Table:
385
+ NumRanges: 1
386
+ Ranges:
387
+ - RangeType: 0
388
+ NumDescriptors: 41
389
+ BaseShaderRegister: 42
390
+ RegisterSpace: 43
391
+ OffsetInDescriptorsFromTableStart: -1
392
+ AllowInputAssemblerInputLayout: true
393
+ DenyGeometryShaderRootAccess: true
394
+ )" ));
395
+
396
+ uint8_t Buffer[] = {
397
+ 0x44 , 0x58 , 0x42 , 0x43 , 0x32 , 0x9a , 0x53 , 0xd8 , 0xec , 0xbe , 0x35 , 0x6f ,
398
+ 0x05 , 0x39 , 0xe1 , 0xfe , 0x31 , 0x20 , 0xf0 , 0xc1 , 0x01 , 0x00 , 0x00 , 0x00 ,
399
+ 0x85 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0x24 , 0x00 , 0x00 , 0x00 ,
400
+ 0x52 , 0x54 , 0x53 , 0x30 , 0x59 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 ,
401
+ 0x01 , 0x00 , 0x00 , 0x00 , 0x18 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
402
+ 0x3c , 0x00 , 0x00 , 0x00 , 0x11 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
403
+ 0x03 , 0x00 , 0x00 , 0x00 , 0x24 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 ,
404
+ 0x2c , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x29 , 0x00 , 0x00 , 0x00 ,
405
+ 0x2a , 0x00 , 0x00 , 0x00 , 0x2b , 0x00 , 0x00 , 0x00 , 0xff , 0xff , 0xff , 0xff ,
406
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
407
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
408
+ 0x00 };
409
+
410
+ EXPECT_EQ (Storage.size (), 133u );
411
+ EXPECT_TRUE (memcmp (Buffer, Storage.data (), 133u ) == 0 );
412
+ }
413
+
414
+ TEST (RootSignature, ParseDescriptorTableV11) {
415
+ SmallString<128 > Storage;
416
+
417
+ // First read a fully explicit yaml with all sizes and offsets provided
418
+ ASSERT_TRUE (convert (Storage, R"( --- !dxcontainer
419
+ Header:
420
+ Hash: [ 0x32, 0x9A, 0x53, 0xD8, 0xEC, 0xBE, 0x35, 0x6F, 0x5,
421
+ 0x39, 0xE1, 0xFE, 0x31, 0x20, 0xF0, 0xC1 ]
422
+ Version:
423
+ Major: 1
424
+ Minor: 0
425
+ FileSize: 133
426
+ PartCount: 1
427
+ PartOffsets: [ 36 ]
428
+ Parts:
429
+ - Name: RTS0
430
+ Size: 89
431
+ RootSignature:
432
+ Version: 2
433
+ NumRootParameters: 1
434
+ RootParametersOffset: 24
435
+ NumStaticSamplers: 0
436
+ StaticSamplersOffset: 60
437
+ Parameters:
438
+ - ParameterType: 0 # SRV
439
+ ShaderVisibility: 3 # Domain
440
+ Table:
441
+ NumRanges: 1
442
+ Ranges:
443
+ - RangeType: 0
444
+ NumDescriptors: 41
445
+ BaseShaderRegister: 42
446
+ RegisterSpace: 43
447
+ OffsetInDescriptorsFromTableStart: -1
448
+ DESCRIPTORS_STATIC_KEEPING_BUFFER_BOUNDS_CHECKS: true
449
+ AllowInputAssemblerInputLayout: true
450
+ DenyGeometryShaderRootAccess: true
451
+ )" ));
452
+
453
+ uint8_t Buffer[] = {
454
+ 0x44 , 0x58 , 0x42 , 0x43 , 0x32 , 0x9a , 0x53 , 0xd8 , 0xec , 0xbe , 0x35 , 0x6f ,
455
+ 0x05 , 0x39 , 0xe1 , 0xfe , 0x31 , 0x20 , 0xf0 , 0xc1 , 0x01 , 0x00 , 0x00 , 0x00 ,
456
+ 0x85 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0x24 , 0x00 , 0x00 , 0x00 ,
457
+ 0x52 , 0x54 , 0x53 , 0x30 , 0x59 , 0x00 , 0x00 , 0x00 , 0x02 , 0x00 , 0x00 , 0x00 ,
458
+ 0x01 , 0x00 , 0x00 , 0x00 , 0x18 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
459
+ 0x3c , 0x00 , 0x00 , 0x00 , 0x11 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
460
+ 0x03 , 0x00 , 0x00 , 0x00 , 0x24 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 ,
461
+ 0x2c , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x29 , 0x00 , 0x00 , 0x00 ,
462
+ 0x2a , 0x00 , 0x00 , 0x00 , 0x2b , 0x00 , 0x00 , 0x00 , 0xff , 0xff , 0xff , 0xff ,
463
+ 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
464
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
465
+ 0x00 };
466
+
467
+ EXPECT_EQ (Storage.size (), 133u );
468
+ EXPECT_TRUE (memcmp (Buffer, Storage.data (), 133u ) == 0 );
469
+ }
0 commit comments