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
b50fd17a
Commit
b50fd17a
authored
Oct 16, 2016
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: Support SV_Coverage and SV_DispatchThreadId; catch SV_GroupIndex.
parent
4a346793
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
88 additions
and
9 deletions
+88
-9
hlsl.basic.comp.out
Test/baseResults/hlsl.basic.comp.out
+59
-0
hlsl.inoutquals.frag.out
Test/baseResults/hlsl.inoutquals.frag.out
+13
-4
hlsl.basic.comp
Test/hlsl.basic.comp
+6
-0
hlsl.inoutquals.frag
Test/hlsl.inoutquals.frag
+1
-1
revision.h
glslang/Include/revision.h
+1
-1
Hlsl.FromFile.cpp
gtests/Hlsl.FromFile.cpp
+1
-0
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+7
-3
No files found.
Test/baseResults/hlsl.basic.comp.out
0 → 100755
View file @
b50fd17a
hlsl.basic.comp
Shader version: 450
local_size = (1, 1, 1)
0:? Sequence
0:4 Function Definition: main( (temp void)
0:4 Function Parameters:
0:? Sequence
0:5 dti: direct index for structure (layout(offset=0 ) uniform int LocalInvocationID)
0:5 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform int LocalInvocationID dti})
0:5 Constant:
0:5 0 (const uint)
0:? Linker Objects
0:? 'anon@0' (uniform block{layout(offset=0 ) uniform int LocalInvocationID dti})
Linked compute stage:
Shader version: 450
local_size = (1, 1, 1)
0:? Sequence
0:4 Function Definition: main( (temp void)
0:4 Function Parameters:
0:? Sequence
0:5 dti: direct index for structure (layout(offset=0 ) uniform int LocalInvocationID)
0:5 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform int LocalInvocationID dti})
0:5 Constant:
0:5 0 (const uint)
0:? Linker Objects
0:? 'anon@0' (uniform block{layout(offset=0 ) uniform int LocalInvocationID dti})
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 11
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "main"
ExecutionMode 4 LocalSize 1 1 1
Name 4 "main"
Name 7 "$Global"
MemberName 7($Global) 0 "dti"
Name 9 ""
MemberDecorate 7($Global) 0 Offset 0
MemberDecorate 7($Global) 0 BuiltIn LocalInvocationId
Decorate 7($Global) Block
Decorate 9 DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7($Global): TypeStruct 6(int)
8: TypePointer Uniform 7($Global)
9: 8(ptr) Variable Uniform
10: 6(int) Constant 0
4(main): 2 Function None 3
5: Label
Return
FunctionEnd
Test/baseResults/hlsl.inoutquals.frag.out
View file @
b50fd17a
...
...
@@ -18,9 +18,10 @@ gl_FragCoord origin is upper left
0:11 'x' (in float)
0:11 Constant:
0:11 -1.000000
0:15 Function Definition: main(vf4; (temp structure{temp 4-component vector of float Color, temp float Depth})
0:15 Function Definition: main(vf4;
i1;
(temp structure{temp 4-component vector of float Color, temp float Depth})
0:15 Function Parameters:
0:15 'inpos' (noperspective in 4-component vector of float FragCoord)
0:15 'sampleMask' (out int SampleMaskIn)
0:? Sequence
0:18 Sequence
0:18 move second child to first child (temp float)
...
...
@@ -74,6 +75,7 @@ gl_FragCoord origin is upper left
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:? 'Depth' (out float FragDepth)
0:? 'inpos' (noperspective in 4-component vector of float FragCoord)
0:? 'sampleMask' (out int SampleMaskIn)
Linked fragment stage:
...
...
@@ -98,9 +100,10 @@ gl_FragCoord origin is upper left
0:11 'x' (in float)
0:11 Constant:
0:11 -1.000000
0:15 Function Definition: main(vf4; (temp structure{temp 4-component vector of float Color, temp float Depth})
0:15 Function Definition: main(vf4;
i1;
(temp structure{temp 4-component vector of float Color, temp float Depth})
0:15 Function Parameters:
0:15 'inpos' (noperspective in 4-component vector of float FragCoord)
0:15 'sampleMask' (out int SampleMaskIn)
0:? Sequence
0:18 Sequence
0:18 move second child to first child (temp float)
...
...
@@ -154,15 +157,17 @@ gl_FragCoord origin is upper left
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:? 'Depth' (out float FragDepth)
0:? 'inpos' (noperspective in 4-component vector of float FragCoord)
0:? 'sampleMask' (out int SampleMaskIn)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 6
1
// Id's are bound by 6
3
Capability Shader
Capability SampleRateShading
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 45 53 57
EntryPoint Fragment 4 "main" 45 53 57
62
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 12 "MyFunc(f1;f1;f1;"
...
...
@@ -182,10 +187,12 @@ gl_FragCoord origin is upper left
Name 45 "inpos"
Name 53 "Color"
Name 57 "Depth"
Name 62 "sampleMask"
Decorate 45(inpos) NoPerspective
Decorate 45(inpos) BuiltIn FragCoord
Decorate 53(Color) Location 0
Decorate 57(Depth) BuiltIn FragDepth
Decorate 62(sampleMask) BuiltIn SampleMask
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
...
...
@@ -211,6 +218,8 @@ gl_FragCoord origin is upper left
53(Color): 52(ptr) Variable Output
56: TypePointer Output 6(float)
57(Depth): 56(ptr) Variable Output
61: TypePointer Output 34(int)
62(sampleMask): 61(ptr) Variable Output
4(main): 2 Function None 3
5: Label
17(x): 7(ptr) Variable Function
...
...
Test/hlsl.basic.comp
0 → 100644
View file @
b50fd17a
int dti : SV_DispatchThreadID;
void main()
{
dti;
}
Test/hlsl.inoutquals.frag
View file @
b50fd17a
...
...
@@ -11,7 +11,7 @@ void MyFunc(in float x, out float y, inout float z)
x
=
-
1
;
// no effect since x = in param
}
PS_OUTPUT
main
(
noperspective
in
float4
inpos
:
SV_Position
)
PS_OUTPUT
main
(
noperspective
in
float4
inpos
:
SV_Position
,
out
int
sampleMask
:
SV_Coverage
)
{
PS_OUTPUT
psout
;
...
...
glslang/Include/revision.h
View file @
b50fd17a
...
...
@@ -2,5 +2,5 @@
// 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).
#define GLSLANG_REVISION "Overload400-PrecQual.160
1
"
#define GLSLANG_REVISION "Overload400-PrecQual.160
2
"
#define GLSLANG_DATE "16-Oct-2016"
gtests/Hlsl.FromFile.cpp
View file @
b50fd17a
...
...
@@ -86,6 +86,7 @@ INSTANTIATE_TEST_CASE_P(
{
"hlsl.array.multidim.frag"
,
"main"
},
{
"hlsl.assoc.frag"
,
"PixelShaderFunction"
},
{
"hlsl.attribute.frag"
,
"PixelShaderFunction"
},
{
"hlsl.basic.comp"
,
"main"
},
{
"hlsl.buffer.frag"
,
"PixelShaderFunction"
},
{
"hlsl.calculatelod.dx10.frag"
,
"main"
},
{
"hlsl.calculatelodunclamped.dx10.frag"
,
"main"
},
...
...
hlsl/hlslParseHelper.cpp
View file @
b50fd17a
...
...
@@ -2935,6 +2935,8 @@ void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, con
qualifier
.
builtIn
=
EbvTessLevelInner
;
else
if
(
semanticUpperCase
==
"SV_GSINSTANCEID"
)
qualifier
.
builtIn
=
EbvInvocationId
;
else
if
(
semanticUpperCase
==
"SV_DISPATCHTHREADID"
)
qualifier
.
builtIn
=
EbvLocalInvocationId
;
else
if
(
semanticUpperCase
==
"SV_GROUPTHREADID"
)
qualifier
.
builtIn
=
EbvLocalInvocationId
;
else
if
(
semanticUpperCase
==
"SV_GROUPID"
)
...
...
@@ -2943,6 +2945,8 @@ void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, con
qualifier
.
builtIn
=
EbvTessCoord
;
else
if
(
semanticUpperCase
==
"SV_DEPTH"
)
qualifier
.
builtIn
=
EbvFragDepth
;
else
if
(
semanticUpperCase
==
"SV_COVERAGE"
)
qualifier
.
builtIn
=
EbvSampleMask
;
//TODO, these need to get refined to be more specific
else
if
(
semanticUpperCase
==
"SV_DEPTHGREATEREQUAL"
)
...
...
@@ -2950,9 +2954,9 @@ void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, con
else
if
(
semanticUpperCase
==
"SV_DEPTHLESSEQUAL"
)
qualifier
.
builtIn
=
EbvFragDepthLesser
;
else
if
(
semanticUpperCase
==
"SV_STENCILREF"
)
error
(
loc
,
"unimplemented"
,
"SV_STENCILREF"
,
""
);
else
if
(
semanticUpperCase
==
"SV_
COVERAGE
"
)
error
(
loc
,
"unimplemented"
,
"SV_
COVERAGE
"
,
""
);
error
(
loc
,
"unimplemented
; need ARB_shader_stencil_export
"
,
"SV_STENCILREF"
,
""
);
else
if
(
semanticUpperCase
==
"SV_
GROUPINDEX
"
)
error
(
loc
,
"unimplemented"
,
"SV_
GROUPINDEX
"
,
""
);
}
//
...
...
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