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
18958f6c
Commit
18958f6c
authored
Mar 30, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: Fix #802: Preserve promoted child under ! operator.
parent
7e997e26
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
254 additions
and
4 deletions
+254
-4
hlsl.logicalConvert.frag.out
Test/baseResults/hlsl.logicalConvert.frag.out
+233
-0
hlsl.logicalConvert.frag
Test/hlsl.logicalConvert.frag
+16
-0
Intermediate.cpp
glslang/MachineIndependent/Intermediate.cpp
+3
-3
Hlsl.FromFile.cpp
gtests/Hlsl.FromFile.cpp
+2
-1
No files found.
Test/baseResults/hlsl.logicalConvert.frag.out
0 → 100755
View file @
18958f6c
hlsl.logicalConvert.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:2 Function Definition: @main( ( temp 4-component vector of float)
0:2 Function Parameters:
0:? Sequence
0:3 Test condition and select ( temp void)
0:3 Condition
0:3 Constant:
0:3 false (const bool)
0:3 true case
0:4 Branch: Return with expression
0:4 Constant:
0:4 0.000000
0:4 0.000000
0:4 0.000000
0:4 0.000000
0:5 Test condition and select ( temp void)
0:5 Condition
0:5 Constant:
0:5 false (const bool)
0:5 true case
0:6 Branch: Return with expression
0:6 Constant:
0:6 0.000000
0:6 0.000000
0:6 0.000000
0:6 0.000000
0:7 Test condition and select ( temp void)
0:7 Condition
0:7 Constant:
0:7 true (const bool)
0:7 true case
0:8 Branch: Return with expression
0:8 Constant:
0:8 0.000000
0:8 0.000000
0:8 0.000000
0:8 0.000000
0:9 Test condition and select ( temp void)
0:9 Condition
0:9 Constant:
0:9 true (const bool)
0:9 true case
0:10 Branch: Return with expression
0:10 Constant:
0:10 0.000000
0:10 0.000000
0:10 0.000000
0:10 0.000000
0:11 Test condition and select ( temp void)
0:11 Condition
0:11 Constant:
0:11 false (const bool)
0:11 true case
0:12 Branch: Return with expression
0:12 Constant:
0:12 0.000000
0:12 0.000000
0:12 0.000000
0:12 0.000000
0:13 Test condition and select ( temp void)
0:13 Condition
0:13 Constant:
0:13 false (const bool)
0:13 true case
0:14 Branch: Return with expression
0:14 Constant:
0:14 0.000000
0:14 0.000000
0:14 0.000000
0:14 0.000000
0:2 Function Definition: main( ( temp void)
0:2 Function Parameters:
0:? Sequence
0:2 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:2 Function Call: @main( ( temp 4-component vector of float)
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:2 Function Definition: @main( ( temp 4-component vector of float)
0:2 Function Parameters:
0:? Sequence
0:3 Test condition and select ( temp void)
0:3 Condition
0:3 Constant:
0:3 false (const bool)
0:3 true case
0:4 Branch: Return with expression
0:4 Constant:
0:4 0.000000
0:4 0.000000
0:4 0.000000
0:4 0.000000
0:5 Test condition and select ( temp void)
0:5 Condition
0:5 Constant:
0:5 false (const bool)
0:5 true case
0:6 Branch: Return with expression
0:6 Constant:
0:6 0.000000
0:6 0.000000
0:6 0.000000
0:6 0.000000
0:7 Test condition and select ( temp void)
0:7 Condition
0:7 Constant:
0:7 true (const bool)
0:7 true case
0:8 Branch: Return with expression
0:8 Constant:
0:8 0.000000
0:8 0.000000
0:8 0.000000
0:8 0.000000
0:9 Test condition and select ( temp void)
0:9 Condition
0:9 Constant:
0:9 true (const bool)
0:9 true case
0:10 Branch: Return with expression
0:10 Constant:
0:10 0.000000
0:10 0.000000
0:10 0.000000
0:10 0.000000
0:11 Test condition and select ( temp void)
0:11 Condition
0:11 Constant:
0:11 false (const bool)
0:11 true case
0:12 Branch: Return with expression
0:12 Constant:
0:12 0.000000
0:12 0.000000
0:12 0.000000
0:12 0.000000
0:13 Test condition and select ( temp void)
0:13 Condition
0:13 Constant:
0:13 false (const bool)
0:13 true case
0:14 Branch: Return with expression
0:14 Constant:
0:14 0.000000
0:14 0.000000
0:14 0.000000
0:14 0.000000
0:2 Function Definition: main( ( temp void)
0:2 Function Parameters:
0:? Sequence
0:2 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:2 Function Call: @main( ( temp 4-component vector of float)
0:? Linker Objects
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 38
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 36
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "@main("
Name 36 "@entryPointOutput"
Decorate 36(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypeFunction 7(fvec4)
11: TypeBool
12: 11(bool) ConstantFalse
15: 6(float) Constant 0
16: 7(fvec4) ConstantComposite 15 15 15 15
21: 11(bool) ConstantTrue
35: TypePointer Output 7(fvec4)
36(@entryPointOutput): 35(ptr) Variable Output
4(main): 2 Function None 3
5: Label
37: 7(fvec4) FunctionCall 9(@main()
Store 36(@entryPointOutput) 37
Return
FunctionEnd
9(@main(): 7(fvec4) Function None 8
10: Label
SelectionMerge 14 None
BranchConditional 12 13 14
13: Label
ReturnValue 16
14: Label
SelectionMerge 19 None
BranchConditional 12 18 19
18: Label
ReturnValue 16
19: Label
SelectionMerge 23 None
BranchConditional 21 22 23
22: Label
ReturnValue 16
23: Label
SelectionMerge 26 None
BranchConditional 21 25 26
25: Label
ReturnValue 16
26: Label
SelectionMerge 29 None
BranchConditional 12 28 29
28: Label
ReturnValue 16
29: Label
SelectionMerge 32 None
BranchConditional 12 31 32
31: Label
ReturnValue 16
32: Label
34: 7(fvec4) Undef
ReturnValue 34
FunctionEnd
Test/hlsl.logicalConvert.frag
0 → 100755
View file @
18958f6c
float4
main
()
:
SV_TARGET
{
if
(
!
(
0
)
&&
(
0
)
||
(
!
1
))
return
0
.
0
.
xxxx
;
if
(
0
)
return
0
.
0
.
xxxx
;
if
(
!
(
bool
)
0
)
return
0
.
0
.
xxxx
;
if
(
!
0
)
return
0
.
0
.
xxxx
;
if
(
!
(
bool
)
1
)
return
0
.
0
.
xxxx
;
if
(
!
1
)
return
0
.
0
.
xxxx
;
}
\ No newline at end of file
glslang/MachineIndependent/Intermediate.cpp
View file @
18958f6c
...
@@ -356,12 +356,12 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo
...
@@ -356,12 +356,12 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo
node
->
updatePrecision
();
node
->
updatePrecision
();
// If it's a (non-specialization) constant, it must be folded.
// If it's a (non-specialization) constant, it must be folded.
if
(
child
->
getAsConstantUnion
())
if
(
node
->
getOperand
()
->
getAsConstantUnion
())
return
child
->
getAsConstantUnion
()
->
fold
(
op
,
node
->
getType
());
return
node
->
getOperand
()
->
getAsConstantUnion
()
->
fold
(
op
,
node
->
getType
());
// If it's a specialization constant, the result is too,
// If it's a specialization constant, the result is too,
// if the operation is allowed for specialization constants.
// if the operation is allowed for specialization constants.
if
(
child
->
getType
().
getQualifier
().
isSpecConstant
()
&&
isSpecializationOperation
(
*
node
))
if
(
node
->
getOperand
()
->
getType
().
getQualifier
().
isSpecConstant
()
&&
isSpecializationOperation
(
*
node
))
node
->
getWritableType
().
getQualifier
().
makeSpecConstant
();
node
->
getWritableType
().
getQualifier
().
makeSpecConstant
();
return
node
;
return
node
;
...
...
gtests/Hlsl.FromFile.cpp
View file @
18958f6c
...
@@ -159,9 +159,10 @@ INSTANTIATE_TEST_CASE_P(
...
@@ -159,9 +159,10 @@ INSTANTIATE_TEST_CASE_P(
{
"hlsl.load.rwtexture.array.dx10.frag"
,
"main"
},
{
"hlsl.load.rwtexture.array.dx10.frag"
,
"main"
},
{
"hlsl.load.offset.dx10.frag"
,
"main"
},
{
"hlsl.load.offset.dx10.frag"
,
"main"
},
{
"hlsl.load.offsetarray.dx10.frag"
,
"main"
},
{
"hlsl.load.offsetarray.dx10.frag"
,
"main"
},
{
"hlsl.logical.unary.frag"
,
"main"
},
{
"hlsl.logical.binary.frag"
,
"main"
},
{
"hlsl.logical.binary.frag"
,
"main"
},
{
"hlsl.logical.binary.vec.frag"
,
"main"
},
{
"hlsl.logical.binary.vec.frag"
,
"main"
},
{
"hlsl.logicalConvert.frag"
,
"main"
},
{
"hlsl.logical.unary.frag"
,
"main"
},
{
"hlsl.namespace.frag"
,
"main"
},
{
"hlsl.namespace.frag"
,
"main"
},
{
"hlsl.matNx1.frag"
,
"main"
},
{
"hlsl.matNx1.frag"
,
"main"
},
{
"hlsl.matrixSwizzle.vert"
,
"ShaderFunction"
},
{
"hlsl.matrixSwizzle.vert"
,
"ShaderFunction"
},
...
...
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