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
556ab3ac
Commit
556ab3ac
authored
Aug 16, 2015
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement GL_OES_sample_variables.
parent
a39159a1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
196 additions
and
16 deletions
+196
-16
310.frag
Test/310.frag
+23
-0
310.frag.out
Test/baseResults/310.frag.out
+134
-1
revision.h
glslang/Include/revision.h
+1
-1
Initialize.cpp
glslang/MachineIndependent/Initialize.cpp
+37
-13
Versions.cpp
glslang/MachineIndependent/Versions.cpp
+1
-1
No files found.
Test/310.frag
View file @
556ab3ac
...
@@ -251,3 +251,26 @@ void CAT()
...
@@ -251,3 +251,26 @@ void CAT()
highp
ivec4
b6
=
texture
(
CA6
,
vec4
(
0
.
5
),
0
.
26
);
highp
ivec4
b6
=
texture
(
CA6
,
vec4
(
0
.
5
),
0
.
26
);
highp
uvec4
b7
=
texture
(
CA7
,
vec4
(
0
.
5
),
0
.
27
);
highp
uvec4
b7
=
texture
(
CA7
,
vec4
(
0
.
5
),
0
.
27
);
}
}
void
badSample
()
{
lowp
int
a1
=
gl_SampleID
;
// ERROR, need extension
mediump
vec2
a2
=
gl_SamplePosition
;
// ERROR, need extension
highp
int
a3
=
gl_SampleMaskIn
[
0
];
// ERROR, need extension
gl_SampleMask
[
0
]
=
a3
;
// ERROR, need extension
mediump
int
n
=
gl_NumSamples
;
// ERROR, need extension
}
#ifdef GL_OES_sample_variables
#extension GL_OES_sample_variables : enable
#endif
void
goodSample
()
{
lowp
int
a1
=
gl_SampleID
;
mediump
vec2
a2
=
gl_SamplePosition
;
highp
int
a3
=
gl_SampleMaskIn
[
0
];
gl_SampleMask
[
0
]
=
a3
;
mediump
int
n1
=
gl_MaxSamples
;
mediump
int
n2
=
gl_NumSamples
;
}
Test/baseResults/310.frag.out
View file @
556ab3ac
...
@@ -70,7 +70,12 @@ ERROR: 0:212: 'textureGatherOffsets' : required extension not requested: Possibl
...
@@ -70,7 +70,12 @@ ERROR: 0:212: 'textureGatherOffsets' : required extension not requested: Possibl
GL_EXT_gpu_shader5
GL_EXT_gpu_shader5
GL_OES_gpu_shader5
GL_OES_gpu_shader5
ERROR: 0:223: 'textureGatherOffsets(...)' : must be a compile-time constant: offsets argument
ERROR: 0:223: 'textureGatherOffsets(...)' : must be a compile-time constant: offsets argument
ERROR: 62 compilation errors. No code generated.
ERROR: 0:257: 'gl_SampleID' : required extension not requested: GL_OES_sample_variables
ERROR: 0:258: 'gl_SamplePosition' : required extension not requested: GL_OES_sample_variables
ERROR: 0:259: 'gl_SampleMaskIn' : required extension not requested: GL_OES_sample_variables
ERROR: 0:260: 'gl_SampleMask' : required extension not requested: GL_OES_sample_variables
ERROR: 0:261: 'gl_NumSamples' : required extension not requested: GL_OES_sample_variables
ERROR: 67 compilation errors. No code generated.
Shader version: 310
Shader version: 310
...
@@ -78,6 +83,7 @@ Requested GL_EXT_shader_io_blocks
...
@@ -78,6 +83,7 @@ Requested GL_EXT_shader_io_blocks
Requested GL_EXT_texture_cube_map_array
Requested GL_EXT_texture_cube_map_array
Requested GL_OES_geometry_shader
Requested GL_OES_geometry_shader
Requested GL_OES_gpu_shader5
Requested GL_OES_gpu_shader5
Requested GL_OES_sample_variables
Requested GL_OES_shader_io_blocks
Requested GL_OES_shader_io_blocks
gl_FragCoord pixel center is integer
gl_FragCoord pixel center is integer
gl_FragCoord origin is upper left
gl_FragCoord origin is upper left
...
@@ -483,6 +489,67 @@ ERROR: node is still EOpNull!
...
@@ -483,6 +489,67 @@ ERROR: node is still EOpNull!
0:252 0.500000
0:252 0.500000
0:252 Constant:
0:252 Constant:
0:252 0.270000
0:252 0.270000
0:255 Function Definition: badSample( (global void)
0:255 Function Parameters:
0:257 Sequence
0:257 Sequence
0:257 move second child to first child (temp lowp int)
0:257 'a1' (temp lowp int)
0:257 'gl_SampleID' (flat in lowp int SampleId)
0:258 Sequence
0:258 move second child to first child (temp mediump 2-component vector of float)
0:258 'a2' (temp mediump 2-component vector of float)
0:258 'gl_SamplePosition' (smooth in mediump 2-component vector of float SamplePosition)
0:259 Sequence
0:259 move second child to first child (temp highp int)
0:259 'a3' (temp highp int)
0:259 direct index (flat temp highp int SampleMaskIn)
0:259 'gl_SampleMaskIn' (flat in implicitly-sized array of highp int SampleMaskIn)
0:259 Constant:
0:259 0 (const int)
0:260 move second child to first child (temp highp int)
0:260 direct index (temp highp int SampleMaskIn)
0:260 'gl_SampleMask' (out implicitly-sized array of highp int SampleMaskIn)
0:260 Constant:
0:260 0 (const int)
0:260 'a3' (temp highp int)
0:261 Sequence
0:261 move second child to first child (temp mediump int)
0:261 'n' (temp mediump int)
0:261 'gl_NumSamples' (uniform lowp int)
0:268 Function Definition: goodSample( (global void)
0:268 Function Parameters:
0:270 Sequence
0:270 Sequence
0:270 move second child to first child (temp lowp int)
0:270 'a1' (temp lowp int)
0:270 'gl_SampleID' (flat in lowp int SampleId)
0:271 Sequence
0:271 move second child to first child (temp mediump 2-component vector of float)
0:271 'a2' (temp mediump 2-component vector of float)
0:271 'gl_SamplePosition' (smooth in mediump 2-component vector of float SamplePosition)
0:272 Sequence
0:272 move second child to first child (temp highp int)
0:272 'a3' (temp highp int)
0:272 direct index (flat temp highp int SampleMaskIn)
0:272 'gl_SampleMaskIn' (flat in implicitly-sized array of highp int SampleMaskIn)
0:272 Constant:
0:272 0 (const int)
0:273 move second child to first child (temp highp int)
0:273 direct index (temp highp int SampleMaskIn)
0:273 'gl_SampleMask' (out implicitly-sized array of highp int SampleMaskIn)
0:273 Constant:
0:273 0 (const int)
0:273 'a3' (temp highp int)
0:274 Sequence
0:274 move second child to first child (temp mediump int)
0:274 'n1' (temp mediump int)
0:274 Constant:
0:274 4 (const int)
0:275 Sequence
0:275 move second child to first child (temp mediump int)
0:275 'n2' (temp mediump int)
0:275 'gl_NumSamples' (uniform lowp int)
0:? Linker Objects
0:? Linker Objects
0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float)
0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float)
0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float)
0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float)
...
@@ -556,6 +623,8 @@ ERROR: node is still EOpNull!
...
@@ -556,6 +623,8 @@ ERROR: node is still EOpNull!
0:? 'CA5' (uniform highp samplerCubeArrayShadow)
0:? 'CA5' (uniform highp samplerCubeArrayShadow)
0:? 'CA6' (uniform highp isamplerCubeArray)
0:? 'CA6' (uniform highp isamplerCubeArray)
0:? 'CA7' (uniform highp usamplerCubeArray)
0:? 'CA7' (uniform highp usamplerCubeArray)
0:? 'gl_SampleMaskIn' (flat in implicitly-sized array of highp int SampleMaskIn)
0:? 'gl_SampleMask' (out implicitly-sized array of highp int SampleMaskIn)
Linked fragment stage:
Linked fragment stage:
...
@@ -567,6 +636,7 @@ Requested GL_EXT_shader_io_blocks
...
@@ -567,6 +636,7 @@ Requested GL_EXT_shader_io_blocks
Requested GL_EXT_texture_cube_map_array
Requested GL_EXT_texture_cube_map_array
Requested GL_OES_geometry_shader
Requested GL_OES_geometry_shader
Requested GL_OES_gpu_shader5
Requested GL_OES_gpu_shader5
Requested GL_OES_sample_variables
Requested GL_OES_shader_io_blocks
Requested GL_OES_shader_io_blocks
gl_FragCoord pixel center is integer
gl_FragCoord pixel center is integer
gl_FragCoord origin is upper left
gl_FragCoord origin is upper left
...
@@ -972,6 +1042,67 @@ ERROR: node is still EOpNull!
...
@@ -972,6 +1042,67 @@ ERROR: node is still EOpNull!
0:252 0.500000
0:252 0.500000
0:252 Constant:
0:252 Constant:
0:252 0.270000
0:252 0.270000
0:255 Function Definition: badSample( (global void)
0:255 Function Parameters:
0:257 Sequence
0:257 Sequence
0:257 move second child to first child (temp lowp int)
0:257 'a1' (temp lowp int)
0:257 'gl_SampleID' (flat in lowp int SampleId)
0:258 Sequence
0:258 move second child to first child (temp mediump 2-component vector of float)
0:258 'a2' (temp mediump 2-component vector of float)
0:258 'gl_SamplePosition' (smooth in mediump 2-component vector of float SamplePosition)
0:259 Sequence
0:259 move second child to first child (temp highp int)
0:259 'a3' (temp highp int)
0:259 direct index (flat temp highp int SampleMaskIn)
0:259 'gl_SampleMaskIn' (flat in 1-element array of highp int SampleMaskIn)
0:259 Constant:
0:259 0 (const int)
0:260 move second child to first child (temp highp int)
0:260 direct index (temp highp int SampleMaskIn)
0:260 'gl_SampleMask' (out 1-element array of highp int SampleMaskIn)
0:260 Constant:
0:260 0 (const int)
0:260 'a3' (temp highp int)
0:261 Sequence
0:261 move second child to first child (temp mediump int)
0:261 'n' (temp mediump int)
0:261 'gl_NumSamples' (uniform lowp int)
0:268 Function Definition: goodSample( (global void)
0:268 Function Parameters:
0:270 Sequence
0:270 Sequence
0:270 move second child to first child (temp lowp int)
0:270 'a1' (temp lowp int)
0:270 'gl_SampleID' (flat in lowp int SampleId)
0:271 Sequence
0:271 move second child to first child (temp mediump 2-component vector of float)
0:271 'a2' (temp mediump 2-component vector of float)
0:271 'gl_SamplePosition' (smooth in mediump 2-component vector of float SamplePosition)
0:272 Sequence
0:272 move second child to first child (temp highp int)
0:272 'a3' (temp highp int)
0:272 direct index (flat temp highp int SampleMaskIn)
0:272 'gl_SampleMaskIn' (flat in 1-element array of highp int SampleMaskIn)
0:272 Constant:
0:272 0 (const int)
0:273 move second child to first child (temp highp int)
0:273 direct index (temp highp int SampleMaskIn)
0:273 'gl_SampleMask' (out 1-element array of highp int SampleMaskIn)
0:273 Constant:
0:273 0 (const int)
0:273 'a3' (temp highp int)
0:274 Sequence
0:274 move second child to first child (temp mediump int)
0:274 'n1' (temp mediump int)
0:274 Constant:
0:274 4 (const int)
0:275 Sequence
0:275 move second child to first child (temp mediump int)
0:275 'n2' (temp mediump int)
0:275 'gl_NumSamples' (uniform lowp int)
0:? Linker Objects
0:? Linker Objects
0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float)
0:? 'gl_FragCoord' (smooth in mediump 4-component vector of float)
0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float)
0:? 'v3' (layout(location=2 ) smooth in mediump 3-component vector of float)
...
@@ -1045,4 +1176,6 @@ ERROR: node is still EOpNull!
...
@@ -1045,4 +1176,6 @@ ERROR: node is still EOpNull!
0:? 'CA5' (uniform highp samplerCubeArrayShadow)
0:? 'CA5' (uniform highp samplerCubeArrayShadow)
0:? 'CA6' (uniform highp isamplerCubeArray)
0:? 'CA6' (uniform highp isamplerCubeArray)
0:? 'CA7' (uniform highp usamplerCubeArray)
0:? 'CA7' (uniform highp usamplerCubeArray)
0:? 'gl_SampleMaskIn' (flat in 1-element array of highp int SampleMaskIn)
0:? 'gl_SampleMask' (out 1-element array of highp int SampleMaskIn)
glslang/Include/revision.h
View file @
556ab3ac
...
@@ -2,5 +2,5 @@
...
@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// 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).
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "2.3.71
8
"
#define GLSLANG_REVISION "2.3.71
9
"
#define GLSLANG_DATE "16-Aug-2015"
#define GLSLANG_DATE "16-Aug-2015"
glslang/MachineIndependent/Initialize.cpp
View file @
556ab3ac
...
@@ -1766,6 +1766,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
...
@@ -1766,6 +1766,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
" in vec2 gl_SamplePosition;"
" in vec2 gl_SamplePosition;"
"flat in int gl_SampleMaskIn[];"
"flat in int gl_SampleMaskIn[];"
" out int gl_SampleMask[];"
" out int gl_SampleMask[];"
"uniform int gl_NumSamples;"
);
);
if
(
version
>=
430
)
if
(
version
>=
430
)
...
@@ -1782,26 +1783,36 @@ void TBuiltIns::initialize(int version, EProfile profile)
...
@@ -1782,26 +1783,36 @@ void TBuiltIns::initialize(int version, EProfile profile)
}
else
{
}
else
{
// ES profile
// ES profile
if
(
version
==
100
)
if
(
version
==
100
)
{
stageBuiltins
[
EShLangFragment
].
append
(
stageBuiltins
[
EShLangFragment
].
append
(
"mediump vec4 gl_FragCoord;"
// needs qualifier fixed later
"mediump vec4 gl_FragCoord;"
// needs qualifier fixed later
" bool gl_FrontFacing;"
// needs qualifier fixed later
" bool gl_FrontFacing;"
// needs qualifier fixed later
"mediump vec4 gl_FragColor;"
// needs qualifier fixed later
"mediump vec4 gl_FragColor;"
// needs qualifier fixed later
"mediump vec2 gl_PointCoord;"
// needs qualifier fixed later
"mediump vec2 gl_PointCoord;"
// needs qualifier fixed later
);
);
else
if
(
version
>=
300
)
{
}
if
(
version
>=
300
)
{
stageBuiltins
[
EShLangFragment
].
append
(
stageBuiltins
[
EShLangFragment
].
append
(
"highp vec4 gl_FragCoord;"
// needs qualifier fixed later
"highp vec4 gl_FragCoord;"
// needs qualifier fixed later
" bool gl_FrontFacing;"
// needs qualifier fixed later
" bool gl_FrontFacing;"
// needs qualifier fixed later
"mediump vec2 gl_PointCoord;"
// needs qualifier fixed later
"mediump vec2 gl_PointCoord;"
// needs qualifier fixed later
"highp float gl_FragDepth;"
// needs qualifier fixed later
"highp float gl_FragDepth;"
// needs qualifier fixed later
);
);
if
(
version
>=
310
)
}
stageBuiltins
[
EShLangFragment
].
append
(
if
(
version
>=
310
)
{
"bool gl_HelperInvocation;"
// needs qualifier fixed later
stageBuiltins
[
EShLangFragment
].
append
(
"flat in highp int gl_PrimitiveID;"
// needs qualifier fixed later
"bool gl_HelperInvocation;"
// needs qualifier fixed later
"flat in highp int gl_Layer;"
// needs qualifier fixed later
"flat in highp int gl_PrimitiveID;"
// needs qualifier fixed later
);
"flat in highp int gl_Layer;"
// needs qualifier fixed later
);
stageBuiltins
[
EShLangFragment
].
append
(
// GL_OES_sample_variables
"flat lowp in int gl_SampleID;"
" mediump in vec2 gl_SamplePosition;"
"flat highp in int gl_SampleMaskIn[];"
" highp out int gl_SampleMask[];"
"uniform lowp int gl_NumSamples;"
);
}
}
stageBuiltins
[
EShLangFragment
].
append
(
stageBuiltins
[
EShLangFragment
].
append
(
"highp float gl_FragDepthEXT;"
// GL_EXT_frag_depth
"highp float gl_FragDepthEXT;"
// GL_EXT_frag_depth
...
@@ -2719,7 +2730,8 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
...
@@ -2719,7 +2730,8 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
}
}
// GL_ARB_ES3_1_compatibility
// GL_ARB_ES3_1_compatibility
if
(
profile
!=
EEsProfile
&&
version
>=
450
)
{
if
((
profile
!=
EEsProfile
&&
version
>=
450
)
||
(
profile
==
EEsProfile
&&
version
>=
310
))
{
snprintf
(
builtInConstant
,
maxSize
,
"const int gl_MaxSamples = %d;"
,
resources
.
maxSamples
);
snprintf
(
builtInConstant
,
maxSize
,
"const int gl_MaxSamples = %d;"
,
resources
.
maxSamples
);
s
.
append
(
builtInConstant
);
s
.
append
(
builtInConstant
);
}
}
...
@@ -2935,10 +2947,22 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb
...
@@ -2935,10 +2947,22 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb
BuiltInVariable
(
"gl_ClipDistance"
,
EbvClipDistance
,
symbolTable
);
BuiltInVariable
(
"gl_ClipDistance"
,
EbvClipDistance
,
symbolTable
);
BuiltInVariable
(
"gl_CullDistance"
,
EbvCullDistance
,
symbolTable
);
BuiltInVariable
(
"gl_CullDistance"
,
EbvCullDistance
,
symbolTable
);
BuiltInVariable
(
"gl_PrimitiveID"
,
EbvPrimitiveId
,
symbolTable
);
BuiltInVariable
(
"gl_PrimitiveID"
,
EbvPrimitiveId
,
symbolTable
);
BuiltInVariable
(
"gl_SampleID"
,
EbvSampleId
,
symbolTable
);
BuiltInVariable
(
"gl_SamplePosition"
,
EbvSamplePosition
,
symbolTable
);
if
((
profile
!=
EEsProfile
&&
version
>=
400
)
||
BuiltInVariable
(
"gl_SampleMaskIn"
,
EbvSampleMask
,
symbolTable
);
(
profile
==
EEsProfile
&&
version
>=
310
))
{
BuiltInVariable
(
"gl_SampleMask"
,
EbvSampleMask
,
symbolTable
);
BuiltInVariable
(
"gl_SampleID"
,
EbvSampleId
,
symbolTable
);
BuiltInVariable
(
"gl_SamplePosition"
,
EbvSamplePosition
,
symbolTable
);
BuiltInVariable
(
"gl_SampleMaskIn"
,
EbvSampleMask
,
symbolTable
);
BuiltInVariable
(
"gl_SampleMask"
,
EbvSampleMask
,
symbolTable
);
if
(
profile
==
EEsProfile
)
{
symbolTable
.
setVariableExtensions
(
"gl_SampleID"
,
1
,
&
E_GL_OES_sample_variables
);
symbolTable
.
setVariableExtensions
(
"gl_SamplePosition"
,
1
,
&
E_GL_OES_sample_variables
);
symbolTable
.
setVariableExtensions
(
"gl_SampleMaskIn"
,
1
,
&
E_GL_OES_sample_variables
);
symbolTable
.
setVariableExtensions
(
"gl_SampleMask"
,
1
,
&
E_GL_OES_sample_variables
);
symbolTable
.
setVariableExtensions
(
"gl_NumSamples"
,
1
,
&
E_GL_OES_sample_variables
);
}
}
BuiltInVariable
(
"gl_Layer"
,
EbvLayer
,
symbolTable
);
BuiltInVariable
(
"gl_Layer"
,
EbvLayer
,
symbolTable
);
BuiltInVariable
(
"gl_ViewportIndex"
,
EbvViewportIndex
,
symbolTable
);
BuiltInVariable
(
"gl_ViewportIndex"
,
EbvViewportIndex
,
symbolTable
);
...
...
glslang/MachineIndependent/Versions.cpp
View file @
556ab3ac
...
@@ -181,7 +181,7 @@ void TParseContext::initializeExtensionBehavior()
...
@@ -181,7 +181,7 @@ void TParseContext::initializeExtensionBehavior()
// AEP
// AEP
extensionBehavior
[
E_GL_ANDROID_extension_pack_es31a
]
=
EBhDisablePartial
;
extensionBehavior
[
E_GL_ANDROID_extension_pack_es31a
]
=
EBhDisablePartial
;
extensionBehavior
[
E_GL_KHR_blend_equation_advanced
]
=
EBhDisablePartial
;
extensionBehavior
[
E_GL_KHR_blend_equation_advanced
]
=
EBhDisablePartial
;
extensionBehavior
[
E_GL_OES_sample_variables
]
=
EBhDisable
Partial
;
extensionBehavior
[
E_GL_OES_sample_variables
]
=
EBhDisable
;
extensionBehavior
[
E_GL_OES_shader_image_atomic
]
=
EBhDisablePartial
;
extensionBehavior
[
E_GL_OES_shader_image_atomic
]
=
EBhDisablePartial
;
extensionBehavior
[
E_GL_OES_shader_multisample_interpolation
]
=
EBhDisablePartial
;
extensionBehavior
[
E_GL_OES_shader_multisample_interpolation
]
=
EBhDisablePartial
;
extensionBehavior
[
E_GL_OES_texture_storage_multisample_2d_array
]
=
EBhDisable
;
extensionBehavior
[
E_GL_OES_texture_storage_multisample_2d_array
]
=
EBhDisable
;
...
...
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