Skip to content

Commit 1aec22a

Browse files
authored
Merge pull request #28 from slangbot/format-9005-push-muxkpywpplyq
Format code for PR shader-slang#9005
2 parents a0e39df + 22d5049 commit 1aec22a

File tree

3 files changed

+114
-73
lines changed

3 files changed

+114
-73
lines changed

include/slang-deprecated.h

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -521,16 +521,18 @@ extern "C"
521521
/** Get the size of a type layout in the specified parameter category.
522522
*
523523
* Returns `SLANG_UNBOUNDED_SIZE` for unbounded resources (e.g., unsized arrays).
524-
* Returns `SLANG_UNKNOWN_SIZE` when the size depends on unresolved generic parameters or link-time constants.
524+
* Returns `SLANG_UNKNOWN_SIZE` when the size depends on unresolved generic parameters or
525+
* link-time constants.
525526
*/
526527
SLANG_API size_t spReflectionTypeLayout_GetSize(
527528
SlangReflectionTypeLayout* type,
528529
SlangParameterCategory category);
529-
530+
530531
/** Get the stride of a type layout in the specified parameter category.
531532
*
532533
* Returns `SLANG_UNBOUNDED_SIZE` for unbounded resources.
533-
* Returns `SLANG_UNKNOWN_SIZE` when stride depends on unresolved generic parameters or link-time constants.
534+
* Returns `SLANG_UNKNOWN_SIZE` when stride depends on unresolved generic parameters or
535+
* link-time constants.
534536
*/
535537
SLANG_API size_t spReflectionTypeLayout_GetStride(
536538
SlangReflectionTypeLayout* type,
@@ -555,7 +557,8 @@ extern "C"
555557
/** Get the stride between elements of an array type layout.
556558
*
557559
* Returns `SLANG_UNBOUNDED_SIZE` for unbounded resources.
558-
* Returns `SLANG_UNKNOWN_SIZE` when element stride depends on unresolved generic parameters or link-time constants.
560+
* Returns `SLANG_UNKNOWN_SIZE` when element stride depends on unresolved generic parameters or
561+
* link-time constants.
559562
*/
560563
SLANG_API size_t spReflectionTypeLayout_GetElementStride(
561564
SlangReflectionTypeLayout* type,
@@ -600,7 +603,8 @@ extern "C"
600603
/** Get the binding count for a binding range at the specified index.
601604
*
602605
* Returns `SLANG_UNBOUNDED_SIZE` for unbounded resources.
603-
* Returns `SLANG_UNKNOWN_SIZE` when the count depends on unresolved generic parameters or link-time constants.
606+
* Returns `SLANG_UNKNOWN_SIZE` when the count depends on unresolved generic parameters or
607+
* link-time constants.
604608
*/
605609
SLANG_API SlangInt spReflectionTypeLayout_getBindingRangeBindingCount(
606610
SlangReflectionTypeLayout* typeLayout,
@@ -640,17 +644,19 @@ extern "C"
640644
SlangInt setIndex);
641645
/** Get the index offset for a descriptor range within a descriptor set.
642646
*
643-
* Returns `SLANG_UNKNOWN_SIZE` when the offset depends on unresolved generic parameters or link-time constants.
647+
* Returns `SLANG_UNKNOWN_SIZE` when the offset depends on unresolved generic parameters or
648+
* link-time constants.
644649
*/
645650
SLANG_API SlangInt spReflectionTypeLayout_getDescriptorSetDescriptorRangeIndexOffset(
646651
SlangReflectionTypeLayout* typeLayout,
647652
SlangInt setIndex,
648653
SlangInt rangeIndex);
649-
654+
650655
/** Get the descriptor count for a descriptor range within a descriptor set.
651656
*
652657
* Returns `SLANG_UNBOUNDED_SIZE` for unbounded resources.
653-
* Returns `SLANG_UNKNOWN_SIZE` when the count depends on unresolved generic parameters or link-time constants.
658+
* Returns `SLANG_UNKNOWN_SIZE` when the count depends on unresolved generic parameters or
659+
* link-time constants.
654660
*/
655661
SLANG_API SlangInt spReflectionTypeLayout_getDescriptorSetDescriptorRangeDescriptorCount(
656662
SlangReflectionTypeLayout* typeLayout,
@@ -672,7 +678,8 @@ extern "C"
672678
SlangInt subObjectRangeIndex);
673679
/** Get the space offset for a sub-object range.
674680
*
675-
* Returns `SLANG_UNKNOWN_SIZE` when the offset depends on unresolved generic parameters or link-time constants.
681+
* Returns `SLANG_UNKNOWN_SIZE` when the offset depends on unresolved generic parameters or
682+
* link-time constants.
676683
*/
677684
SLANG_API SlangInt spReflectionTypeLayout_getSubObjectRangeSpaceOffset(
678685
SlangReflectionTypeLayout* typeLayout,
@@ -728,15 +735,17 @@ extern "C"
728735

729736
/** Get the offset of a variable in the specified parameter category.
730737
*
731-
* Returns `SLANG_UNKNOWN_SIZE` when the offset depends on unresolved generic parameters or link-time constants.
738+
* Returns `SLANG_UNKNOWN_SIZE` when the offset depends on unresolved generic parameters or
739+
* link-time constants.
732740
*/
733741
SLANG_API size_t spReflectionVariableLayout_GetOffset(
734742
SlangReflectionVariableLayout* var,
735743
SlangParameterCategory category);
736-
744+
737745
/** Get the register space/set of a variable in the specified parameter category.
738746
*
739-
* Returns `SLANG_UNKNOWN_SIZE` when the space depends on unresolved generic parameters or link-time constants.
747+
* Returns `SLANG_UNKNOWN_SIZE` when the space depends on unresolved generic parameters or
748+
* link-time constants.
740749
*/
741750
SLANG_API size_t spReflectionVariableLayout_GetSpace(
742751
SlangReflectionVariableLayout* var,
@@ -858,13 +867,15 @@ extern "C"
858867

859868
/** Get the binding index for a shader parameter.
860869
*
861-
* Returns `SLANG_UNKNOWN_SIZE` when the index depends on unresolved generic parameters or link-time constants.
870+
* Returns `SLANG_UNKNOWN_SIZE` when the index depends on unresolved generic parameters or
871+
* link-time constants.
862872
*/
863873
SLANG_API unsigned spReflectionParameter_GetBindingIndex(SlangReflectionParameter* parameter);
864-
874+
865875
/** Get the binding space for a shader parameter.
866876
*
867-
* Returns `SLANG_UNKNOWN_SIZE` when the space depends on unresolved generic parameters or link-time constants.
877+
* Returns `SLANG_UNKNOWN_SIZE` when the space depends on unresolved generic parameters or
878+
* link-time constants.
868879
*/
869880
SLANG_API unsigned spReflectionParameter_GetBindingSpace(SlangReflectionParameter* parameter);
870881

@@ -981,14 +992,16 @@ extern "C"
981992

982993
/** Get the binding index for the global constant buffer.
983994
*
984-
* Returns `SLANG_UNKNOWN_SIZE` when the binding depends on unresolved generic parameters or link-time constants.
995+
* Returns `SLANG_UNKNOWN_SIZE` when the binding depends on unresolved generic parameters or
996+
* link-time constants.
985997
*/
986998
SLANG_API SlangUInt spReflection_getGlobalConstantBufferBinding(SlangReflection* reflection);
987-
999+
9881000
/** Get the size of the global constant buffer.
9891001
*
9901002
* Returns `SLANG_UNBOUNDED_SIZE` for unbounded resources.
991-
* Returns `SLANG_UNKNOWN_SIZE` when the size depends on unresolved generic parameters or link-time constants.
1003+
* Returns `SLANG_UNKNOWN_SIZE` when the size depends on unresolved generic parameters or
1004+
* link-time constants.
9921005
*/
9931006
SLANG_API size_t spReflection_getGlobalConstantBufferSize(SlangReflection* reflection);
9941007

include/slang.h

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2322,10 +2322,10 @@ struct TypeReflection
23222322
/** Get the number of elements in an array or vector type.
23232323
*
23242324
* Only useful if `getKind() == Kind::Array` or `Kind::Vector`.
2325-
*
2325+
*
23262326
* Returns `SLANG_UNBOUNDED_SIZE` for unbounded-size arrays.
2327-
* Returns `SLANG_UNKNOWN_SIZE` when size depends on unresolved generic parameters or link-time constants.
2328-
* The `reflection` parameter can help resolve link-time constants if available.
2327+
* Returns `SLANG_UNKNOWN_SIZE` when size depends on unresolved generic parameters or link-time
2328+
* constants. The `reflection` parameter can help resolve link-time constants if available.
23292329
*/
23302330
size_t getElementCount(SlangReflection* reflection = nullptr)
23312331
{
@@ -2335,7 +2335,8 @@ struct TypeReflection
23352335
/** Get the total number of elements in a multi-dimensional array type.
23362336
*
23372337
* Returns `SLANG_UNBOUNDED_SIZE` for unbounded-size arrays.
2338-
* Returns `SLANG_UNKNOWN_SIZE` when size depends on unresolved generic parameters or link-time constants.
2338+
* Returns `SLANG_UNKNOWN_SIZE` when size depends on unresolved generic parameters or link-time
2339+
* constants.
23392340
*/
23402341
size_t getTotalArrayElementCount()
23412342
{
@@ -2513,7 +2514,8 @@ struct TypeLayoutReflection
25132514
/** Get the size of this type layout in the specified parameter category.
25142515
*
25152516
* Returns `SLANG_UNBOUNDED_SIZE` for unbounded resources (e.g., unsized arrays).
2516-
* Returns `SLANG_UNKNOWN_SIZE` when the size depends on unresolved generic parameters or link-time constants.
2517+
* Returns `SLANG_UNKNOWN_SIZE` when the size depends on unresolved generic parameters or
2518+
* link-time constants.
25172519
*/
25182520
size_t getSize(SlangParameterCategory category)
25192521
{
@@ -2523,7 +2525,8 @@ struct TypeLayoutReflection
25232525
/** Get the stride of this type layout in the specified parameter category.
25242526
*
25252527
* Returns `SLANG_UNBOUNDED_SIZE` for unbounded resources.
2526-
* Returns `SLANG_UNKNOWN_SIZE` when stride depends on unresolved generic parameters or link-time constants.
2528+
* Returns `SLANG_UNKNOWN_SIZE` when stride depends on unresolved generic parameters or
2529+
* link-time constants.
25272530
*/
25282531
size_t getStride(SlangParameterCategory category)
25292532
{
@@ -2538,7 +2541,8 @@ struct TypeLayoutReflection
25382541
/** Get the size of this type layout in the specified parameter category.
25392542
*
25402543
* Returns `SLANG_UNBOUNDED_SIZE` for unbounded resources (e.g., unsized arrays).
2541-
* Returns `SLANG_UNKNOWN_SIZE` when the size depends on unresolved generic parameters or link-time constants.
2544+
* Returns `SLANG_UNKNOWN_SIZE` when the size depends on unresolved generic parameters or
2545+
* link-time constants.
25422546
*/
25432547
size_t getSize(slang::ParameterCategory category = slang::ParameterCategory::Uniform)
25442548
{
@@ -2550,7 +2554,8 @@ struct TypeLayoutReflection
25502554
/** Get the stride of this type layout in the specified parameter category.
25512555
*
25522556
* Returns `SLANG_UNBOUNDED_SIZE` for unbounded resources.
2553-
* Returns `SLANG_UNKNOWN_SIZE` when stride depends on unresolved generic parameters or link-time constants.
2557+
* Returns `SLANG_UNKNOWN_SIZE` when stride depends on unresolved generic parameters or
2558+
* link-time constants.
25542559
*/
25552560
size_t getStride(slang::ParameterCategory category = slang::ParameterCategory::Uniform)
25562561
{
@@ -2606,11 +2611,12 @@ struct TypeLayoutReflection
26062611
}
26072612

26082613
/** Get the number of elements in an array variable.
2609-
*
2614+
*
26102615
* Only useful if `getKind() == Kind::Array`.
26112616
*
26122617
* Returns `SLANG_UNBOUNDED_SIZE` for unbounded-size arrays.
2613-
* Returns `SLANG_UNKNOWN_SIZE` when size depends on unresolved generic parameters or link-time constants.
2618+
* Returns `SLANG_UNKNOWN_SIZE` when size depends on unresolved generic parameters or link-time
2619+
* constants.
26142620
*/
26152621
size_t getElementCount(ShaderReflection* reflection = nullptr)
26162622
{
@@ -2620,14 +2626,16 @@ struct TypeLayoutReflection
26202626
/** Get the total number of elements in a multi-dimensional array variable.
26212627
*
26222628
* Returns `SLANG_UNBOUNDED_SIZE` for unbounded-size arrays.
2623-
* Returns `SLANG_UNKNOWN_SIZE` when size depends on unresolved generic parameters or link-time constants.
2629+
* Returns `SLANG_UNKNOWN_SIZE` when size depends on unresolved generic parameters or link-time
2630+
* constants.
26242631
*/
26252632
size_t getTotalArrayElementCount() { return getType()->getTotalArrayElementCount(); }
26262633

26272634
/** Get the stride between elements of an array type layout.
26282635
*
26292636
* Returns `SLANG_UNBOUNDED_SIZE` for unbounded resources.
2630-
* Returns `SLANG_UNKNOWN_SIZE` when element stride depends on unresolved generic parameters or link-time constants.
2637+
* Returns `SLANG_UNKNOWN_SIZE` when element stride depends on unresolved generic parameters or
2638+
* link-time constants.
26312639
*/
26322640
size_t getElementStride(SlangParameterCategory category)
26332641
{
@@ -2726,7 +2734,8 @@ struct TypeLayoutReflection
27262734
/** Get the binding count for a binding range at the specified index.
27272735
*
27282736
* Returns `SLANG_UNBOUNDED_SIZE` for unbounded resources.
2729-
* Returns `SLANG_UNKNOWN_SIZE` when the count depends on unresolved generic parameters or link-time constants.
2737+
* Returns `SLANG_UNKNOWN_SIZE` when the count depends on unresolved generic parameters or
2738+
* link-time constants.
27302739
*/
27312740
SlangInt getBindingRangeBindingCount(SlangInt index)
27322741
{
@@ -2827,7 +2836,8 @@ struct TypeLayoutReflection
28272836

28282837
/** Get the index offset for a descriptor range within a descriptor set.
28292838
*
2830-
* Returns `SLANG_UNKNOWN_SIZE` when the offset depends on unresolved generic parameters or link-time constants.
2839+
* Returns `SLANG_UNKNOWN_SIZE` when the offset depends on unresolved generic parameters or
2840+
* link-time constants.
28312841
*/
28322842
SlangInt getDescriptorSetDescriptorRangeIndexOffset(SlangInt setIndex, SlangInt rangeIndex)
28332843
{
@@ -2840,7 +2850,8 @@ struct TypeLayoutReflection
28402850
/** Get the descriptor count for a descriptor range within a descriptor set.
28412851
*
28422852
* Returns `SLANG_UNBOUNDED_SIZE` for unbounded resources.
2843-
* Returns `SLANG_UNKNOWN_SIZE` when the count depends on unresolved generic parameters or link-time constants.
2853+
* Returns `SLANG_UNKNOWN_SIZE` when the count depends on unresolved generic parameters or
2854+
* link-time constants.
28442855
*/
28452856
SlangInt getDescriptorSetDescriptorRangeDescriptorCount(SlangInt setIndex, SlangInt rangeIndex)
28462857
{
@@ -2882,7 +2893,8 @@ struct TypeLayoutReflection
28822893

28832894
/** Get the space offset for a sub-object range.
28842895
*
2885-
* Returns `SLANG_UNKNOWN_SIZE` when the offset depends on unresolved generic parameters or link-time constants.
2896+
* Returns `SLANG_UNKNOWN_SIZE` when the offset depends on unresolved generic parameters or
2897+
* link-time constants.
28862898
*/
28872899
SlangInt getSubObjectRangeSpaceOffset(SlangInt subObjectRangeIndex)
28882900
{
@@ -3012,16 +3024,18 @@ struct VariableLayoutReflection
30123024

30133025
/** Get the offset of this variable in the specified parameter category.
30143026
*
3015-
* Returns `SLANG_UNKNOWN_SIZE` when the offset depends on unresolved generic parameters or link-time constants.
3027+
* Returns `SLANG_UNKNOWN_SIZE` when the offset depends on unresolved generic parameters or
3028+
* link-time constants.
30163029
*/
30173030
size_t getOffset(SlangParameterCategory category)
30183031
{
30193032
return spReflectionVariableLayout_GetOffset((SlangReflectionVariableLayout*)this, category);
30203033
}
3021-
3034+
30223035
/** Get the offset of this variable in the specified parameter category.
30233036
*
3024-
* Returns `SLANG_UNKNOWN_SIZE` when the offset depends on unresolved generic parameters or link-time constants.
3037+
* Returns `SLANG_UNKNOWN_SIZE` when the offset depends on unresolved generic parameters or
3038+
* link-time constants.
30253039
*/
30263040
size_t getOffset(slang::ParameterCategory category = slang::ParameterCategory::Uniform)
30273041
{
@@ -3035,7 +3049,8 @@ struct VariableLayoutReflection
30353049

30363050
/** Get the binding index for this variable layout.
30373051
*
3038-
* Returns `SLANG_UNKNOWN_SIZE` when the index depends on unresolved generic parameters or link-time constants.
3052+
* Returns `SLANG_UNKNOWN_SIZE` when the index depends on unresolved generic parameters or
3053+
* link-time constants.
30393054
*/
30403055
unsigned getBindingIndex()
30413056
{
@@ -3044,7 +3059,8 @@ struct VariableLayoutReflection
30443059

30453060
/** Get the binding space for this variable layout.
30463061
*
3047-
* Returns `SLANG_UNKNOWN_SIZE` when the space depends on unresolved generic parameters or link-time constants.
3062+
* Returns `SLANG_UNKNOWN_SIZE` when the space depends on unresolved generic parameters or
3063+
* link-time constants.
30483064
*/
30493065
unsigned getBindingSpace()
30503066
{
@@ -3053,16 +3069,18 @@ struct VariableLayoutReflection
30533069

30543070
/** Get the register space/set of this variable in the specified parameter category.
30553071
*
3056-
* Returns `SLANG_UNKNOWN_SIZE` when the space depends on unresolved generic parameters or link-time constants.
3072+
* Returns `SLANG_UNKNOWN_SIZE` when the space depends on unresolved generic parameters or
3073+
* link-time constants.
30573074
*/
30583075
size_t getBindingSpace(SlangParameterCategory category)
30593076
{
30603077
return spReflectionVariableLayout_GetSpace((SlangReflectionVariableLayout*)this, category);
30613078
}
3062-
3079+
30633080
/** Get the register space/set of this variable in the specified parameter category.
30643081
*
3065-
* Returns `SLANG_UNKNOWN_SIZE` when the space depends on unresolved generic parameters or link-time constants.
3082+
* Returns `SLANG_UNKNOWN_SIZE` when the space depends on unresolved generic parameters or
3083+
* link-time constants.
30663084
*/
30673085
size_t getBindingSpace(slang::ParameterCategory category)
30683086
{
@@ -3427,7 +3445,8 @@ struct ShaderReflection
34273445

34283446
/** Get the binding index for the global constant buffer.
34293447
*
3430-
* Returns `SLANG_UNKNOWN_SIZE` when the binding depends on unresolved generic parameters or link-time constants.
3448+
* Returns `SLANG_UNKNOWN_SIZE` when the binding depends on unresolved generic parameters or
3449+
* link-time constants.
34313450
*/
34323451
SlangUInt getGlobalConstantBufferBinding()
34333452
{
@@ -3437,7 +3456,8 @@ struct ShaderReflection
34373456
/** Get the size of the global constant buffer.
34383457
*
34393458
* Returns `SLANG_UNBOUNDED_SIZE` for unbounded resources.
3440-
* Returns `SLANG_UNKNOWN_SIZE` when the size depends on unresolved generic parameters or link-time constants.
3459+
* Returns `SLANG_UNKNOWN_SIZE` when the size depends on unresolved generic parameters or
3460+
* link-time constants.
34413461
*/
34423462
size_t getGlobalConstantBufferSize()
34433463
{

0 commit comments

Comments
 (0)