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
01aee059
Unverified
Commit
01aee059
authored
Dec 29, 2019
by
John Kessenich
Committed by
GitHub
Dec 29, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1995 from ShchchowAMD/ARB_sample_shading_support
Add support for ARB_sample_shading
parents
5de15a25
78b11804
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
15 deletions
+38
-15
130.frag
Test/130.frag
+3
-0
130.frag.out
Test/baseResults/130.frag.out
+0
-0
Initialize.cpp
glslang/MachineIndependent/Initialize.cpp
+32
-15
Versions.cpp
glslang/MachineIndependent/Versions.cpp
+2
-0
Versions.h
glslang/MachineIndependent/Versions.h
+1
-0
No files found.
Test/130.frag
View file @
01aee059
...
...
@@ -62,12 +62,14 @@ void bar2()
b3
<
b3
;
// ERROR
uv3
>
uv3
;
// ERROR
uvec2
(
2
,
3
)
>=
uvec2
(
3
,
3
);
// ERROR
int
samples
=
gl_NumSamples
;
// ERROR
int
(
bl4
)
<=
int
(
bl4
);
// true
int
(
bl4
.
x
)
>
int
(
bl4
.
y
);
// false
}
#extension GL_ARB_texture_gather : enable
#extension GL_ARB_texture_rectangle : enable
#extension GL_ARB_sample_shading : enable
uniform
sampler2D
samp2D
;
uniform
sampler2DShadow
samp2DS
;
...
...
@@ -83,6 +85,7 @@ void bar23()
s
=
textureGatherOffset
(
samp2DA
,
vec3
(
0
.
3
),
ivec2
(
1
));
s
=
textureGatherOffset
(
samp2DS
,
vec2
(
0
.
3
),
1
.
3
,
ivec2
(
1
));
// ERROR
s
=
textureGatherOffset
(
samp2D
,
vec2
(
0
.
3
),
ivec2
(
1
),
2
);
// ERROR
int
samples
=
gl_NumSamples
;
}
#extension GL_ARB_gpu_shader5 : enable
...
...
Test/baseResults/130.frag.out
View file @
01aee059
This diff is collapsed.
Click to expand it.
glslang/MachineIndependent/Initialize.cpp
View file @
01aee059
...
...
@@ -5178,19 +5178,25 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"flat in int gl_PrimitiveID;"
);
if
(
version
>=
400
)
{
if
(
version
>=
130
)
{
// ARB_sample_shading
stageBuiltins
[
EShLangFragment
].
append
(
"flat in int gl_SampleID;"
" in vec2 gl_SamplePosition;"
"flat in int gl_SampleMaskIn[];"
" out int gl_SampleMask[];"
);
if
(
spvVersion
.
spv
==
0
)
if
(
spvVersion
.
spv
==
0
)
{
stageBuiltins
[
EShLangFragment
].
append
(
"uniform int gl_NumSamples;"
);
);
}
}
if
(
version
>=
400
)
stageBuiltins
[
EShLangFragment
].
append
(
"flat in int gl_SampleMaskIn[];"
);
if
(
version
>=
430
)
stageBuiltins
[
EShLangFragment
].
append
(
"flat in int gl_Layer;"
...
...
@@ -7422,18 +7428,29 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
BuiltInVariable
(
"gl_FragStencilRefARB"
,
EbvFragStencilRef
,
symbolTable
);
}
if
((
profile
!=
EEsProfile
&&
version
>=
40
0
)
||
if
((
profile
!=
EEsProfile
&&
version
>=
13
0
)
||
(
profile
==
EEsProfile
&&
version
>=
310
))
{
BuiltInVariable
(
"gl_SampleID"
,
EbvSampleId
,
symbolTable
);
BuiltInVariable
(
"gl_SamplePosition"
,
EbvSamplePosition
,
symbolTable
);
BuiltInVariable
(
"gl_SampleMaskIn"
,
EbvSampleMask
,
symbolTable
);
BuiltInVariable
(
"gl_SampleMask"
,
EbvSampleMask
,
symbolTable
);
if
(
profile
==
EEsProfile
&&
version
<
320
)
{
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_SampleID"
,
EbvSampleId
,
symbolTable
);
BuiltInVariable
(
"gl_SamplePosition"
,
EbvSamplePosition
,
symbolTable
);
BuiltInVariable
(
"gl_SampleMask"
,
EbvSampleMask
,
symbolTable
);
if
(
profile
!=
EEsProfile
&&
version
<
400
)
{
BuiltInVariable
(
"gl_NumSamples"
,
EbvSampleMask
,
symbolTable
);
symbolTable
.
setVariableExtensions
(
"gl_SampleMask"
,
1
,
&
E_GL_ARB_sample_shading
);
symbolTable
.
setVariableExtensions
(
"gl_SampleID"
,
1
,
&
E_GL_ARB_sample_shading
);
symbolTable
.
setVariableExtensions
(
"gl_SamplePosition"
,
1
,
&
E_GL_ARB_sample_shading
);
symbolTable
.
setVariableExtensions
(
"gl_NumSamples"
,
1
,
&
E_GL_ARB_sample_shading
);
}
else
{
BuiltInVariable
(
"gl_SampleMaskIn"
,
EbvSampleMask
,
symbolTable
);
if
(
profile
==
EEsProfile
&&
version
<
320
)
{
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
);
}
}
}
...
...
glslang/MachineIndependent/Versions.cpp
View file @
01aee059
...
...
@@ -192,6 +192,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior
[
E_GL_ARB_shader_viewport_layer_array
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_fragment_shader_interlock
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_shader_clock
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_sample_shading
]
=
EBhDisable
;
extensionBehavior
[
E_GL_KHR_shader_subgroup_basic
]
=
EBhDisable
;
extensionBehavior
[
E_GL_KHR_shader_subgroup_vote
]
=
EBhDisable
;
...
...
@@ -394,6 +395,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_ARB_sparse_texture2 1
\n
"
"#define GL_ARB_sparse_texture_clamp 1
\n
"
"#define GL_ARB_shader_stencil_export 1
\n
"
"#define GL_ARB_sample_shading 1
\n
"
// "#define GL_ARB_cull_distance 1\n" // present for 4.5, but need extension control over block members
"#define GL_ARB_post_depth_coverage 1
\n
"
"#define GL_ARB_fragment_shader_interlock 1
\n
"
...
...
glslang/MachineIndependent/Versions.h
View file @
01aee059
...
...
@@ -144,6 +144,7 @@ const char* const E_GL_ARB_post_depth_coverage = "GL_ARB_post_depth_cov
const
char
*
const
E_GL_ARB_shader_viewport_layer_array
=
"GL_ARB_shader_viewport_layer_array"
;
const
char
*
const
E_GL_ARB_fragment_shader_interlock
=
"GL_ARB_fragment_shader_interlock"
;
const
char
*
const
E_GL_ARB_shader_clock
=
"GL_ARB_shader_clock"
;
const
char
*
const
E_GL_ARB_sample_shading
=
"GL_ARB_sample_shading"
;
const
char
*
const
E_GL_KHR_shader_subgroup_basic
=
"GL_KHR_shader_subgroup_basic"
;
const
char
*
const
E_GL_KHR_shader_subgroup_vote
=
"GL_KHR_shader_subgroup_vote"
;
...
...
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