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
36e87d08
Commit
36e87d08
authored
Aug 24, 2016
by
steve-lunarg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: add precise keyword
parent
fcc0aa3b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
119 additions
and
0 deletions
+119
-0
hlsl.precise.frag.out
Test/baseResults/hlsl.precise.frag.out
+103
-0
hlsl.precise.frag
Test/hlsl.precise.frag
+14
-0
Hlsl.FromFile.cpp
gtests/Hlsl.FromFile.cpp
+1
-0
hlslScanContext.cpp
hlsl/hlslScanContext.cpp
+1
-0
No files found.
Test/baseResults/hlsl.precise.frag.out
0 → 100644
View file @
36e87d08
hlsl.precise.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:8 Function Definition: MyFunction(f1;vf3; (global void)
0:6 Function Parameters:
0:6 'myfloat' (noContraction in float)
0:6 'myfloat3' (noContraction out 3-component vector of float)
0:15 Function Definition: main( (global structure{noContraction temp 4-component vector of float color})
0:9 Function Parameters:
0:? Sequence
0:11 move second child to first child (noContraction temp 4-component vector of float)
0:11 color: direct index for structure (noContraction temp 4-component vector of float)
0:11 'ps_output' (temp structure{noContraction temp 4-component vector of float color})
0:11 Constant:
0:11 0 (const int)
0:11 Constant:
0:11 1.000000
0:11 1.000000
0:11 1.000000
0:11 1.000000
0:12 Branch: Return with expression
0:12 'ps_output' (temp structure{noContraction temp 4-component vector of float color})
0:? Linker Objects
0:? 'precisefloat' (noContraction global float)
Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:8 Function Definition: MyFunction(f1;vf3; (global void)
0:6 Function Parameters:
0:6 'myfloat' (noContraction in float)
0:6 'myfloat3' (noContraction out 3-component vector of float)
0:15 Function Definition: main( (global structure{noContraction temp 4-component vector of float color})
0:9 Function Parameters:
0:? Sequence
0:11 move second child to first child (noContraction temp 4-component vector of float)
0:11 color: direct index for structure (noContraction temp 4-component vector of float)
0:11 'ps_output' (temp structure{noContraction temp 4-component vector of float color})
0:11 Constant:
0:11 0 (const int)
0:11 Constant:
0:11 1.000000
0:11 1.000000
0:11 1.000000
0:11 1.000000
0:12 Branch: Return with expression
0:12 'ps_output' (temp structure{noContraction temp 4-component vector of float color})
0:? Linker Objects
0:? 'precisefloat' (noContraction global float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 29
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 13 "MyFunction(f1;vf3;"
Name 11 "myfloat"
Name 12 "myfloat3"
Name 16 "PS_OUTPUT"
MemberName 16(PS_OUTPUT) 0 "color"
Name 18 "ps_output"
Name 28 "precisefloat"
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypePointer Function 6(float)
8: TypeVector 6(float) 3
9: TypePointer Function 8(fvec3)
10: TypeFunction 2 7(ptr) 9(ptr)
15: TypeVector 6(float) 4
16(PS_OUTPUT): TypeStruct 15(fvec4)
17: TypePointer Function 16(PS_OUTPUT)
19: TypeInt 32 1
20: 19(int) Constant 0
21: 6(float) Constant 1065353216
22: 15(fvec4) ConstantComposite 21 21 21 21
23: TypePointer Function 15(fvec4)
27: TypePointer Private 6(float)
28(precisefloat): 27(ptr) Variable Private
4(main): 2 Function None 3
5: Label
18(ps_output): 17(ptr) Variable Function
24: 23(ptr) AccessChain 18(ps_output) 20
Store 24 22
25:16(PS_OUTPUT) Load 18(ps_output)
ReturnValue 25
FunctionEnd
13(MyFunction(f1;vf3;): 2 Function None 10
11(myfloat): 7(ptr) FunctionParameter
12(myfloat3): 9(ptr) FunctionParameter
14: Label
Return
FunctionEnd
Test/hlsl.precise.frag
0 → 100644
View file @
36e87d08
struct
PS_OUTPUT
{
precise
float4
color
:
SV_Target0
;
};
precise
float
precisefloat
;
void
MyFunction
(
in
precise
float
myfloat
,
out
precise
float3
myfloat3
)
{
}
PS_OUTPUT
main
()
{
PS_OUTPUT
ps_output
;
ps_output
.
color
=
1
.
0
;
return
ps_output
;
}
gtests/Hlsl.FromFile.cpp
View file @
36e87d08
...
...
@@ -123,6 +123,7 @@ INSTANTIATE_TEST_CASE_P(
{
"hlsl.numericsuffixes.frag"
,
"main"
},
{
"hlsl.overload.frag"
,
"PixelShaderFunction"
},
{
"hlsl.pp.line.frag"
,
"main"
},
{
"hlsl.precise.frag"
,
"main"
},
{
"hlsl.promotions.frag"
,
"main"
},
{
"hlsl.sample.array.dx10.frag"
,
"main"
},
{
"hlsl.sample.basic.dx10.frag"
,
"main"
},
...
...
hlsl/hlslScanContext.cpp
View file @
36e87d08
...
...
@@ -463,6 +463,7 @@ EHlslTokenClass HlslScanContext::tokenizeIdentifier()
case
EHTokIn
:
case
EHTokOut
:
case
EHTokInOut
:
case
EHTokPrecise
:
case
EHTokLayout
:
return
keyword
;
...
...
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