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
78a45576
Commit
78a45576
authored
Jul 08, 2016
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPV: Fix issue #376; declare Geometry capability for fragment use of gl_Layer.
parent
91e4aa59
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
16 deletions
+84
-16
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+19
-16
spv.430.frag.out
Test/baseResults/spv.430.frag.out
+54
-0
spv.430.frag
Test/spv.430.frag
+10
-0
Spv.FromFile.cpp
gtests/Spv.FromFile.cpp
+1
-0
No files found.
SPIRV/GlslangToSpv.cpp
View file @
78a45576
...
@@ -416,19 +416,19 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
...
@@ -416,19 +416,19 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
{
{
switch
(
builtIn
)
{
switch
(
builtIn
)
{
case
glslang
:
:
EbvPointSize
:
case
glslang
:
:
EbvPointSize
:
// Defer adding the capability until the built-in is actually used.
// Defer adding the capability until the built-in is actually used.
if
(
!
memberDeclaration
)
{
if
(
!
memberDeclaration
)
{
switch
(
glslangIntermediate
->
getStage
())
{
switch
(
glslangIntermediate
->
getStage
())
{
case
EShLangGeometry
:
case
EShLangGeometry
:
builder
.
addCapability
(
spv
::
CapabilityGeometryPointSize
);
builder
.
addCapability
(
spv
::
CapabilityGeometryPointSize
);
break
;
break
;
case
EShLangTessControl
:
case
EShLangTessControl
:
case
EShLangTessEvaluation
:
case
EShLangTessEvaluation
:
builder
.
addCapability
(
spv
::
CapabilityTessellationPointSize
);
builder
.
addCapability
(
spv
::
CapabilityTessellationPointSize
);
break
;
break
;
default
:
default
:
break
;
break
;
}
}
}
}
return
spv
::
BuiltInPointSize
;
return
spv
::
BuiltInPointSize
;
...
@@ -440,12 +440,12 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
...
@@ -440,12 +440,12 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
//
//
case
glslang
:
:
EbvClipDistance
:
case
glslang
:
:
EbvClipDistance
:
if
(
!
memberDeclaration
)
if
(
!
memberDeclaration
)
builder
.
addCapability
(
spv
::
CapabilityClipDistance
);
builder
.
addCapability
(
spv
::
CapabilityClipDistance
);
return
spv
::
BuiltInClipDistance
;
return
spv
::
BuiltInClipDistance
;
case
glslang
:
:
EbvCullDistance
:
case
glslang
:
:
EbvCullDistance
:
if
(
!
memberDeclaration
)
if
(
!
memberDeclaration
)
builder
.
addCapability
(
spv
::
CapabilityCullDistance
);
builder
.
addCapability
(
spv
::
CapabilityCullDistance
);
return
spv
::
BuiltInCullDistance
;
return
spv
::
BuiltInCullDistance
;
case
glslang
:
:
EbvViewportIndex
:
case
glslang
:
:
EbvViewportIndex
:
...
@@ -464,6 +464,10 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
...
@@ -464,6 +464,10 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
builder
.
addCapability
(
spv
::
CapabilitySampleRateShading
);
builder
.
addCapability
(
spv
::
CapabilitySampleRateShading
);
return
spv
::
BuiltInSampleMask
;
return
spv
::
BuiltInSampleMask
;
case
glslang
:
:
EbvLayer
:
builder
.
addCapability
(
spv
::
CapabilityGeometry
);
return
spv
::
BuiltInLayer
;
case
glslang
:
:
EbvPosition
:
return
spv
::
BuiltInPosition
;
case
glslang
:
:
EbvPosition
:
return
spv
::
BuiltInPosition
;
case
glslang
:
:
EbvVertexId
:
return
spv
::
BuiltInVertexId
;
case
glslang
:
:
EbvVertexId
:
return
spv
::
BuiltInVertexId
;
case
glslang
:
:
EbvInstanceId
:
return
spv
::
BuiltInInstanceId
;
case
glslang
:
:
EbvInstanceId
:
return
spv
::
BuiltInInstanceId
;
...
@@ -477,7 +481,6 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
...
@@ -477,7 +481,6 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
return
(
spv
::
BuiltIn
)
spv
::
BadValue
;
return
(
spv
::
BuiltIn
)
spv
::
BadValue
;
case
glslang
:
:
EbvPrimitiveId
:
return
spv
::
BuiltInPrimitiveId
;
case
glslang
:
:
EbvPrimitiveId
:
return
spv
::
BuiltInPrimitiveId
;
case
glslang
:
:
EbvInvocationId
:
return
spv
::
BuiltInInvocationId
;
case
glslang
:
:
EbvInvocationId
:
return
spv
::
BuiltInInvocationId
;
case
glslang
:
:
EbvLayer
:
return
spv
::
BuiltInLayer
;
case
glslang
:
:
EbvTessLevelInner
:
return
spv
::
BuiltInTessLevelInner
;
case
glslang
:
:
EbvTessLevelInner
:
return
spv
::
BuiltInTessLevelInner
;
case
glslang
:
:
EbvTessLevelOuter
:
return
spv
::
BuiltInTessLevelOuter
;
case
glslang
:
:
EbvTessLevelOuter
:
return
spv
::
BuiltInTessLevelOuter
;
case
glslang
:
:
EbvTessCoord
:
return
spv
::
BuiltInTessCoord
;
case
glslang
:
:
EbvTessCoord
:
return
spv
::
BuiltInTessCoord
;
...
...
Test/baseResults/spv.430.frag.out
0 → 100755
View file @
78a45576
spv.430.frag
Warning, version 430 is not yet complete; most version-specific features are present, but some are missing.
Linked fragment stage:
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 24
Capability Shader
Capability Geometry
Capability MultiViewport
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 9 14 19
ExecutionMode 4 OriginUpperLeft
Source GLSL 430
Name 4 "main"
Name 9 "color"
Name 14 "gl_Layer"
Name 19 "gl_ViewportIndex"
Decorate 14(gl_Layer) Flat
Decorate 14(gl_Layer) BuiltIn Layer
Decorate 19(gl_ViewportIndex) Flat
Decorate 19(gl_ViewportIndex) BuiltIn ViewportIndex
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Output 7(fvec4)
9(color): 8(ptr) Variable Output
10: 6(float) Constant 1065353216
11: 7(fvec4) ConstantComposite 10 10 10 10
12: TypeInt 32 1
13: TypePointer Input 12(int)
14(gl_Layer): 13(ptr) Variable Input
19(gl_ViewportIndex): 13(ptr) Variable Input
4(main): 2 Function None 3
5: Label
Store 9(color) 11
15: 12(int) Load 14(gl_Layer)
16: 6(float) ConvertSToF 15
17: 7(fvec4) Load 9(color)
18: 7(fvec4) VectorTimesScalar 17 16
Store 9(color) 18
20: 12(int) Load 19(gl_ViewportIndex)
21: 6(float) ConvertSToF 20
22: 7(fvec4) Load 9(color)
23: 7(fvec4) VectorTimesScalar 22 21
Store 9(color) 23
Return
FunctionEnd
Test/spv.430.frag
0 → 100644
View file @
78a45576
#version 430 core
out
vec4
color
;
void
main
()
{
color
=
vec4
(
1
.
0
);
color
*=
gl_Layer
;
color
*=
gl_ViewportIndex
;
}
gtests/Spv.FromFile.cpp
View file @
78a45576
...
@@ -126,6 +126,7 @@ INSTANTIATE_TEST_CASE_P(
...
@@ -126,6 +126,7 @@ INSTANTIATE_TEST_CASE_P(
"spv.400.tesc"
,
"spv.400.tesc"
,
"spv.400.tese"
,
"spv.400.tese"
,
"spv.420.geom"
,
"spv.420.geom"
,
"spv.430.frag"
,
"spv.430.vert"
,
"spv.430.vert"
,
"spv.450.tesc"
,
"spv.450.tesc"
,
"spv.accessChain.frag"
,
"spv.accessChain.frag"
,
...
...
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