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
2051815b
Commit
2051815b
authored
Apr 12, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: Fix #803: Add shape conversions to the constant-initializer path.
parent
a8b217fd
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
9 deletions
+29
-9
hlsl.shapeConv.frag.out
Test/baseResults/hlsl.shapeConv.frag.out
+21
-6
hlsl.shapeConv.frag
Test/hlsl.shapeConv.frag
+3
-1
revision.h
glslang/Include/revision.h
+1
-1
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+4
-1
No files found.
Test/baseResults/hlsl.shapeConv.frag.out
View file @
2051815b
...
@@ -108,8 +108,14 @@ gl_FragCoord origin is upper left
...
@@ -108,8 +108,14 @@ gl_FragCoord origin is upper left
0:29 Construct vec3 ( temp 3-component vector of float)
0:29 Construct vec3 ( temp 3-component vector of float)
0:29 Construct float ( temp float)
0:29 Construct float ( temp float)
0:29 'f1' ( temp 1-component vector of float)
0:29 'f1' ( temp 1-component vector of float)
0:31 Branch: Return with expression
0:33 Branch: Return with expression
0:31 'input' ( in 4-component vector of float)
0:33 component-wise multiply ( temp 4-component vector of float)
0:33 'input' ( in 4-component vector of float)
0:33 Constant:
0:33 3.000000
0:33 3.000000
0:33 3.000000
0:33 3.000000
0:? Linker Objects
0:? Linker Objects
...
@@ -226,13 +232,19 @@ gl_FragCoord origin is upper left
...
@@ -226,13 +232,19 @@ gl_FragCoord origin is upper left
0:29 Construct vec3 ( temp 3-component vector of float)
0:29 Construct vec3 ( temp 3-component vector of float)
0:29 Construct float ( temp float)
0:29 Construct float ( temp float)
0:29 'f1' ( temp 1-component vector of float)
0:29 'f1' ( temp 1-component vector of float)
0:31 Branch: Return with expression
0:33 Branch: Return with expression
0:31 'input' ( in 4-component vector of float)
0:33 component-wise multiply ( temp 4-component vector of float)
0:33 'input' ( in 4-component vector of float)
0:33 Constant:
0:33 3.000000
0:33 3.000000
0:33 3.000000
0:33 3.000000
0:? Linker Objects
0:? Linker Objects
// Module Version 10000
// Module Version 10000
// Generated by (magic number): 80001
// Generated by (magic number): 80001
// Id's are bound by 8
5
// Id's are bound by 8
8
Capability Shader
Capability Shader
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
...
@@ -282,6 +294,8 @@ gl_FragCoord origin is upper left
...
@@ -282,6 +294,8 @@ gl_FragCoord origin is upper left
56: TypeInt 32 0
56: TypeInt 32 0
57: 56(int) Constant 0
57: 56(int) Constant 0
62: TypeVector 41(bool) 4
62: TypeVector 41(bool) 4
83: 6(float) Constant 1077936128
84: 7(fvec4) ConstantComposite 83 83 83 83
4(main): 2 Function None 3
4(main): 2 Function None 3
5: Label
5: Label
Return
Return
...
@@ -343,5 +357,6 @@ gl_FragCoord origin is upper left
...
@@ -343,5 +357,6 @@ gl_FragCoord origin is upper left
80: 6(float) Load 70(f1)
80: 6(float) Load 70(f1)
81: 22(fvec3) CompositeConstruct 80 80 80
81: 22(fvec3) CompositeConstruct 80 80 80
82: 7(fvec4) Load 11(input)
82: 7(fvec4) Load 11(input)
ReturnValue 82
85: 7(fvec4) FMul 82 84
ReturnValue 85
FunctionEnd
FunctionEnd
Test/hlsl.shapeConv.frag
View file @
2051815b
...
@@ -28,5 +28,7 @@ float4 PixelShaderFunction(float4 input, float f) : COLOR0
...
@@ -28,5 +28,7 @@ float4 PixelShaderFunction(float4 input, float f) : COLOR0
f1
.
x
;
f1
.
x
;
f1
.
xxx
;
f1
.
xxx
;
return
input
;
const
float4
f4
=
3
.
0
;
return
input
*
f4
;
}
}
glslang/Include/revision.h
View file @
2051815b
...
@@ -2,5 +2,5 @@
...
@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "Overload400-PrecQual.199
5
"
#define GLSLANG_REVISION "Overload400-PrecQual.199
6
"
#define GLSLANG_DATE "12-Apr-2017"
#define GLSLANG_DATE "12-Apr-2017"
hlsl/hlslParseHelper.cpp
View file @
2051815b
...
@@ -6438,7 +6438,10 @@ TIntermNode* HlslParseContext::executeInitializer(const TSourceLoc& loc, TInterm
...
@@ -6438,7 +6438,10 @@ TIntermNode* HlslParseContext::executeInitializer(const TSourceLoc& loc, TInterm
// Compile-time tagging of the variable with its constant value...
// Compile-time tagging of the variable with its constant value...
initializer
=
intermediate
.
addConversion
(
EOpAssign
,
variable
->
getType
(),
initializer
);
initializer
=
intermediate
.
addConversion
(
EOpAssign
,
variable
->
getType
(),
initializer
);
if
(
!
initializer
||
!
initializer
->
getAsConstantUnion
()
||
variable
->
getType
()
!=
initializer
->
getType
())
{
if
(
initializer
!=
nullptr
&&
variable
->
getType
()
!=
initializer
->
getType
())
initializer
=
intermediate
.
addShapeConversion
(
EOpAssign
,
variable
->
getType
(),
initializer
);
if
(
initializer
==
nullptr
||
!
initializer
->
getAsConstantUnion
()
||
variable
->
getType
()
!=
initializer
->
getType
())
{
error
(
loc
,
"non-matching or non-convertible constant type for const initializer"
,
error
(
loc
,
"non-matching or non-convertible constant type for const initializer"
,
variable
->
getType
().
getStorageQualifierString
(),
""
);
variable
->
getType
().
getStorageQualifierString
(),
""
);
variable
->
getWritableType
().
getQualifier
().
storage
=
EvqTemporary
;
variable
->
getWritableType
().
getQualifier
().
storage
=
EvqTemporary
;
...
...
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