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
9f46e3dd
Unverified
Commit
9f46e3dd
authored
Apr 17, 2020
by
pmistryNV
Committed by
GitHub
Apr 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for extension GL_ARB_shader_bit_encoding (#2183)
parent
4d2298bf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
4 deletions
+76
-4
150.frag
Test/150.frag
+22
-2
150.frag.out
Test/baseResults/150.frag.out
+43
-1
Initialize.cpp
glslang/MachineIndependent/Initialize.cpp
+8
-1
Versions.cpp
glslang/MachineIndependent/Versions.cpp
+2
-0
Versions.h
glslang/MachineIndependent/Versions.h
+1
-0
No files found.
Test/150.frag
View file @
9f46e3dd
...
@@ -57,4 +57,25 @@ double type3 = 2.0;
...
@@ -57,4 +57,25 @@ double type3 = 2.0;
int
absTest
=
sqrt
(
type3
);
int
absTest
=
sqrt
(
type3
);
double
absTest2
=
sqrt
(
type3
);
double
absTest2
=
sqrt
(
type3
);
double
absTest3
=
sqrt
(
2
);
double
absTest3
=
sqrt
(
2
);
float
dk
=
sqrt
(
11
);
float
dk
=
sqrt
(
11
);
\ No newline at end of file
#extension GL_ARB_shader_bit_encoding: enable
float
f
;
vec4
v4
;
ivec4
iv4a
;
uvec2
uv2c
;
void
bitEncodingPass
()
{
int
i
=
floatBitsToInt
(
f
);
uvec4
uv11
=
floatBitsToUint
(
v4
);
vec4
v14
=
intBitsToFloat
(
iv4a
);
vec2
v15
=
uintBitsToFloat
(
uv2c
);
}
#extension GL_ARB_shader_bit_encoding: disable
void
bitEncodingFail
()
{
int
i
=
floatBitsToInt
(
f
);
// Error, extention GL_ARB_bit_encoding is diabled
}
Test/baseResults/150.frag.out
View file @
9f46e3dd
...
@@ -9,11 +9,13 @@ ERROR: 0:53: 'double' : Reserved word.
...
@@ -9,11 +9,13 @@ ERROR: 0:53: 'double' : Reserved word.
ERROR: 0:53: 'double' : not supported for this version or the enabled extensions
ERROR: 0:53: 'double' : not supported for this version or the enabled extensions
ERROR: 0:53: 'double' : must be qualified as flat in
ERROR: 0:53: 'double' : must be qualified as flat in
ERROR: 0:57: '=' : cannot convert from ' global double' to ' global int'
ERROR: 0:57: '=' : cannot convert from ' global double' to ' global int'
ERROR: 10 compilation errors. No code generated.
ERROR: 0:80: 'floatBitsToInt' : required extension not requested: GL_ARB_shader_bit_encoding
ERROR: 11 compilation errors. No code generated.
Shader version: 150
Shader version: 150
Requested GL_ARB_gpu_shader_fp64
Requested GL_ARB_gpu_shader_fp64
Requested GL_ARB_shader_bit_encoding
gl_FragCoord pixel center is integer
gl_FragCoord pixel center is integer
gl_FragCoord origin is upper left
gl_FragCoord origin is upper left
ERROR: node is still EOpNull!
ERROR: node is still EOpNull!
...
@@ -134,6 +136,37 @@ ERROR: node is still EOpNull!
...
@@ -134,6 +136,37 @@ ERROR: node is still EOpNull!
0:60 'dk' ( global float)
0:60 'dk' ( global float)
0:60 Constant:
0:60 Constant:
0:60 3.316625
0:60 3.316625
0:68 Function Definition: bitEncodingPass( ( global void)
0:68 Function Parameters:
0:70 Sequence
0:70 Sequence
0:70 move second child to first child ( temp int)
0:70 'i' ( temp int)
0:70 floatBitsToInt ( global int)
0:70 'f' ( global float)
0:71 Sequence
0:71 move second child to first child ( temp 4-component vector of uint)
0:71 'uv11' ( temp 4-component vector of uint)
0:71 floatBitsToUint ( global 4-component vector of uint)
0:71 'v4' ( global 4-component vector of float)
0:72 Sequence
0:72 move second child to first child ( temp 4-component vector of float)
0:72 'v14' ( temp 4-component vector of float)
0:72 intBitsToFloat ( global 4-component vector of float)
0:72 'iv4a' ( global 4-component vector of int)
0:73 Sequence
0:73 move second child to first child ( temp 2-component vector of float)
0:73 'v15' ( temp 2-component vector of float)
0:73 uintBitsToFloat ( global 2-component vector of float)
0:73 'uv2c' ( global 2-component vector of uint)
0:78 Function Definition: bitEncodingFail( ( global void)
0:78 Function Parameters:
0:80 Sequence
0:80 Sequence
0:80 move second child to first child ( temp int)
0:80 'i' ( temp int)
0:80 floatBitsToInt ( global int)
0:80 'f' ( global float)
0:? Linker Objects
0:? Linker Objects
0:? 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord)
0:? 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord)
0:? 'foo' ( smooth in 4-component vector of float)
0:? 'foo' ( smooth in 4-component vector of float)
...
@@ -155,6 +188,10 @@ ERROR: node is still EOpNull!
...
@@ -155,6 +188,10 @@ ERROR: node is still EOpNull!
0:? 'absTest2' ( global double)
0:? 'absTest2' ( global double)
0:? 'absTest3' ( global double)
0:? 'absTest3' ( global double)
0:? 'dk' ( global float)
0:? 'dk' ( global float)
0:? 'f' ( global float)
0:? 'v4' ( global 4-component vector of float)
0:? 'iv4a' ( global 4-component vector of int)
0:? 'uv2c' ( global 2-component vector of uint)
Linked fragment stage:
Linked fragment stage:
...
@@ -162,6 +199,7 @@ Linked fragment stage:
...
@@ -162,6 +199,7 @@ Linked fragment stage:
Shader version: 150
Shader version: 150
Requested GL_ARB_gpu_shader_fp64
Requested GL_ARB_gpu_shader_fp64
Requested GL_ARB_shader_bit_encoding
gl_FragCoord pixel center is integer
gl_FragCoord pixel center is integer
gl_FragCoord origin is upper left
gl_FragCoord origin is upper left
ERROR: node is still EOpNull!
ERROR: node is still EOpNull!
...
@@ -218,4 +256,8 @@ ERROR: node is still EOpNull!
...
@@ -218,4 +256,8 @@ ERROR: node is still EOpNull!
0:? 'absTest2' ( global double)
0:? 'absTest2' ( global double)
0:? 'absTest3' ( global double)
0:? 'absTest3' ( global double)
0:? 'dk' ( global float)
0:? 'dk' ( global float)
0:? 'f' ( global float)
0:? 'v4' ( global 4-component vector of float)
0:? 'iv4a' ( global 4-component vector of int)
0:? 'uv2c' ( global 2-component vector of uint)
glslang/MachineIndependent/Initialize.cpp
View file @
9f46e3dd
...
@@ -1262,7 +1262,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
...
@@ -1262,7 +1262,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
#endif
#endif
if
((
profile
==
EEsProfile
&&
version
>=
300
)
||
if
((
profile
==
EEsProfile
&&
version
>=
300
)
||
(
profile
!=
EEsProfile
&&
version
>=
330
))
{
(
profile
!=
EEsProfile
&&
version
>=
150
))
{
// GL_ARB_shader_bit_encoding
commonBuiltins
.
append
(
commonBuiltins
.
append
(
"int floatBitsToInt(highp float value);"
"int floatBitsToInt(highp float value);"
"ivec2 floatBitsToInt(highp vec2 value);"
"ivec2 floatBitsToInt(highp vec2 value);"
...
@@ -7816,6 +7816,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
...
@@ -7816,6 +7816,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable
.
setFunctionExtensions
(
"imageAtomicCompSwap"
,
1
,
&
E_GL_OES_shader_image_atomic
);
symbolTable
.
setFunctionExtensions
(
"imageAtomicCompSwap"
,
1
,
&
E_GL_OES_shader_image_atomic
);
}
}
if
(
profile
!=
EEsProfile
&&
version
<
330
)
{
symbolTable
.
setFunctionExtensions
(
"floatBitsToInt"
,
1
,
&
E_GL_ARB_shader_bit_encoding
);
symbolTable
.
setFunctionExtensions
(
"floatBitsToUint"
,
1
,
&
E_GL_ARB_shader_bit_encoding
);
symbolTable
.
setFunctionExtensions
(
"intBitsToFloat"
,
1
,
&
E_GL_ARB_shader_bit_encoding
);
symbolTable
.
setFunctionExtensions
(
"uintBitsToFloat"
,
1
,
&
E_GL_ARB_shader_bit_encoding
);
}
symbolTable
.
setVariableExtensions
(
"gl_DeviceIndex"
,
1
,
&
E_GL_EXT_device_group
);
symbolTable
.
setVariableExtensions
(
"gl_DeviceIndex"
,
1
,
&
E_GL_EXT_device_group
);
BuiltInVariable
(
"gl_DeviceIndex"
,
EbvDeviceIndex
,
symbolTable
);
BuiltInVariable
(
"gl_DeviceIndex"
,
EbvDeviceIndex
,
symbolTable
);
symbolTable
.
setVariableExtensions
(
"gl_ViewIndex"
,
1
,
&
E_GL_EXT_multiview
);
symbolTable
.
setVariableExtensions
(
"gl_ViewIndex"
,
1
,
&
E_GL_EXT_multiview
);
...
...
glslang/MachineIndependent/Versions.cpp
View file @
9f46e3dd
...
@@ -197,6 +197,7 @@ void TParseVersions::initializeExtensionBehavior()
...
@@ -197,6 +197,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior
[
E_GL_ARB_shader_clock
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_shader_clock
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_uniform_buffer_object
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_uniform_buffer_object
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_sample_shading
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_sample_shading
]
=
EBhDisable
;
extensionBehavior
[
E_GL_ARB_shader_bit_encoding
]
=
EBhDisable
;
extensionBehavior
[
E_GL_KHR_shader_subgroup_basic
]
=
EBhDisable
;
extensionBehavior
[
E_GL_KHR_shader_subgroup_basic
]
=
EBhDisable
;
extensionBehavior
[
E_GL_KHR_shader_subgroup_vote
]
=
EBhDisable
;
extensionBehavior
[
E_GL_KHR_shader_subgroup_vote
]
=
EBhDisable
;
...
@@ -409,6 +410,7 @@ void TParseVersions::getPreamble(std::string& preamble)
...
@@ -409,6 +410,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_ARB_post_depth_coverage 1
\n
"
"#define GL_ARB_post_depth_coverage 1
\n
"
"#define GL_ARB_fragment_shader_interlock 1
\n
"
"#define GL_ARB_fragment_shader_interlock 1
\n
"
"#define GL_ARB_uniform_buffer_object 1
\n
"
"#define GL_ARB_uniform_buffer_object 1
\n
"
"#define GL_ARB_shader_bit_encoding 1
\n
"
"#define GL_EXT_shader_non_constant_global_initializers 1
\n
"
"#define GL_EXT_shader_non_constant_global_initializers 1
\n
"
"#define GL_EXT_shader_image_load_formatted 1
\n
"
"#define GL_EXT_shader_image_load_formatted 1
\n
"
"#define GL_EXT_post_depth_coverage 1
\n
"
"#define GL_EXT_post_depth_coverage 1
\n
"
...
...
glslang/MachineIndependent/Versions.h
View file @
9f46e3dd
...
@@ -152,6 +152,7 @@ const char* const E_GL_ARB_fragment_shader_interlock = "GL_ARB_fragment_shade
...
@@ -152,6 +152,7 @@ const char* const E_GL_ARB_fragment_shader_interlock = "GL_ARB_fragment_shade
const
char
*
const
E_GL_ARB_shader_clock
=
"GL_ARB_shader_clock"
;
const
char
*
const
E_GL_ARB_shader_clock
=
"GL_ARB_shader_clock"
;
const
char
*
const
E_GL_ARB_uniform_buffer_object
=
"GL_ARB_uniform_buffer_object"
;
const
char
*
const
E_GL_ARB_uniform_buffer_object
=
"GL_ARB_uniform_buffer_object"
;
const
char
*
const
E_GL_ARB_sample_shading
=
"GL_ARB_sample_shading"
;
const
char
*
const
E_GL_ARB_sample_shading
=
"GL_ARB_sample_shading"
;
const
char
*
const
E_GL_ARB_shader_bit_encoding
=
"GL_ARB_shader_bit_encoding"
;
const
char
*
const
E_GL_KHR_shader_subgroup_basic
=
"GL_KHR_shader_subgroup_basic"
;
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"
;
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