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
ad54b24f
Commit
ad54b24f
authored
Oct 17, 2014
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement GL_ARB_viewport_array extension.
git-svn-id:
https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@28653
e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent
54c04408
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
5 deletions
+62
-5
150.geom
Test/150.geom
+14
-0
150.geom.out
Test/baseResults/150.geom.out
+36
-1
Initialize.cpp
glslang/MachineIndependent/Initialize.cpp
+9
-4
Versions.cpp
glslang/MachineIndependent/Versions.cpp
+2
-0
Versions.h
glslang/MachineIndependent/Versions.h
+1
-0
No files found.
Test/150.geom
View file @
ad54b24f
...
@@ -123,3 +123,17 @@ float summ = gl_MaxVertexAttribs +
...
@@ -123,3 +123,17 @@ float summ = gl_MaxVertexAttribs +
gl_MaxGeometryTotalOutputComponents
+
gl_MaxGeometryTotalOutputComponents
+
gl_MaxGeometryUniformComponents
+
gl_MaxGeometryUniformComponents
+
gl_MaxGeometryVaryingComponents
;
gl_MaxGeometryVaryingComponents
;
void
fooe1
()
{
gl_ViewportIndex
=
gl_MaxViewports
-
1
;
}
#extension GL_ARB_viewport_array : enable
void
fooe2
()
{
gl_ViewportIndex
=
gl_MaxViewports
-
1
;
}
out
int
gl_ViewportIndex
;
Test/baseResults/150.geom.out
View file @
ad54b24f
...
@@ -31,10 +31,14 @@ ERROR: 0:88: 'triangles_adjacency' : cannot change previously set input primitiv
...
@@ -31,10 +31,14 @@ ERROR: 0:88: 'triangles_adjacency' : cannot change previously set input primitiv
ERROR: 0:89: 'invocations' : not supported for this version or the enabled extensions
ERROR: 0:89: 'invocations' : not supported for this version or the enabled extensions
ERROR: 0:92: 'stream' : member cannot contradict block
ERROR: 0:92: 'stream' : member cannot contradict block
ERROR: 0:92: 'stream' : can only be used on an output
ERROR: 0:92: 'stream' : can only be used on an output
ERROR: 32 compilation errors. No code generated.
ERROR: 0:129: 'gl_ViewportIndex' : required extension not requested: GL_ARB_viewport_array
ERROR: 0:129: 'gl_MaxViewports' : required extension not requested: GL_ARB_viewport_array
ERROR: 0:139: 'gl_ViewportIndex' : identifiers starting with "gl_" are reserved
ERROR: 35 compilation errors. No code generated.
Shader version: 150
Shader version: 150
Requested GL_ARB_viewport_array
invocations = 4
invocations = 4
max_vertices = 200
max_vertices = 200
input primitive = lines_adjacency
input primitive = lines_adjacency
...
@@ -129,6 +133,20 @@ ERROR: node is still EOpNull!
...
@@ -129,6 +133,20 @@ ERROR: node is still EOpNull!
0:107 'summ' (float)
0:107 'summ' (float)
0:107 Constant:
0:107 Constant:
0:107 11332.000000
0:107 11332.000000
0:127 Function Definition: fooe1( (void)
0:127 Function Parameters:
0:129 Sequence
0:129 move second child to first child (int)
0:129 'gl_ViewportIndex' (layout(stream=0 ) out int)
0:129 Constant:
0:129 15 (const int)
0:134 Function Definition: fooe2( (void)
0:134 Function Parameters:
0:136 Sequence
0:136 move second child to first child (int)
0:136 'gl_ViewportIndex' (layout(stream=0 ) out int)
0:136 Constant:
0:136 15 (const int)
0:? Linker Objects
0:? Linker Objects
0:? 'fromV' (in 4-element array of block{in 3-component vector of float color})
0:? 'fromV' (in 4-element array of block{in 3-component vector of float color})
0:? 'toF' (layout(stream=0 ) out block{layout(stream=0 ) out 3-component vector of float color})
0:? 'toF' (layout(stream=0 ) out block{layout(stream=0 ) out 3-component vector of float color})
...
@@ -154,12 +172,14 @@ ERROR: node is still EOpNull!
...
@@ -154,12 +172,14 @@ ERROR: node is still EOpNull!
0:? 'anon@3' (layout(stream=3 ) out block{layout(stream=3 ) out float f15})
0:? 'anon@3' (layout(stream=3 ) out block{layout(stream=3 ) out float f15})
0:? 'anon@4' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform bool b15})
0:? 'anon@4' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform bool b15})
0:? 'summ' (float)
0:? 'summ' (float)
0:? 'gl_ViewportIndex' (layout(stream=3 ) out int)
Linked geometry stage:
Linked geometry stage:
Shader version: 150
Shader version: 150
Requested GL_ARB_viewport_array
invocations = 4
invocations = 4
max_vertices = 200
max_vertices = 200
input primitive = lines_adjacency
input primitive = lines_adjacency
...
@@ -254,6 +274,20 @@ ERROR: node is still EOpNull!
...
@@ -254,6 +274,20 @@ ERROR: node is still EOpNull!
0:107 'summ' (float)
0:107 'summ' (float)
0:107 Constant:
0:107 Constant:
0:107 11332.000000
0:107 11332.000000
0:127 Function Definition: fooe1( (void)
0:127 Function Parameters:
0:129 Sequence
0:129 move second child to first child (int)
0:129 'gl_ViewportIndex' (layout(stream=0 ) out int)
0:129 Constant:
0:129 15 (const int)
0:134 Function Definition: fooe2( (void)
0:134 Function Parameters:
0:136 Sequence
0:136 move second child to first child (int)
0:136 'gl_ViewportIndex' (layout(stream=0 ) out int)
0:136 Constant:
0:136 15 (const int)
0:? Linker Objects
0:? Linker Objects
0:? 'fromV' (in 4-element array of block{in 3-component vector of float color})
0:? 'fromV' (in 4-element array of block{in 3-component vector of float color})
0:? 'toF' (layout(stream=0 ) out block{layout(stream=0 ) out 3-component vector of float color})
0:? 'toF' (layout(stream=0 ) out block{layout(stream=0 ) out 3-component vector of float color})
...
@@ -279,4 +313,5 @@ ERROR: node is still EOpNull!
...
@@ -279,4 +313,5 @@ ERROR: node is still EOpNull!
0:? 'anon@3' (layout(stream=3 ) out block{layout(stream=3 ) out float f15})
0:? 'anon@3' (layout(stream=3 ) out block{layout(stream=3 ) out float f15})
0:? 'anon@4' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform bool b15})
0:? 'anon@4' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform bool b15})
0:? 'summ' (float)
0:? 'summ' (float)
0:? 'gl_ViewportIndex' (layout(stream=3 ) out int)
glslang/MachineIndependent/Initialize.cpp
View file @
ad54b24f
...
@@ -1522,8 +1522,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
...
@@ -1522,8 +1522,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
"};"
"};"
"out int gl_PrimitiveID;"
"out int gl_PrimitiveID;"
"out int gl_Layer;"
"out int gl_Layer;"
);
"
\n
"
);
if
(
version
<
400
&&
profile
==
ECompatibilityProfile
)
if
(
version
<
400
&&
profile
==
ECompatibilityProfile
)
stageBuiltins
[
EShLangGeometry
].
append
(
stageBuiltins
[
EShLangGeometry
].
append
(
...
@@ -1534,10 +1533,12 @@ void TBuiltIns::initialize(int version, EProfile profile)
...
@@ -1534,10 +1533,12 @@ void TBuiltIns::initialize(int version, EProfile profile)
stageBuiltins
[
EShLangGeometry
].
append
(
stageBuiltins
[
EShLangGeometry
].
append
(
"in int gl_InvocationID;"
"in int gl_InvocationID;"
);
);
if
(
version
>=
410
&&
profile
!=
EEsProfile
)
// GL_ARB_viewport_array
if
(
version
>=
150
&&
profile
!=
EEsProfile
)
stageBuiltins
[
EShLangGeometry
].
append
(
stageBuiltins
[
EShLangGeometry
].
append
(
"out int gl_ViewportIndex;"
"out int gl_ViewportIndex;"
);
);
stageBuiltins
[
EShLangGeometry
].
append
(
"
\n
"
);
}
}
//============================================================================
//============================================================================
...
@@ -2462,7 +2463,7 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
...
@@ -2462,7 +2463,7 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
}
}
}
}
if
(
version
>=
41
0
)
{
if
(
version
>=
15
0
)
{
snprintf
(
builtInConstant
,
maxSize
,
"const int gl_MaxViewports = %d;"
,
resources
.
maxViewports
);
snprintf
(
builtInConstant
,
maxSize
,
"const int gl_MaxViewports = %d;"
,
resources
.
maxViewports
);
s
.
append
(
builtInConstant
);
s
.
append
(
builtInConstant
);
}
}
...
@@ -2631,6 +2632,8 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb
...
@@ -2631,6 +2632,8 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb
SpecialQualifier
(
"gl_ClipVertex"
,
EvqClipVertex
,
symbolTable
);
SpecialQualifier
(
"gl_ClipVertex"
,
EvqClipVertex
,
symbolTable
);
SpecialQualifier
(
"gl_VertexID"
,
EvqVertexId
,
symbolTable
);
SpecialQualifier
(
"gl_VertexID"
,
EvqVertexId
,
symbolTable
);
SpecialQualifier
(
"gl_InstanceID"
,
EvqInstanceId
,
symbolTable
);
SpecialQualifier
(
"gl_InstanceID"
,
EvqInstanceId
,
symbolTable
);
if
(
version
<
410
)
symbolTable
.
setVariableExtensions
(
"gl_ViewportIndex"
,
1
,
&
GL_ARB_viewport_array
);
break
;
break
;
case
EShLangFragment
:
case
EShLangFragment
:
...
@@ -2878,6 +2881,8 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb
...
@@ -2878,6 +2881,8 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb
symbolTable
.
setVariableExtensions
(
"gl_MinProgramTexelOffset"
,
1
,
&
GL_ARB_shading_language_420pack
);
symbolTable
.
setVariableExtensions
(
"gl_MinProgramTexelOffset"
,
1
,
&
GL_ARB_shading_language_420pack
);
symbolTable
.
setVariableExtensions
(
"gl_MaxProgramTexelOffset"
,
1
,
&
GL_ARB_shading_language_420pack
);
symbolTable
.
setVariableExtensions
(
"gl_MaxProgramTexelOffset"
,
1
,
&
GL_ARB_shading_language_420pack
);
}
}
if
(
profile
!=
EEsProfile
&&
version
>=
150
&&
version
<
410
)
symbolTable
.
setVariableExtensions
(
"gl_MaxViewports"
,
1
,
&
GL_ARB_viewport_array
);
switch
(
language
)
{
switch
(
language
)
{
case
EShLangFragment
:
case
EShLangFragment
:
...
...
glslang/MachineIndependent/Versions.cpp
View file @
ad54b24f
...
@@ -170,6 +170,7 @@ void TParseContext::initializeExtensionBehavior()
...
@@ -170,6 +170,7 @@ void TParseContext::initializeExtensionBehavior()
extensionBehavior
[
GL_ARB_shader_atomic_counters
]
=
EBhDisable
;
extensionBehavior
[
GL_ARB_shader_atomic_counters
]
=
EBhDisable
;
extensionBehavior
[
GL_ARB_derivative_control
]
=
EBhDisable
;
extensionBehavior
[
GL_ARB_derivative_control
]
=
EBhDisable
;
extensionBehavior
[
GL_ARB_shader_texture_image_samples
]
=
EBhDisable
;
extensionBehavior
[
GL_ARB_shader_texture_image_samples
]
=
EBhDisable
;
extensionBehavior
[
GL_ARB_viewport_array
]
=
EBhDisable
;
// extensionBehavior[GL_ARB_cull_distance] = EBhDisable; // present for 4.5, but need extension control over block members
// extensionBehavior[GL_ARB_cull_distance] = EBhDisable; // present for 4.5, but need extension control over block members
}
}
...
@@ -204,6 +205,7 @@ const char* TParseContext::getPreamble()
...
@@ -204,6 +205,7 @@ const char* TParseContext::getPreamble()
"#define GL_ARB_shader_atomic_counters 1
\n
"
"#define GL_ARB_shader_atomic_counters 1
\n
"
"#define GL_ARB_derivative_control 1
\n
"
"#define GL_ARB_derivative_control 1
\n
"
"#define GL_ARB_shader_texture_image_samples 1
\n
"
"#define GL_ARB_shader_texture_image_samples 1
\n
"
"#define GL_ARB_viewport_array 1
\n
"
// "#define GL_ARB_cull_distance 1\n" // present for 4.5, but need extension control over block members
// "#define GL_ARB_cull_distance 1\n" // present for 4.5, but need extension control over block members
;
;
}
}
...
...
glslang/MachineIndependent/Versions.h
View file @
ad54b24f
...
@@ -94,6 +94,7 @@ const char* const GL_ARB_shader_image_load_store = "GL_ARB_shader_image_loa
...
@@ -94,6 +94,7 @@ const char* const GL_ARB_shader_image_load_store = "GL_ARB_shader_image_loa
const
char
*
const
GL_ARB_shader_atomic_counters
=
"GL_ARB_shader_atomic_counters"
;
const
char
*
const
GL_ARB_shader_atomic_counters
=
"GL_ARB_shader_atomic_counters"
;
const
char
*
const
GL_ARB_derivative_control
=
"GL_ARB_derivative_control"
;
const
char
*
const
GL_ARB_derivative_control
=
"GL_ARB_derivative_control"
;
const
char
*
const
GL_ARB_shader_texture_image_samples
=
"GL_ARB_shader_texture_image_samples"
;
const
char
*
const
GL_ARB_shader_texture_image_samples
=
"GL_ARB_shader_texture_image_samples"
;
const
char
*
const
GL_ARB_viewport_array
=
"GL_ARB_viewport_array"
;
//const char* const GL_ARB_cull_distance = "GL_ARB_cull_distance"; // present for 4.5, but need extension control over block members
//const char* const GL_ARB_cull_distance = "GL_ARB_cull_distance"; // present for 4.5, but need extension control over block members
}
// end namespace glslang
}
// end namespace glslang
...
...
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