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
0133c123
Commit
0133c123
authored
May 20, 2016
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: Add more matrix types to the grammar.
parent
8d72f1a2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
231 additions
and
0 deletions
+231
-0
hlsl.matType.frag.out
Test/baseResults/hlsl.matType.frag.out
+101
-0
hlsl.matType.frag
Test/hlsl.matType.frag
+10
-0
Hlsl.FromFile.cpp
gtests/Hlsl.FromFile.cpp
+1
-0
hlslGrammar.cpp
hlsl/hlslGrammar.cpp
+119
-0
No files found.
Test/baseResults/hlsl.matType.frag.out
0 → 100755
View file @
0133c123
hlsl.matType.frag
Shader version: 100
gl_FragCoord origin is upper left
0:? Sequence
0:1 move second child to first child (temp 1-component vector of float)
0:1 'f1' (temp 1-component vector of float)
0:1 Constant:
0:1 1.000000
0:11 Function Definition: ShaderFunction(vf1;f1; (temp 1-component vector of float)
0:9 Function Parameters:
0:9 'inFloat1' (temp 1-component vector of float)
0:9 'inScalar' (temp float)
0:? Linker Objects
0:? 'f1' (temp 1-component vector of float)
0:? 'fmat11' (temp 1X1 matrix of float)
0:? 'fmat41' (temp 1X4 matrix of float)
0:? 'fmat12' (temp 2X1 matrix of float)
0:? 'dmat23' (temp 3X2 matrix of double)
0:? 'int44' (temp 4X4 matrix of int)
Linked fragment stage:
Shader version: 100
gl_FragCoord origin is upper left
0:? Sequence
0:1 move second child to first child (temp 1-component vector of float)
0:1 'f1' (temp 1-component vector of float)
0:1 Constant:
0:1 1.000000
0:11 Function Definition: ShaderFunction(vf1;f1; (temp 1-component vector of float)
0:9 Function Parameters:
0:9 'inFloat1' (temp 1-component vector of float)
0:9 'inScalar' (temp float)
0:? Linker Objects
0:? 'f1' (temp 1-component vector of float)
0:? 'fmat11' (temp 1X1 matrix of float)
0:? 'fmat41' (temp 1X4 matrix of float)
0:? 'fmat12' (temp 2X1 matrix of float)
0:? 'dmat23' (temp 3X2 matrix of double)
0:? 'int44' (temp 4X4 matrix of int)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 36
Capability Shader
Capability Float64
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "PixelShaderFunction"
ExecutionMode 4 OriginUpperLeft
Source HLSL 100
Name 4 "PixelShaderFunction"
Name 11 "ShaderFunction(vf1;f1;"
Name 9 "inFloat1"
Name 10 "inScalar"
Name 14 "f1"
Name 18 "fmat11"
Name 22 "fmat41"
Name 25 "fmat12"
Name 30 "dmat23"
Name 35 "int44"
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypePointer Function 6(float)
8: TypeFunction 6(float) 7(ptr) 7(ptr)
15: TypeVector 6(float) 1
16: TypeMatrix 15(fvec) 1
17: TypePointer Function 16
19: TypeVector 6(float) 4
20: TypeMatrix 19(fvec4) 1
21: TypePointer Function 20
23: TypeMatrix 15(fvec) 2
24: TypePointer Function 23
26: TypeFloat 64
27: TypeVector 26(float) 2
28: TypeMatrix 27(fvec2) 3
29: TypePointer Function 28
31: TypeInt 32 1
32: TypeVector 31(int) 4
33: TypeMatrix 32(ivec4) 4
34: TypePointer Function 33
4(PixelShaderFunction): 2 Function None 3
5: Label
FunctionEnd
11(ShaderFunction(vf1;f1;): 6(float) Function None 8
9(inFloat1): 7(ptr) FunctionParameter
10(inScalar): 7(ptr) FunctionParameter
12: Label
14(f1): 7(ptr) Variable Function
18(fmat11): 17(ptr) Variable Function
22(fmat41): 21(ptr) Variable Function
25(fmat12): 24(ptr) Variable Function
30(dmat23): 29(ptr) Variable Function
35(int44): 34(ptr) Variable Function
13: 6(float) Undef
ReturnValue 13
FunctionEnd
Test/hlsl.matType.frag
0 → 100644
View file @
0133c123
float1
f1
=
float1
(
1
.
0
);
float1x1
fmat11
;
float4x1
fmat41
;
float1x2
fmat12
;
double2x3
dmat23
;
int4x4
int44
;
float1
ShaderFunction
(
float1
inFloat1
,
float
inScalar
)
:
COLOR0
{
}
gtests/Hlsl.FromFile.cpp
View file @
0133c123
...
...
@@ -74,6 +74,7 @@ INSTANTIATE_TEST_CASE_P(
{
"hlsl.assoc.frag"
,
"PixelShaderFunction"
},
{
"hlsl.float1.frag"
,
"PixelShaderFunction"
},
{
"hlsl.float4.frag"
,
"PixelShaderFunction"
},
{
"hlsl.matType.frag"
,
"PixelShaderFunction"
},
{
"hlsl.max.frag"
,
"PixelShaderFunction"
},
{
"hlsl.precedence.frag"
,
"PixelShaderFunction"
},
{
"hlsl.precedence2.frag"
,
"PixelShaderFunction"
},
...
...
hlsl/hlslGrammar.cpp
View file @
0133c123
...
...
@@ -257,6 +257,70 @@ bool HlslGrammar::acceptType(TType& type)
new
(
&
type
)
TType
(
EbtBool
,
EvqTemporary
,
4
);
break
;
case
EHTokInt1x1
:
new
(
&
type
)
TType
(
EbtInt
,
EvqTemporary
,
0
,
1
,
1
);
break
;
case
EHTokInt1x2
:
new
(
&
type
)
TType
(
EbtInt
,
EvqTemporary
,
0
,
2
,
1
);
break
;
case
EHTokInt1x3
:
new
(
&
type
)
TType
(
EbtInt
,
EvqTemporary
,
0
,
3
,
1
);
break
;
case
EHTokInt1x4
:
new
(
&
type
)
TType
(
EbtInt
,
EvqTemporary
,
0
,
4
,
1
);
break
;
case
EHTokInt2x1
:
new
(
&
type
)
TType
(
EbtInt
,
EvqTemporary
,
0
,
1
,
2
);
break
;
case
EHTokInt2x2
:
new
(
&
type
)
TType
(
EbtInt
,
EvqTemporary
,
0
,
2
,
2
);
break
;
case
EHTokInt2x3
:
new
(
&
type
)
TType
(
EbtInt
,
EvqTemporary
,
0
,
3
,
2
);
break
;
case
EHTokInt2x4
:
new
(
&
type
)
TType
(
EbtInt
,
EvqTemporary
,
0
,
4
,
2
);
break
;
case
EHTokInt3x1
:
new
(
&
type
)
TType
(
EbtInt
,
EvqTemporary
,
0
,
1
,
3
);
break
;
case
EHTokInt3x2
:
new
(
&
type
)
TType
(
EbtInt
,
EvqTemporary
,
0
,
2
,
3
);
break
;
case
EHTokInt3x3
:
new
(
&
type
)
TType
(
EbtInt
,
EvqTemporary
,
0
,
3
,
3
);
break
;
case
EHTokInt3x4
:
new
(
&
type
)
TType
(
EbtInt
,
EvqTemporary
,
0
,
4
,
3
);
break
;
case
EHTokInt4x1
:
new
(
&
type
)
TType
(
EbtInt
,
EvqTemporary
,
0
,
1
,
4
);
break
;
case
EHTokInt4x2
:
new
(
&
type
)
TType
(
EbtInt
,
EvqTemporary
,
0
,
2
,
4
);
break
;
case
EHTokInt4x3
:
new
(
&
type
)
TType
(
EbtInt
,
EvqTemporary
,
0
,
3
,
4
);
break
;
case
EHTokInt4x4
:
new
(
&
type
)
TType
(
EbtInt
,
EvqTemporary
,
0
,
4
,
4
);
break
;
case
EHTokFloat1x1
:
new
(
&
type
)
TType
(
EbtFloat
,
EvqTemporary
,
0
,
1
,
1
);
break
;
case
EHTokFloat1x2
:
new
(
&
type
)
TType
(
EbtFloat
,
EvqTemporary
,
0
,
2
,
1
);
break
;
case
EHTokFloat1x3
:
new
(
&
type
)
TType
(
EbtFloat
,
EvqTemporary
,
0
,
3
,
1
);
break
;
case
EHTokFloat1x4
:
new
(
&
type
)
TType
(
EbtFloat
,
EvqTemporary
,
0
,
4
,
1
);
break
;
case
EHTokFloat2x1
:
new
(
&
type
)
TType
(
EbtFloat
,
EvqTemporary
,
0
,
1
,
2
);
break
;
case
EHTokFloat2x2
:
new
(
&
type
)
TType
(
EbtFloat
,
EvqTemporary
,
0
,
2
,
2
);
break
;
...
...
@@ -266,6 +330,9 @@ bool HlslGrammar::acceptType(TType& type)
case
EHTokFloat2x4
:
new
(
&
type
)
TType
(
EbtFloat
,
EvqTemporary
,
0
,
4
,
2
);
break
;
case
EHTokFloat3x1
:
new
(
&
type
)
TType
(
EbtFloat
,
EvqTemporary
,
0
,
1
,
3
);
break
;
case
EHTokFloat3x2
:
new
(
&
type
)
TType
(
EbtFloat
,
EvqTemporary
,
0
,
2
,
3
);
break
;
...
...
@@ -275,6 +342,9 @@ bool HlslGrammar::acceptType(TType& type)
case
EHTokFloat3x4
:
new
(
&
type
)
TType
(
EbtFloat
,
EvqTemporary
,
0
,
4
,
3
);
break
;
case
EHTokFloat4x1
:
new
(
&
type
)
TType
(
EbtFloat
,
EvqTemporary
,
0
,
1
,
4
);
break
;
case
EHTokFloat4x2
:
new
(
&
type
)
TType
(
EbtFloat
,
EvqTemporary
,
0
,
2
,
4
);
break
;
...
...
@@ -285,6 +355,55 @@ bool HlslGrammar::acceptType(TType& type)
new
(
&
type
)
TType
(
EbtFloat
,
EvqTemporary
,
0
,
4
,
4
);
break
;
case
EHTokDouble1x1
:
new
(
&
type
)
TType
(
EbtDouble
,
EvqTemporary
,
0
,
1
,
1
);
break
;
case
EHTokDouble1x2
:
new
(
&
type
)
TType
(
EbtDouble
,
EvqTemporary
,
0
,
2
,
1
);
break
;
case
EHTokDouble1x3
:
new
(
&
type
)
TType
(
EbtDouble
,
EvqTemporary
,
0
,
3
,
1
);
break
;
case
EHTokDouble1x4
:
new
(
&
type
)
TType
(
EbtDouble
,
EvqTemporary
,
0
,
4
,
1
);
break
;
case
EHTokDouble2x1
:
new
(
&
type
)
TType
(
EbtDouble
,
EvqTemporary
,
0
,
1
,
2
);
break
;
case
EHTokDouble2x2
:
new
(
&
type
)
TType
(
EbtDouble
,
EvqTemporary
,
0
,
2
,
2
);
break
;
case
EHTokDouble2x3
:
new
(
&
type
)
TType
(
EbtDouble
,
EvqTemporary
,
0
,
3
,
2
);
break
;
case
EHTokDouble2x4
:
new
(
&
type
)
TType
(
EbtDouble
,
EvqTemporary
,
0
,
4
,
2
);
break
;
case
EHTokDouble3x1
:
new
(
&
type
)
TType
(
EbtDouble
,
EvqTemporary
,
0
,
1
,
3
);
break
;
case
EHTokDouble3x2
:
new
(
&
type
)
TType
(
EbtDouble
,
EvqTemporary
,
0
,
2
,
3
);
break
;
case
EHTokDouble3x3
:
new
(
&
type
)
TType
(
EbtDouble
,
EvqTemporary
,
0
,
3
,
3
);
break
;
case
EHTokDouble3x4
:
new
(
&
type
)
TType
(
EbtDouble
,
EvqTemporary
,
0
,
4
,
3
);
break
;
case
EHTokDouble4x1
:
new
(
&
type
)
TType
(
EbtDouble
,
EvqTemporary
,
0
,
1
,
4
);
break
;
case
EHTokDouble4x2
:
new
(
&
type
)
TType
(
EbtDouble
,
EvqTemporary
,
0
,
2
,
4
);
break
;
case
EHTokDouble4x3
:
new
(
&
type
)
TType
(
EbtDouble
,
EvqTemporary
,
0
,
3
,
4
);
break
;
case
EHTokDouble4x4
:
new
(
&
type
)
TType
(
EbtDouble
,
EvqTemporary
,
0
,
4
,
4
);
break
;
default
:
return
false
;
}
...
...
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