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
941f3bbd
Commit
941f3bbd
authored
Jul 23, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GLSL 4.6: Implement draw parameters.
parent
0d0c6d38
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
80 additions
and
12 deletions
+80
-12
450.vert
Test/450.vert
+2
-0
450.vert.out
Test/baseResults/450.vert.out
+6
-2
spv.460.vert.out
Test/baseResults/spv.460.vert.out
+45
-0
spv.460.vert
Test/spv.460.vert
+6
-0
Initialize.cpp
glslang/MachineIndependent/Initialize.cpp
+20
-10
Spv.FromFile.cpp
gtests/Spv.FromFile.cpp
+1
-0
No files found.
Test/450.vert
View file @
941f3bbd
...
@@ -37,5 +37,7 @@ void foo()
...
@@ -37,5 +37,7 @@ void foo()
atomicCounterXor
(
aui
,
ui
);
// ERROR, need 4.6
atomicCounterXor
(
aui
,
ui
);
// ERROR, need 4.6
atomicCounterExchange
(
aui
,
ui
);
// ERROR, need 4.6
atomicCounterExchange
(
aui
,
ui
);
// ERROR, need 4.6
atomicCounterCompSwap
(
aui
,
ui
,
ui
);
// ERROR, need 4.6
atomicCounterCompSwap
(
aui
,
ui
,
ui
);
// ERROR, need 4.6
int
a
=
gl_BaseVertex
+
gl_BaseInstance
+
gl_DrawID
;
// ERROR, need 4.6
}
}
;
// ERROR: no extraneous semicolons
;
// ERROR: no extraneous semicolons
Test/baseResults/450.vert.out
View file @
941f3bbd
...
@@ -11,8 +11,12 @@ ERROR: 0:36: 'atomicCounterOr' : no matching overloaded function found
...
@@ -11,8 +11,12 @@ ERROR: 0:36: 'atomicCounterOr' : no matching overloaded function found
ERROR: 0:37: 'atomicCounterXor' : no matching overloaded function found
ERROR: 0:37: 'atomicCounterXor' : no matching overloaded function found
ERROR: 0:38: 'atomicCounterExchange' : no matching overloaded function found
ERROR: 0:38: 'atomicCounterExchange' : no matching overloaded function found
ERROR: 0:39: 'atomicCounterCompSwap' : no matching overloaded function found
ERROR: 0:39: 'atomicCounterCompSwap' : no matching overloaded function found
ERROR: 0:41: 'extraneous semicolon' : not supported for this version or the enabled extensions
ERROR: 0:41: 'gl_BaseVertex' : undeclared identifier
ERROR: 13 compilation errors. No code generated.
ERROR: 0:41: 'gl_BaseInstance' : undeclared identifier
ERROR: 0:41: 'gl_DrawID' : undeclared identifier
ERROR: 0:41: '=' : cannot convert from ' temp float' to ' temp int'
ERROR: 0:43: 'extraneous semicolon' : not supported for this version or the enabled extensions
ERROR: 17 compilation errors. No code generated.
Shader version: 450
Shader version: 450
...
...
Test/baseResults/spv.460.vert.out
0 → 100755
View file @
941f3bbd
spv.460.vert
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 20
Capability Shader
Capability DrawParameters
Extension "SPV_KHR_shader_draw_parameters"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 10 12 15 18 19
Source GLSL 460
Name 4 "main"
Name 8 "a"
Name 10 "gl_BaseVertex"
Name 12 "gl_BaseInstance"
Name 15 "gl_DrawID"
Name 18 "gl_VertexID"
Name 19 "gl_InstanceID"
Decorate 10(gl_BaseVertex) BuiltIn BaseVertex
Decorate 12(gl_BaseInstance) BuiltIn BaseInstance
Decorate 15(gl_DrawID) BuiltIn DrawIndex
Decorate 18(gl_VertexID) BuiltIn VertexId
Decorate 19(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7: TypePointer Function 6(int)
9: TypePointer Input 6(int)
10(gl_BaseVertex): 9(ptr) Variable Input
12(gl_BaseInstance): 9(ptr) Variable Input
15(gl_DrawID): 9(ptr) Variable Input
18(gl_VertexID): 9(ptr) Variable Input
19(gl_InstanceID): 9(ptr) Variable Input
4(main): 2 Function None 3
5: Label
8(a): 7(ptr) Variable Function
11: 6(int) Load 10(gl_BaseVertex)
13: 6(int) Load 12(gl_BaseInstance)
14: 6(int) IAdd 11 13
16: 6(int) Load 15(gl_DrawID)
17: 6(int) IAdd 14 16
Store 8(a) 17
Return
FunctionEnd
Test/spv.460.vert
0 → 100644
View file @
941f3bbd
#version 460
void
main
()
{
int
a
=
gl_BaseVertex
+
gl_BaseInstance
+
gl_DrawID
;
}
glslang/MachineIndependent/Initialize.cpp
View file @
941f3bbd
...
@@ -3416,6 +3416,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
...
@@ -3416,6 +3416,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"in int gl_DrawIDARB;"
"in int gl_DrawIDARB;"
);
);
}
}
if
(
version
>=
460
)
{
stageBuiltins
[
EShLangVertex
].
append
(
"in int gl_BaseVertex;"
"in int gl_BaseInstance;"
"in int gl_DrawID;"
);
}
#ifdef NV_EXTENSIONS
#ifdef NV_EXTENSIONS
if
(
version
>=
450
)
if
(
version
>=
450
)
...
@@ -5230,16 +5237,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
...
@@ -5230,16 +5237,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
switch
(
language
)
{
switch
(
language
)
{
case
EShLangVertex
:
case
EShLangVertex
:
if
(
profile
!=
EEsProfile
)
{
if
(
profile
!=
EEsProfile
)
{
symbolTable
.
setVariableExtensions
(
"gl_BaseVertexARB"
,
1
,
&
E_GL_ARB_shader_draw_parameters
);
if
(
version
>=
440
)
{
symbolTable
.
setVariableExtensions
(
"gl_BaseInstanceARB"
,
1
,
&
E_GL_ARB_shader_draw_parameters
);
symbolTable
.
setVariableExtensions
(
"gl_BaseVertexARB"
,
1
,
&
E_GL_ARB_shader_draw_parameters
);
symbolTable
.
setVariableExtensions
(
"gl_DrawIDARB"
,
1
,
&
E_GL_ARB_shader_draw_parameters
);
symbolTable
.
setVariableExtensions
(
"gl_BaseInstanceARB"
,
1
,
&
E_GL_ARB_shader_draw_parameters
);
symbolTable
.
setVariableExtensions
(
"gl_DrawIDARB"
,
1
,
&
E_GL_ARB_shader_draw_parameters
);
BuiltInVariable
(
"gl_BaseVertexARB"
,
EbvBaseVertex
,
symbolTable
);
BuiltInVariable
(
"gl_BaseVertexARB"
,
EbvBaseVertex
,
symbolTable
);
BuiltInVariable
(
"gl_BaseInstanceARB"
,
EbvBaseInstance
,
symbolTable
);
BuiltInVariable
(
"gl_BaseInstanceARB"
,
EbvBaseInstance
,
symbolTable
);
BuiltInVariable
(
"gl_DrawIDARB"
,
EbvDrawId
,
symbolTable
);
BuiltInVariable
(
"gl_DrawIDARB"
,
EbvDrawId
,
symbolTable
);
}
}
if
(
version
>=
460
)
{
if
(
profile
!=
EEsProfile
)
{
BuiltInVariable
(
"gl_BaseVertex"
,
EbvBaseVertex
,
symbolTable
);
BuiltInVariable
(
"gl_BaseInstance"
,
EbvBaseInstance
,
symbolTable
);
BuiltInVariable
(
"gl_DrawID"
,
EbvDrawId
,
symbolTable
);
}
symbolTable
.
setVariableExtensions
(
"gl_SubGroupSizeARB"
,
1
,
&
E_GL_ARB_shader_ballot
);
symbolTable
.
setVariableExtensions
(
"gl_SubGroupSizeARB"
,
1
,
&
E_GL_ARB_shader_ballot
);
symbolTable
.
setVariableExtensions
(
"gl_SubGroupInvocationARB"
,
1
,
&
E_GL_ARB_shader_ballot
);
symbolTable
.
setVariableExtensions
(
"gl_SubGroupInvocationARB"
,
1
,
&
E_GL_ARB_shader_ballot
);
symbolTable
.
setVariableExtensions
(
"gl_SubGroupEqMaskARB"
,
1
,
&
E_GL_ARB_shader_ballot
);
symbolTable
.
setVariableExtensions
(
"gl_SubGroupEqMaskARB"
,
1
,
&
E_GL_ARB_shader_ballot
);
...
...
gtests/Spv.FromFile.cpp
View file @
941f3bbd
...
@@ -361,6 +361,7 @@ INSTANTIATE_TEST_CASE_P(
...
@@ -361,6 +361,7 @@ INSTANTIATE_TEST_CASE_P(
Glsl
,
CompileOpenGLToSpirvTest
,
Glsl
,
CompileOpenGLToSpirvTest
,
::
testing
::
ValuesIn
(
std
::
vector
<
std
::
string
>
({
::
testing
::
ValuesIn
(
std
::
vector
<
std
::
string
>
({
"spv.460.frag"
,
"spv.460.frag"
,
"spv.460.vert"
,
"spv.atomic.comp"
,
"spv.atomic.comp"
,
"spv.glFragColor.frag"
,
"spv.glFragColor.frag"
,
"spv.specConst.vert"
,
"spv.specConst.vert"
,
...
...
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