Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
cdf7a85b
Unverified
Commit
cdf7a85b
authored
Nov 02, 2018
by
John Kessenich
Committed by
GitHub
Nov 02, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1557 from nicebyte/spec-const-decorations
Add names for composite spec constants in SPIR-V
parents
a440fbb0
4c9876b3
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
232 additions
and
117 deletions
+232
-117
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+6
-5
spv.float16.frag.out
Test/baseResults/spv.float16.frag.out
+8
-4
spv.float32.frag.out
Test/baseResults/spv.float32.frag.out
+8
-4
spv.float64.frag.out
Test/baseResults/spv.float64.frag.out
+8
-4
spv.int16.amd.frag.out
Test/baseResults/spv.int16.amd.frag.out
+44
-22
spv.int64.frag.out
Test/baseResults/spv.int64.frag.out
+40
-19
spv.specConstantOperations.vert.out
Test/baseResults/spv.specConstantOperations.vert.out
+117
-59
spv.int64.frag
Test/spv.int64.frag
+1
-0
No files found.
SPIRV/GlslangToSpv.cpp
View file @
cdf7a85b
...
@@ -7292,18 +7292,19 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& n
...
@@ -7292,18 +7292,19 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& n
// An AST node labelled as specialization constant should be a symbol node.
// An AST node labelled as specialization constant should be a symbol node.
// Its initializer should either be a sub tree with constant nodes, or a constant union array.
// Its initializer should either be a sub tree with constant nodes, or a constant union array.
if
(
auto
*
sn
=
node
.
getAsSymbolNode
())
{
if
(
auto
*
sn
=
node
.
getAsSymbolNode
())
{
spv
::
Id
result
;
if
(
auto
*
sub_tree
=
sn
->
getConstSubtree
())
{
if
(
auto
*
sub_tree
=
sn
->
getConstSubtree
())
{
// Traverse the constant constructor sub tree like generating normal run-time instructions.
// Traverse the constant constructor sub tree like generating normal run-time instructions.
// During the AST traversal, if the node is marked as 'specConstant', SpecConstantOpModeGuard
// During the AST traversal, if the node is marked as 'specConstant', SpecConstantOpModeGuard
// will set the builder into spec constant op instruction generating mode.
// will set the builder into spec constant op instruction generating mode.
sub_tree
->
traverse
(
this
);
sub_tree
->
traverse
(
this
);
re
turn
accessChainLoad
(
sub_tree
->
getType
());
re
sult
=
accessChainLoad
(
sub_tree
->
getType
());
}
else
if
(
auto
*
const_union_array
=
&
sn
->
getConstArray
()){
}
else
if
(
auto
*
const_union_array
=
&
sn
->
getConstArray
())
{
int
nextConst
=
0
;
int
nextConst
=
0
;
spv
::
Id
id
=
createSpvConstantFromConstUnionArray
(
sn
->
getType
(),
*
const_union_array
,
nextConst
,
true
);
result
=
createSpvConstantFromConstUnionArray
(
sn
->
getType
(),
*
const_union_array
,
nextConst
,
true
);
builder
.
addName
(
id
,
sn
->
getName
().
c_str
());
return
id
;
}
}
builder
.
addName
(
result
,
sn
->
getName
().
c_str
());
return
result
;
}
}
// Neither a front-end constant node, nor a specialization constant node with constant union array or
// Neither a front-end constant node, nor a specialization constant node with constant union array or
...
...
Test/baseResults/spv.float16.frag.out
View file @
cdf7a85b
...
@@ -114,6 +114,10 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require
...
@@ -114,6 +114,10 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require
Name 526 "sf16"
Name 526 "sf16"
Name 527 "sf"
Name 527 "sf"
Name 528 "sd"
Name 528 "sd"
Name 529 "f16_to_f"
Name 531 "f16_to_d"
Name 532 "f_to_f16"
Name 533 "d_to_f16"
Decorate 512 ArrayStride 16
Decorate 512 ArrayStride 16
Decorate 513 ArrayStride 32
Decorate 513 ArrayStride 32
MemberDecorate 514(S) 0 Offset 0
MemberDecorate 514(S) 0 Offset 0
...
@@ -235,11 +239,11 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require
...
@@ -235,11 +239,11 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require
526(sf16):28(float16_t) SpecConstant 12288
526(sf16):28(float16_t) SpecConstant 12288
527(sf): 164(float) SpecConstant 1048576000
527(sf): 164(float) SpecConstant 1048576000
528(sd):172(float64_t) SpecConstant 0 1071644672
528(sd):172(float64_t) SpecConstant 0 1071644672
529
: 164(float) SpecConstantOp 115 526(sf16)
529(f16_to_f)
: 164(float) SpecConstantOp 115 526(sf16)
530: 164(float) SpecConstantOp 115 526(sf16)
530: 164(float) SpecConstantOp 115 526(sf16)
531
:172(float64_t) SpecConstantOp 115 530
531(f16_to_d)
:172(float64_t) SpecConstantOp 115 530
532
:28(float16_t) SpecConstantOp 115 527(sf)
532(f_to_f16)
:28(float16_t) SpecConstantOp 115 527(sf)
533
:28(float16_t) SpecConstantOp 115 528(sd)
533(d_to_f16)
:28(float16_t) SpecConstantOp 115 528(sd)
4(main): 2 Function None 3
4(main): 2 Function None 3
5: Label
5: Label
Return
Return
...
...
Test/baseResults/spv.float32.frag.out
View file @
cdf7a85b
...
@@ -104,6 +104,10 @@ error: Capability Float16 is not allowed by Vulkan 1.1 specification (or require
...
@@ -104,6 +104,10 @@ error: Capability Float16 is not allowed by Vulkan 1.1 specification (or require
Name 525 "sf16"
Name 525 "sf16"
Name 526 "sf"
Name 526 "sf"
Name 527 "sd"
Name 527 "sd"
Name 528 "f16_to_f"
Name 530 "f16_to_d"
Name 531 "f_to_f16"
Name 532 "d_to_f16"
Decorate 518 ArrayStride 16
Decorate 518 ArrayStride 16
Decorate 519 ArrayStride 32
Decorate 519 ArrayStride 32
MemberDecorate 520(S) 0 Offset 0
MemberDecorate 520(S) 0 Offset 0
...
@@ -209,11 +213,11 @@ error: Capability Float16 is not allowed by Vulkan 1.1 specification (or require
...
@@ -209,11 +213,11 @@ error: Capability Float16 is not allowed by Vulkan 1.1 specification (or require
525(sf16):172(float16_t) SpecConstant 12288
525(sf16):172(float16_t) SpecConstant 12288
526(sf): 26(float) SpecConstant 1048576000
526(sf): 26(float) SpecConstant 1048576000
527(sd):149(float64_t) SpecConstant 0 1071644672
527(sd):149(float64_t) SpecConstant 0 1071644672
528
: 26(float) SpecConstantOp 115 525(sf16)
528(f16_to_f)
: 26(float) SpecConstantOp 115 525(sf16)
529: 26(float) SpecConstantOp 115 525(sf16)
529: 26(float) SpecConstantOp 115 525(sf16)
530
:149(float64_t) SpecConstantOp 115 529
530(f16_to_d)
:149(float64_t) SpecConstantOp 115 529
531
:172(float16_t) SpecConstantOp 115 526(sf)
531(f_to_f16)
:172(float16_t) SpecConstantOp 115 526(sf)
532
:172(float16_t) SpecConstantOp 115 527(sd)
532(d_to_f16)
:172(float16_t) SpecConstantOp 115 527(sd)
4(main): 2 Function None 3
4(main): 2 Function None 3
5: Label
5: Label
Return
Return
...
...
Test/baseResults/spv.float64.frag.out
View file @
cdf7a85b
...
@@ -103,6 +103,10 @@ error: Capability Float16 is not allowed by Vulkan 1.1 specification (or require
...
@@ -103,6 +103,10 @@ error: Capability Float16 is not allowed by Vulkan 1.1 specification (or require
Name 515 "sf16"
Name 515 "sf16"
Name 517 "sf"
Name 517 "sf"
Name 518 "sd"
Name 518 "sd"
Name 519 "f16_to_f"
Name 521 "f16_to_d"
Name 522 "f_to_f16"
Name 523 "d_to_f16"
Decorate 461(if64v) Flat
Decorate 461(if64v) Flat
Decorate 508 ArrayStride 16
Decorate 508 ArrayStride 16
Decorate 509 ArrayStride 64
Decorate 509 ArrayStride 64
...
@@ -207,11 +211,11 @@ error: Capability Float16 is not allowed by Vulkan 1.1 specification (or require
...
@@ -207,11 +211,11 @@ error: Capability Float16 is not allowed by Vulkan 1.1 specification (or require
516: TypeFloat 32
516: TypeFloat 32
517(sf): 516(float) SpecConstant 1048576000
517(sf): 516(float) SpecConstant 1048576000
518(sd):26(float64_t) SpecConstant 0 1071644672
518(sd):26(float64_t) SpecConstant 0 1071644672
519
: 516(float) SpecConstantOp 115 515(sf16)
519(f16_to_f)
: 516(float) SpecConstantOp 115 515(sf16)
520: 516(float) SpecConstantOp 115 515(sf16)
520: 516(float) SpecConstantOp 115 515(sf16)
521
:26(float64_t) SpecConstantOp 115 520
521(f16_to_d)
:26(float64_t) SpecConstantOp 115 520
522
:162(float16_t) SpecConstantOp 115 517(sf)
522(f_to_f16)
:162(float16_t) SpecConstantOp 115 517(sf)
523
:162(float16_t) SpecConstantOp 115 518(sd)
523(d_to_f16)
:162(float16_t) SpecConstantOp 115 518(sd)
4(main): 2 Function None 3
4(main): 2 Function None 3
5: Label
5: Label
Return
Return
...
...
Test/baseResults/spv.int16.amd.frag.out
View file @
cdf7a85b
...
@@ -76,6 +76,28 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require
...
@@ -76,6 +76,28 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require
Name 526 "sb"
Name 526 "sb"
Name 527 "si16"
Name 527 "si16"
Name 528 "su16"
Name 528 "su16"
Name 529 "i16_to_b"
Name 530 "u16_to_b"
Name 531 "b_to_i16"
Name 532 "b_to_u16"
Name 533 "i16_to_i"
Name 535 "u16_to_i"
Name 536 "i_to_i16"
Name 538 "i_to_u16"
Name 540 "i16_to_u"
Name 541 "u16_to_u"
Name 543 "u_to_i16"
Name 544 "u_to_u16"
Name 545 "i16_to_i64"
Name 548 "u16_to_i64"
Name 549 "i64_to_i16"
Name 551 "i64_to_u16"
Name 553 "i16_to_u64"
Name 554 "u16_to_u64"
Name 556 "u64_to_i16"
Name 557 "u64_to_u16"
Name 558 "i16_to_u16"
Name 559 "u16_to_i16"
MemberDecorate 25(Uniforms) 0 Offset 0
MemberDecorate 25(Uniforms) 0 Offset 0
Decorate 25(Uniforms) Block
Decorate 25(Uniforms) Block
Decorate 27 DescriptorSet 0
Decorate 27 DescriptorSet 0
...
@@ -195,37 +217,37 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require
...
@@ -195,37 +217,37 @@ error: Capability Float16 is not allowed by Vulkan 1.0 specification (or require
526(sb): 125(bool) SpecConstantTrue
526(sb): 125(bool) SpecConstantTrue
527(si16): 17(int16_t) SpecConstant 4294967291
527(si16): 17(int16_t) SpecConstant 4294967291
528(su16): 14(int16_t) SpecConstant 4
528(su16): 14(int16_t) SpecConstant 4
529
: 125(bool) SpecConstantOp 171 527(si16) 202
529(i16_to_b)
: 125(bool) SpecConstantOp 171 527(si16) 202
530
: 125(bool) SpecConstantOp 171 528(su16) 202
530(u16_to_b)
: 125(bool) SpecConstantOp 171 528(su16) 202
531
: 17(int16_t) SpecConstantOp 169 526(sb) 53 194
531(b_to_i16)
: 17(int16_t) SpecConstantOp 169 526(sb) 53 194
532
: 14(int16_t) SpecConstantOp 169 526(sb) 203 202
532(b_to_u16)
: 14(int16_t) SpecConstantOp 169 526(sb) 203 202
533
: 28(int) SpecConstantOp 114 527(si16)
533(i16_to_i)
: 28(int) SpecConstantOp 114 527(si16)
534: 18(int) SpecConstantOp 113 528(su16)
534: 18(int) SpecConstantOp 113 528(su16)
535
: 28(int) SpecConstantOp 128 534 128
535(u16_to_i)
: 28(int) SpecConstantOp 128 534 128
536
: 17(int16_t) SpecConstantOp 114 524(si)
536(i_to_i16)
: 17(int16_t) SpecConstantOp 114 524(si)
537: 17(int16_t) SpecConstantOp 114 524(si)
537: 17(int16_t) SpecConstantOp 114 524(si)
538
: 14(int16_t) SpecConstantOp 128 537 202
538(i_to_u16)
: 14(int16_t) SpecConstantOp 128 537 202
539: 28(int) SpecConstantOp 114 527(si16)
539: 28(int) SpecConstantOp 114 527(si16)
540
: 18(int) SpecConstantOp 128 539 128
540(i16_to_u)
: 18(int) SpecConstantOp 128 539 128
541
: 18(int) SpecConstantOp 113 528(su16)
541(u16_to_u)
: 18(int) SpecConstantOp 113 528(su16)
542: 14(int16_t) SpecConstantOp 113 525(su)
542: 14(int16_t) SpecConstantOp 113 525(su)
543
: 17(int16_t) SpecConstantOp 128 542 202
543(u_to_i16)
: 17(int16_t) SpecConstantOp 128 542 202
544
: 14(int16_t) SpecConstantOp 113 525(su)
544(u_to_u16)
: 14(int16_t) SpecConstantOp 113 525(su)
545
:273(int64_t) SpecConstantOp 114 527(si16)
545(i16_to_i64)
:273(int64_t) SpecConstantOp 114 527(si16)
546:285(int64_t) SpecConstantOp 113 528(su16)
546:285(int64_t) SpecConstantOp 113 528(su16)
547:285(int64_t) Constant 0 0
547:285(int64_t) Constant 0 0
548
:273(int64_t) SpecConstantOp 128 546 547
548(u16_to_i64)
:273(int64_t) SpecConstantOp 128 546 547
549
: 17(int16_t) SpecConstantOp 114 522(si64)
549(i64_to_i16)
: 17(int16_t) SpecConstantOp 114 522(si64)
550: 17(int16_t) SpecConstantOp 114 522(si64)
550: 17(int16_t) SpecConstantOp 114 522(si64)
551
: 14(int16_t) SpecConstantOp 128 550 202
551(i64_to_u16)
: 14(int16_t) SpecConstantOp 128 550 202
552:273(int64_t) SpecConstantOp 114 527(si16)
552:273(int64_t) SpecConstantOp 114 527(si16)
553
:285(int64_t) SpecConstantOp 128 552 547
553(i16_to_u64)
:285(int64_t) SpecConstantOp 128 552 547
554
:285(int64_t) SpecConstantOp 113 528(su16)
554(u16_to_u64)
:285(int64_t) SpecConstantOp 113 528(su16)
555: 14(int16_t) SpecConstantOp 113 523(su64)
555: 14(int16_t) SpecConstantOp 113 523(su64)
556
: 17(int16_t) SpecConstantOp 128 555 202
556(u64_to_i16)
: 17(int16_t) SpecConstantOp 128 555 202
557
: 14(int16_t) SpecConstantOp 113 523(su64)
557(u64_to_u16)
: 14(int16_t) SpecConstantOp 113 523(su64)
558
: 14(int16_t) SpecConstantOp 128 527(si16) 202
558(i16_to_u16)
: 14(int16_t) SpecConstantOp 128 527(si16) 202
559
: 17(int16_t) SpecConstantOp 128 528(su16) 202
559(u16_to_i16)
: 17(int16_t) SpecConstantOp 128 528(su16) 202
4(main): 2 Function None 3
4(main): 2 Function None 3
5: Label
5: Label
511: 2 FunctionCall 6(literal()
511: 2 FunctionCall 6(literal()
...
...
Test/baseResults/spv.int64.frag.out
View file @
cdf7a85b
spv.int64.frag
spv.int64.frag
error: SPIRV-Tools Validation Errors
error: OpDecorate SpecId decoration target <id> '1' is not a scalar specialization constant.
OpDecorate %su64inc SpecId 105
// Module Version 10000
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80007
// Id's are bound by 48
8
// Id's are bound by 48
9
Capability Shader
Capability Shader
Capability Float64
Capability Float64
...
@@ -55,6 +59,21 @@ spv.int64.frag
...
@@ -55,6 +59,21 @@ spv.int64.frag
Name 467 "si"
Name 467 "si"
Name 468 "su"
Name 468 "su"
Name 469 "sb"
Name 469 "sb"
Name 470 "su64inc"
Name 471 "i64_to_b"
Name 472 "u64_to_b"
Name 473 "b_to_i64"
Name 474 "b_to_u64"
Name 475 "i64_to_i"
Name 476 "i_to_i64"
Name 477 "u64_to_u"
Name 478 "u_to_u64"
Name 479 "u64_to_i64"
Name 480 "i64_to_u64"
Name 482 "u64_to_i"
Name 484 "i_to_u64"
Name 486 "i64_to_u"
Name 488 "u_to_i64"
MemberDecorate 28(Uniforms) 0 Offset 0
MemberDecorate 28(Uniforms) 0 Offset 0
Decorate 28(Uniforms) Block
Decorate 28(Uniforms) Block
Decorate 30 DescriptorSet 0
Decorate 30 DescriptorSet 0
...
@@ -69,6 +88,7 @@ spv.int64.frag
...
@@ -69,6 +88,7 @@ spv.int64.frag
Decorate 467(si) SpecId 102
Decorate 467(si) SpecId 102
Decorate 468(su) SpecId 103
Decorate 468(su) SpecId 103
Decorate 469(sb) SpecId 104
Decorate 469(sb) SpecId 104
Decorate 470(su64inc) SpecId 105
2: TypeVoid
2: TypeVoid
3: TypeFunction 2
3: TypeFunction 2
14: TypeInt 64 0
14: TypeInt 64 0
...
@@ -157,24 +177,25 @@ spv.int64.frag
...
@@ -157,24 +177,25 @@ spv.int64.frag
467(si): 31(int) SpecConstant 4294967291
467(si): 31(int) SpecConstant 4294967291
468(su): 21(int) SpecConstant 4
468(su): 21(int) SpecConstant 4
469(sb): 55(bool) SpecConstantTrue
469(sb): 55(bool) SpecConstantTrue
470: 55(bool) SpecConstantOp 171 465(si64) 69
470(su64inc): 14(int64_t) SpecConstantOp 128 466(su64) 70
471: 55(bool) SpecConstantOp 171 466(su64) 69
471(i64_to_b): 55(bool) SpecConstantOp 171 465(si64) 69
472: 18(int64_t) SpecConstantOp 169 469(sb) 61 60
472(u64_to_b): 55(bool) SpecConstantOp 171 466(su64) 69
473: 14(int64_t) SpecConstantOp 169 469(sb) 70 69
473(b_to_i64): 18(int64_t) SpecConstantOp 169 469(sb) 61 60
474: 31(int) SpecConstantOp 114 465(si64)
474(b_to_u64): 14(int64_t) SpecConstantOp 169 469(sb) 70 69
475: 18(int64_t) SpecConstantOp 114 467(si)
475(i64_to_i): 31(int) SpecConstantOp 114 465(si64)
476: 21(int) SpecConstantOp 113 466(su64)
476(i_to_i64): 18(int64_t) SpecConstantOp 114 467(si)
477: 14(int64_t) SpecConstantOp 113 468(su)
477(u64_to_u): 21(int) SpecConstantOp 113 466(su64)
478: 18(int64_t) SpecConstantOp 128 466(su64) 69
478(u_to_u64): 14(int64_t) SpecConstantOp 113 468(su)
479: 14(int64_t) SpecConstantOp 128 465(si64) 69
479(u64_to_i64): 18(int64_t) SpecConstantOp 128 466(su64) 69
480: 21(int) SpecConstantOp 113 466(su64)
480(i64_to_u64): 14(int64_t) SpecConstantOp 128 465(si64) 69
481: 31(int) SpecConstantOp 128 480 227
481: 21(int) SpecConstantOp 113 466(su64)
482: 18(int64_t) SpecConstantOp 114 467(si)
482(u64_to_i): 31(int) SpecConstantOp 128 481 227
483: 14(int64_t) SpecConstantOp 128 482 69
483: 18(int64_t) SpecConstantOp 114 467(si)
484: 31(int) SpecConstantOp 114 465(si64)
484(i_to_u64): 14(int64_t) SpecConstantOp 128 483 69
485: 21(int) SpecConstantOp 128 484 227
485: 31(int) SpecConstantOp 114 465(si64)
486: 14(int64_t) SpecConstantOp 113 468(su)
486(i64_to_u): 21(int) SpecConstantOp 128 485 227
487: 18(int64_t) SpecConstantOp 128 486 69
487: 14(int64_t) SpecConstantOp 113 468(su)
488(u_to_i64): 18(int64_t) SpecConstantOp 128 487 69
4(main): 2 Function None 3
4(main): 2 Function None 3
5: Label
5: Label
Store 16(u64Max) 17
Store 16(u64Max) 17
...
...
Test/baseResults/spv.specConstantOperations.vert.out
View file @
cdf7a85b
...
@@ -18,10 +18,68 @@ spv.specConstantOperations.vert
...
@@ -18,10 +18,68 @@ spv.specConstantOperations.vert
Name 42 "sp_uint"
Name 42 "sp_uint"
Name 43 "sp_sint"
Name 43 "sp_sint"
Name 45 "sp_double"
Name 45 "sp_double"
Name 46 "float_from_double"
Name 47 "double_from_float"
Name 49 "bool_from_int"
Name 50 "bool_from_uint"
Name 51 "int_from_bool"
Name 53 "uint_from_bool"
Name 54 "sp_uint_from_sint"
Name 55 "sp_sint_from_uint"
Name 56 "negate_int"
Name 57 "not_int"
Name 58 "sp_int_add_two"
Name 61 "sp_int_add_two_sub_three"
Name 63 "sp_int_add_two_sub_four"
Name 64 "sp_sint_mul_two"
Name 66 "sp_uint_mul_two"
Name 68 "sp_sint_mul_two_div_five"
Name 70 "sp_uint_mul_two_div_five"
Name 71 "sp_sint_rem_four"
Name 73 "sp_uint_rem_four"
Name 75 "sp_sint_mul_three_div_five"
Name 77 "sp_sint_shift_right_arithmetic"
Name 79 "sp_uint_shift_right_arithmetic"
Name 80 "sp_sint_shift_left"
Name 81 "sp_uint_shift_left"
Name 83 "sp_sint_or_256"
Name 85 "sp_uint_xor_512"
Name 86 "sp_int_lt_sp_sint"
Name 87 "sp_uint_equal_sp_uint"
Name 88 "sp_int_gt_sp_sint"
Name 91 "iv"
Name 95 "uv"
Name 98 "bv_from_iv"
Name 99 "bv_from_uv"
Name 102 "iv_from_bv"
Name 104 "uv_from_bv"
Name 105 "uv_from_iv"
Name 106 "iv_from_uv"
Name 107 "not_iv"
Name 108 "negate_iv"
Name 110 "iv_add_two"
Name 113 "iv_add_two_sub_three"
Name 115 "iv_add_two_sub_four"
Name 116 "iv_mul_two"
Name 118 "iv_mul_two_div_five"
Name 119 "iv_rem_four"
Name 121 "iv_shift_right_arithmetic"
Name 122 "iv_shift_left"
Name 125 "iv_or_1024"
Name 128 "uv_xor_2048"
Name 129 "iv_x"
Name 131 "iv_yx"
Name 133 "iv_zyx"
Name 134 "iv_yzxw"
Name 135 "a"
Name 135 "a"
Name 136 "b"
Name 136 "b"
Name 137 "c"
Name 137 "c"
Name 142 "ternayArray1"
Name 142 "ternayArray1"
Name 145 "t1"
Name 146 "t2"
Name 148 "t3"
Name 152 "t4"
Name 161 "v2"
Decorate 19(sp_int) SpecId 201
Decorate 19(sp_int) SpecId 201
Decorate 40(sp_float) SpecId 200
Decorate 40(sp_float) SpecId 200
Decorate 42(sp_uint) SpecId 202
Decorate 42(sp_uint) SpecId 202
...
@@ -53,95 +111,95 @@ spv.specConstantOperations.vert
...
@@ -53,95 +111,95 @@ spv.specConstantOperations.vert
43(sp_sint): 6(int) SpecConstant 4294967286
43(sp_sint): 6(int) SpecConstant 4294967286
44: TypeFloat 64
44: TypeFloat 64
45(sp_double):44(float64_t) SpecConstant 2333366019 1074118410
45(sp_double):44(float64_t) SpecConstant 2333366019 1074118410
46
: 39(float) SpecConstantOp 115 45(sp_double)
46(float_from_double)
: 39(float) SpecConstantOp 115 45(sp_double)
47
:44(float64_t) SpecConstantOp 115 40(sp_float)
47(double_from_float)
:44(float64_t) SpecConstantOp 115 40(sp_float)
48: 41(int) Constant 0
48: 41(int) Constant 0
49
: 22(bool) SpecConstantOp 171 19(sp_int) 48
49(bool_from_int)
: 22(bool) SpecConstantOp 171 19(sp_int) 48
50
: 22(bool) SpecConstantOp 171 42(sp_uint) 48
50(bool_from_uint)
: 22(bool) SpecConstantOp 171 42(sp_uint) 48
51: 6(int) SpecConstantOp 169 49
32 12
51(int_from_bool): 6(int) SpecConstantOp 169 49(bool_from_int)
32 12
52: 41(int) Constant 1
52: 41(int) Constant 1
53: 41(int) SpecConstantOp 169 49
52 48
53(uint_from_bool): 41(int) SpecConstantOp 169 49(bool_from_int)
52 48
54
: 41(int) SpecConstantOp 128 43(sp_sint) 48
54(sp_uint_from_sint)
: 41(int) SpecConstantOp 128 43(sp_sint) 48
55
: 6(int) SpecConstantOp 128 42(sp_uint) 48
55(sp_sint_from_uint)
: 6(int) SpecConstantOp 128 42(sp_uint) 48
56
: 6(int) SpecConstantOp 126 19(sp_int)
56(negate_int)
: 6(int) SpecConstantOp 126 19(sp_int)
57
: 6(int) SpecConstantOp 200 19(sp_int)
57(not_int)
: 6(int) SpecConstantOp 200 19(sp_int)
58
: 6(int) SpecConstantOp 128 19(sp_int) 20
58(sp_int_add_two)
: 6(int) SpecConstantOp 128 19(sp_int) 20
59: 6(int) SpecConstantOp 128 19(sp_int) 20
59: 6(int) SpecConstantOp 128 19(sp_int) 20
60: 6(int) Constant 3
60: 6(int) Constant 3
61
: 6(int) SpecConstantOp 130 59 60
61(sp_int_add_two_sub_three)
: 6(int) SpecConstantOp 130 59 60
62: 6(int) Constant 4
62: 6(int) Constant 4
63: 6(int) SpecConstantOp 130 58
62
63(sp_int_add_two_sub_four): 6(int) SpecConstantOp 130 58(sp_int_add_two)
62
64
: 6(int) SpecConstantOp 132 43(sp_sint) 20
64(sp_sint_mul_two)
: 6(int) SpecConstantOp 132 43(sp_sint) 20
65: 41(int) Constant 2
65: 41(int) Constant 2
66
: 41(int) SpecConstantOp 132 42(sp_uint) 65
66(sp_uint_mul_two)
: 41(int) SpecConstantOp 132 42(sp_uint) 65
67: 6(int) Constant 5
67: 6(int) Constant 5
68: 6(int) SpecConstantOp 135 64
67
68(sp_sint_mul_two_div_five): 6(int) SpecConstantOp 135 64(sp_sint_mul_two)
67
69: 41(int) Constant 5
69: 41(int) Constant 5
70: 41(int) SpecConstantOp 134 66
69
70(sp_uint_mul_two_div_five): 41(int) SpecConstantOp 134 66(sp_uint_mul_two)
69
71
: 6(int) SpecConstantOp 139 43(sp_sint) 62
71(sp_sint_rem_four)
: 6(int) SpecConstantOp 139 43(sp_sint) 62
72: 41(int) Constant 4
72: 41(int) Constant 4
73
: 41(int) SpecConstantOp 137 42(sp_uint) 72
73(sp_uint_rem_four)
: 41(int) SpecConstantOp 137 42(sp_uint) 72
74: 6(int) SpecConstantOp 132 43(sp_sint) 60
74: 6(int) SpecConstantOp 132 43(sp_sint) 60
75
: 6(int) SpecConstantOp 135 74 67
75(sp_sint_mul_three_div_five)
: 6(int) SpecConstantOp 135 74 67
76: 6(int) Constant 10
76: 6(int) Constant 10
77
: 6(int) SpecConstantOp 195 43(sp_sint) 76
77(sp_sint_shift_right_arithmetic)
: 6(int) SpecConstantOp 195 43(sp_sint) 76
78: 6(int) Constant 20
78: 6(int) Constant 20
79
: 41(int) SpecConstantOp 194 42(sp_uint) 78
79(sp_uint_shift_right_arithmetic)
: 41(int) SpecConstantOp 194 42(sp_uint) 78
80
: 6(int) SpecConstantOp 196 43(sp_sint) 32
80(sp_sint_shift_left)
: 6(int) SpecConstantOp 196 43(sp_sint) 32
81
: 41(int) SpecConstantOp 196 42(sp_uint) 20
81(sp_uint_shift_left)
: 41(int) SpecConstantOp 196 42(sp_uint) 20
82: 6(int) Constant 256
82: 6(int) Constant 256
83
: 6(int) SpecConstantOp 197 43(sp_sint) 82
83(sp_sint_or_256)
: 6(int) SpecConstantOp 197 43(sp_sint) 82
84: 41(int) Constant 512
84: 41(int) Constant 512
85
: 41(int) SpecConstantOp 198 42(sp_uint) 84
85(sp_uint_xor_512)
: 41(int) SpecConstantOp 198 42(sp_uint) 84
86
: 22(bool) SpecConstantOp 177 19(sp_int) 43(sp_sint)
86(sp_int_lt_sp_sint)
: 22(bool) SpecConstantOp 177 19(sp_int) 43(sp_sint)
87
: 22(bool) SpecConstantOp 170 42(sp_uint) 42(sp_uint)
87(sp_uint_equal_sp_uint)
: 22(bool) SpecConstantOp 170 42(sp_uint) 42(sp_uint)
88
: 22(bool) SpecConstantOp 173 19(sp_int) 43(sp_sint)
88(sp_int_gt_sp_sint)
: 22(bool) SpecConstantOp 173 19(sp_int) 43(sp_sint)
89: 6(int) Constant 30
89: 6(int) Constant 30
90: TypeVector 6(int) 4
90: TypeVector 6(int) 4
91
: 90(ivec4) SpecConstantComposite 78 89 19(sp_int) 19(sp_int)
91(iv)
: 90(ivec4) SpecConstantComposite 78 89 19(sp_int) 19(sp_int)
92: 41(int) Constant 4294967295
92: 41(int) Constant 4294967295
93: 41(int) Constant 4294967294
93: 41(int) Constant 4294967294
94: TypeVector 41(int) 4
94: TypeVector 41(int) 4
95
: 94(ivec4) SpecConstantComposite 42(sp_uint) 42(sp_uint) 92 93
95(uv)
: 94(ivec4) SpecConstantComposite 42(sp_uint) 42(sp_uint) 92 93
96: TypeVector 22(bool) 4
96: TypeVector 22(bool) 4
97: 94(ivec4) ConstantComposite 48 48 48 48
97: 94(ivec4) ConstantComposite 48 48 48 48
98: 96(bvec4) SpecConstantOp 171 91
97
98(bv_from_iv): 96(bvec4) SpecConstantOp 171 91(iv)
97
99: 96(bvec4) SpecConstantOp 171 95
97
99(bv_from_uv): 96(bvec4) SpecConstantOp 171 95(uv)
97
100: 90(ivec4) ConstantComposite 12 12 12 12
100: 90(ivec4) ConstantComposite 12 12 12 12
101: 90(ivec4) ConstantComposite 32 32 32 32
101: 90(ivec4) ConstantComposite 32 32 32 32
102: 90(ivec4) SpecConstantOp 169 98
101 100
102(iv_from_bv): 90(ivec4) SpecConstantOp 169 98(bv_from_iv)
101 100
103: 94(ivec4) ConstantComposite 52 52 52 52
103: 94(ivec4) ConstantComposite 52 52 52 52
104: 94(ivec4) SpecConstantOp 169 98
103 97
104(uv_from_bv): 94(ivec4) SpecConstantOp 169 98(bv_from_iv)
103 97
105: 94(ivec4) SpecConstantOp 128 91
97
105(uv_from_iv): 94(ivec4) SpecConstantOp 128 91(iv)
97
106: 90(ivec4) SpecConstantOp 128 95
97
106(iv_from_uv): 90(ivec4) SpecConstantOp 128 95(uv)
97
107: 90(ivec4) SpecConstantOp 200 91
107(not_iv): 90(ivec4) SpecConstantOp 200 91(iv)
108: 90(ivec4) SpecConstantOp 126 91
108(negate_iv): 90(ivec4) SpecConstantOp 126 91(iv)
109: 90(ivec4) ConstantComposite 20 20 20 20
109: 90(ivec4) ConstantComposite 20 20 20 20
110: 90(ivec4) SpecConstantOp 128 91
109
110(iv_add_two): 90(ivec4) SpecConstantOp 128 91(iv)
109
111: 90(ivec4) SpecConstantOp 128 91 109
111: 90(ivec4) SpecConstantOp 128 91
(iv)
109
112: 90(ivec4) ConstantComposite 60 60 60 60
112: 90(ivec4) ConstantComposite 60 60 60 60
113
: 90(ivec4) SpecConstantOp 130 111 112
113(iv_add_two_sub_three)
: 90(ivec4) SpecConstantOp 130 111 112
114: 90(ivec4) ConstantComposite 62 62 62 62
114: 90(ivec4) ConstantComposite 62 62 62 62
115: 90(ivec4) SpecConstantOp 130 113
114
115(iv_add_two_sub_four): 90(ivec4) SpecConstantOp 130 113(iv_add_two_sub_three)
114
116: 90(ivec4) SpecConstantOp 132 91
109
116(iv_mul_two): 90(ivec4) SpecConstantOp 132 91(iv)
109
117: 90(ivec4) ConstantComposite 67 67 67 67
117: 90(ivec4) ConstantComposite 67 67 67 67
118: 90(ivec4) SpecConstantOp 135 116
117
118(iv_mul_two_div_five): 90(ivec4) SpecConstantOp 135 116(iv_mul_two)
117
119: 90(ivec4) SpecConstantOp 139 91
114
119(iv_rem_four): 90(ivec4) SpecConstantOp 139 91(iv)
114
120: 90(ivec4) ConstantComposite 76 76 76 76
120: 90(ivec4) ConstantComposite 76 76 76 76
121: 90(ivec4) SpecConstantOp 195 91
120
121(iv_shift_right_arithmetic): 90(ivec4) SpecConstantOp 195 91(iv)
120
122: 90(ivec4) SpecConstantOp 196 91
109
122(iv_shift_left): 90(ivec4) SpecConstantOp 196 91(iv)
109
123: 6(int) Constant 1024
123: 6(int) Constant 1024
124: 90(ivec4) ConstantComposite 123 123 123 123
124: 90(ivec4) ConstantComposite 123 123 123 123
125: 90(ivec4) SpecConstantOp 197 91
124
125(iv_or_1024): 90(ivec4) SpecConstantOp 197 91(iv)
124
126: 41(int) Constant 2048
126: 41(int) Constant 2048
127: 94(ivec4) ConstantComposite 126 126 126 126
127: 94(ivec4) ConstantComposite 126 126 126 126
128: 94(ivec4) SpecConstantOp 198 95
127
128(uv_xor_2048): 94(ivec4) SpecConstantOp 198 95(uv)
127
129: 6(int) SpecConstantOp 81 91
0
129(iv_x): 6(int) SpecConstantOp 81 91(iv)
0
130: TypeVector 6(int) 2
130: TypeVector 6(int) 2
131: 130(ivec2) SpecConstantOp 79 91 91
1(GLSL.std.450) 0
131(iv_yx): 130(ivec2) SpecConstantOp 79 91(iv) 91(iv)
1(GLSL.std.450) 0
132: TypeVector 6(int) 3
132: TypeVector 6(int) 3
133: 132(ivec3) SpecConstantOp 79 91 91
2 1(GLSL.std.450) 0
133(iv_zyx): 132(ivec3) SpecConstantOp 79 91(iv) 91(iv)
2 1(GLSL.std.450) 0
134: 90(ivec4) SpecConstantOp 79 91 91
1(GLSL.std.450) 2 0 3
134(iv_yzxw): 90(ivec4) SpecConstantOp 79 91(iv) 91(iv)
1(GLSL.std.450) 2 0 3
135(a): 6(int) SpecConstant 4
135(a): 6(int) SpecConstant 4
136(b): 6(int) SpecConstant 6
136(b): 6(int) SpecConstant 6
137(c): 22(bool) SpecConstantTrue
137(c): 22(bool) SpecConstantTrue
...
@@ -152,14 +210,14 @@ spv.specConstantOperations.vert
...
@@ -152,14 +210,14 @@ spv.specConstantOperations.vert
142(ternayArray1): 141(ptr) Variable Private
142(ternayArray1): 141(ptr) Variable Private
143: 6(int) Constant 13
143: 6(int) Constant 13
144: 6(int) Constant 17
144: 6(int) Constant 17
145
: 6(int) SpecConstantOp 169 137(c) 143 144
145(t1)
: 6(int) SpecConstantOp 169 137(c) 143 144
146
: 6(int) SpecConstantOp 169 137(c) 135(a) 144
146(t2)
: 6(int) SpecConstantOp 169 137(c) 135(a) 144
147: 22(bool) ConstantTrue
147: 22(bool) ConstantTrue
148
: 6(int) SpecConstantOp 169 147 135(a) 144
148(t3)
: 6(int) SpecConstantOp 169 147 135(a) 144
149: 22(bool) SpecConstantOp 173 135(a) 136(b)
149: 22(bool) SpecConstantOp 173 135(a) 136(b)
150: 6(int) SpecConstantOp 128 143 135(a)
150: 6(int) SpecConstantOp 128 143 135(a)
151: 6(int) SpecConstantOp 132 144 136(b)
151: 6(int) SpecConstantOp 132 144 136(b)
152
: 6(int) SpecConstantOp 169 149 150 151
152(t4)
: 6(int) SpecConstantOp 169 149 150 151
153: 22(bool) SpecConstantOp 168 137(c)
153: 22(bool) SpecConstantOp 168 137(c)
154: TypeVector 39(float) 2
154: TypeVector 39(float) 2
155: 39(float) Constant 1065353216
155: 39(float) Constant 1065353216
...
@@ -168,7 +226,7 @@ spv.specConstantOperations.vert
...
@@ -168,7 +226,7 @@ spv.specConstantOperations.vert
158: 154(fvec2) ConstantComposite 157 157
158: 154(fvec2) ConstantComposite 157 157
159: TypeVector 22(bool) 2
159: TypeVector 22(bool) 2
160: 159(bvec2) SpecConstantComposite 153 153
160: 159(bvec2) SpecConstantComposite 153 153
161
: 154(fvec2) SpecConstantOp 169 160 156 158
161(v2)
: 154(fvec2) SpecConstantOp 169 160 156 158
4(main): 2 Function None 3
4(main): 2 Function None 3
5: Label
5: Label
Return
Return
...
...
Test/spv.int64.frag
View file @
cdf7a85b
...
@@ -236,6 +236,7 @@ layout(constant_id = 101) const uint64_t su64 = 20UL;
...
@@ -236,6 +236,7 @@ layout(constant_id = 101) const uint64_t su64 = 20UL;
layout
(
constant_id
=
102
)
const
int
si
=
-
5
;
layout
(
constant_id
=
102
)
const
int
si
=
-
5
;
layout
(
constant_id
=
103
)
const
uint
su
=
4
;
layout
(
constant_id
=
103
)
const
uint
su
=
4
;
layout
(
constant_id
=
104
)
const
bool
sb
=
true
;
layout
(
constant_id
=
104
)
const
bool
sb
=
true
;
layout
(
constant_id
=
105
)
const
uint64_t
su64inc
=
su64
+
1UL
;
// bool <-> int64/uint64
// bool <-> int64/uint64
const
bool
i64_to_b
=
bool
(
si64
);
const
bool
i64_to_b
=
bool
(
si64
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment