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
f44d89a3
Commit
f44d89a3
authored
Feb 16, 2017
by
Jason Ekstrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement GL_EXT_shader_image_load_formatted
parent
d9502833
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
92 additions
and
12 deletions
+92
-12
310.comp.out
Test/baseResults/310.comp.out
+4
-4
310.frag.out
Test/baseResults/310.frag.out
+5
-5
420.vert.out
Test/baseResults/420.vert.out
+1
-1
spv.image.load-formatted.frag.out
Test/baseResults/spv.image.load-formatted.frag.out
+0
-0
spv.image.load-formatted.frag
Test/spv.image.load-formatted.frag
+74
-0
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+5
-2
Versions.cpp
glslang/MachineIndependent/Versions.cpp
+2
-0
Versions.h
glslang/MachineIndependent/Versions.h
+1
-0
No files found.
Test/baseResults/310.comp.out
View file @
f44d89a3
...
@@ -16,7 +16,7 @@ ERROR: 0:47: 'local_size' : can only apply to 'in'
...
@@ -16,7 +16,7 @@ ERROR: 0:47: 'local_size' : can only apply to 'in'
ERROR: 0:61: 'assign' : l-value required "ro" (can't modify a readonly buffer)
ERROR: 0:61: 'assign' : l-value required "ro" (can't modify a readonly buffer)
ERROR: 0:66: 'buffer' : buffers can be declared only as blocks
ERROR: 0:66: 'buffer' : buffers can be declared only as blocks
ERROR: 0:68: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:68: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:76: '
' : image variables not declared 'writeonly' must have a format layout qualifier
ERROR: 0:76: '
image variables declared 'writeonly' without a format layout qualifier' : not supported with this profile: es
ERROR: 0:81: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:81: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:82: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:82: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:87: 'imageAtomicCompSwap' : required extension not requested: GL_OES_shader_image_atomic
ERROR: 0:87: 'imageAtomicCompSwap' : required extension not requested: GL_OES_shader_image_atomic
...
@@ -54,12 +54,12 @@ ERROR: 0:171: 'samplerCubeArray' : Reserved word.
...
@@ -54,12 +54,12 @@ ERROR: 0:171: 'samplerCubeArray' : Reserved word.
ERROR: 0:171: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:171: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:172: 'iimage2DRect' : Reserved word.
ERROR: 0:172: 'iimage2DRect' : Reserved word.
ERROR: 0:172: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:172: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:172: '
' : image variables not declared 'writeonly' must have a format layout qualifier
ERROR: 0:172: '
image variables declared 'writeonly' without a format layout qualifier' : not supported with this profile: es
ERROR: 0:173: 'image2DMS' : Reserved word.
ERROR: 0:173: 'image2DMS' : Reserved word.
ERROR: 0:173: '
' : image variables not declared 'writeonly' must have a format layout qualifier
ERROR: 0:173: '
image variables declared 'writeonly' without a format layout qualifier' : not supported with this profile: es
ERROR: 0:174: 'uimage2DMSArray' : Reserved word.
ERROR: 0:174: 'uimage2DMSArray' : Reserved word.
ERROR: 0:174: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:174: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:174: '
' : image variables not declared 'writeonly' must have a format layout qualifier
ERROR: 0:174: '
image variables declared 'writeonly' without a format layout qualifier' : not supported with this profile: es
ERROR: 0:181: 'rgba32f' : format requires readonly or writeonly memory qualifier
ERROR: 0:181: 'rgba32f' : format requires readonly or writeonly memory qualifier
ERROR: 0:182: 'rgba8i' : format requires readonly or writeonly memory qualifier
ERROR: 0:182: 'rgba8i' : format requires readonly or writeonly memory qualifier
ERROR: 0:183: 'rgba16ui' : format requires readonly or writeonly memory qualifier
ERROR: 0:183: 'rgba16ui' : format requires readonly or writeonly memory qualifier
...
...
Test/baseResults/310.frag.out
View file @
f44d89a3
...
@@ -19,13 +19,13 @@ ERROR: 0:44: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset,
...
@@ -19,13 +19,13 @@ ERROR: 0:44: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset,
ERROR: 0:45: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]
ERROR: 0:45: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]
ERROR: 0:45: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]
ERROR: 0:45: 'texel offset' : value is out of range: [gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]
ERROR: 0:66: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:66: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:66: '
' : image variables not declared 'writeonly' must have a format layout qualifier
ERROR: 0:66: '
image variables declared 'writeonly' without a format layout qualifier' : not supported with this profile: es
ERROR: 0:67: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:67: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:67: '
' : image variables not declared 'writeonly' must have a format layout qualifier
ERROR: 0:67: '
image variables declared 'writeonly' without a format layout qualifier' : not supported with this profile: es
ERROR: 0:68: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:68: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:68: '
' : image variables not declared 'writeonly' must have a format layout qualifier
ERROR: 0:68: '
image variables declared 'writeonly' without a format layout qualifier' : not supported with this profile: es
ERROR: 0:69: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:69: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:69: '
' : image variables not declared 'writeonly' must have a format layout qualifier
ERROR: 0:69: '
image variables declared 'writeonly' without a format layout qualifier' : not supported with this profile: es
ERROR: 0:73: 'binding' : requires block, or sampler/image, or atomic-counter type
ERROR: 0:73: 'binding' : requires block, or sampler/image, or atomic-counter type
ERROR: 0:77: 'location' : location is too large
ERROR: 0:77: 'location' : location is too large
ERROR: 0:81: 'location' : too large for fragment output
ERROR: 0:81: 'location' : too large for fragment output
...
@@ -36,7 +36,7 @@ ERROR: 0:83: 'layout-id value' : cannot be negative
...
@@ -36,7 +36,7 @@ ERROR: 0:83: 'layout-id value' : cannot be negative
ERROR: 0:96: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:96: 'sampler/image' : type requires declaration of default precision qualifier
ERROR: 0:110: 'out' : cannot be bool
ERROR: 0:110: 'out' : cannot be bool
ERROR: 0:111: 'image2D' : sampler/image types can only be used in uniform variables or function parameters: imageOut
ERROR: 0:111: 'image2D' : sampler/image types can only be used in uniform variables or function parameters: imageOut
ERROR: 0:111: '
' : image variables not declared 'writeonly' must have a format layout qualifier
ERROR: 0:111: '
image variables declared 'writeonly' without a format layout qualifier' : not supported with this profile: es
ERROR: 0:112: 'out' : cannot be a matrix
ERROR: 0:112: 'out' : cannot be a matrix
ERROR: 0:114: 'in' : cannot be bool
ERROR: 0:114: 'in' : cannot be bool
ERROR: 0:115: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: ino
ERROR: 0:115: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: ino
...
...
Test/baseResults/420.vert.out
View file @
f44d89a3
...
@@ -33,7 +33,7 @@ ERROR: 0:85: '' : vertex input cannot be further qualified
...
@@ -33,7 +33,7 @@ ERROR: 0:85: '' : vertex input cannot be further qualified
ERROR: 0:86: 'patch' : not supported in this stage: vertex
ERROR: 0:86: 'patch' : not supported in this stage: vertex
ERROR: 0:100: '=' : global const initializers must be constant 'const int'
ERROR: 0:100: '=' : global const initializers must be constant 'const int'
ERROR: 0:101: '' : array size must be a constant integer expression
ERROR: 0:101: '' : array size must be a constant integer expression
ERROR: 0:107: '
' : image variables not declared 'writeonly' must have a format layout qualifier
ERROR: 0:107: '
image variables declared 'writeonly' without a format layout qualifier' : not supported for this version or the enabled extensions
ERROR: 0:114: 'imageAtomicMin' : only supported on image with format r32i or r32ui
ERROR: 0:114: 'imageAtomicMin' : only supported on image with format r32i or r32ui
ERROR: 0:115: 'imageAtomicMax' : no matching overloaded function found
ERROR: 0:115: 'imageAtomicMax' : no matching overloaded function found
ERROR: 0:119: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
ERROR: 0:119: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
...
...
Test/baseResults/spv.image.load-formatted.frag.out
0 → 100644
View file @
f44d89a3
This diff is collapsed.
Click to expand it.
Test/spv.image.load-formatted.frag
0 → 100644
View file @
f44d89a3
#version 450
#extension GL_EXT_shader_image_load_formatted : require
layout
(
binding
=
0
)
uniform
image1D
i1D
;
layout
(
binding
=
1
)
uniform
image2D
i2D
;
layout
(
binding
=
2
)
uniform
image3D
i3D
;
layout
(
binding
=
3
)
uniform
imageCube
iCube
;
layout
(
binding
=
4
)
uniform
imageCubeArray
iCubeArray
;
layout
(
binding
=
5
)
uniform
image2DRect
i2DRect
;
layout
(
binding
=
6
)
uniform
image1DArray
i1DArray
;
layout
(
binding
=
7
)
uniform
image2DArray
i2DArray
;
layout
(
binding
=
8
)
uniform
imageBuffer
iBuffer
;
layout
(
binding
=
9
)
uniform
image2DMS
i2DMS
;
layout
(
binding
=
10
)
uniform
image2DMSArray
i2DMSArray
;
flat
in
int
ic1D
;
flat
in
ivec2
ic2D
;
flat
in
ivec3
ic3D
;
flat
in
ivec4
ic4D
;
writeonly
layout
(
binding
=
1
)
uniform
image2D
wo2D
;
flat
in
uint
value
;
out
vec4
fragData
;
void
main
()
{
ivec3
iv
=
ivec3
(
0
);
iv
.
x
+=
imageSize
(
i1D
);
iv
.
xy
+=
imageSize
(
i2D
);
iv
.
xyz
+=
imageSize
(
i3D
);
iv
.
xy
+=
imageSize
(
iCube
);
iv
.
xyz
+=
imageSize
(
iCubeArray
);
iv
.
xy
+=
imageSize
(
i2DRect
);
iv
.
xy
+=
imageSize
(
i1DArray
);
iv
.
xyz
+=
imageSize
(
i2DArray
);
iv
.
x
+=
imageSize
(
iBuffer
);
iv
.
xy
+=
imageSize
(
i2DMS
);
iv
.
xyz
+=
imageSize
(
i2DMSArray
);
iv
.
x
+=
imageSamples
(
i2DMS
);
iv
.
x
+=
imageSamples
(
i2DMSArray
);
vec4
v
=
vec4
(
0
.
0
);
v
+=
imageLoad
(
i1D
,
ic1D
);
imageStore
(
i1D
,
ic1D
,
v
);
v
+=
imageLoad
(
i2D
,
ic2D
);
imageStore
(
i2D
,
ic2D
,
v
);
v
+=
imageLoad
(
i3D
,
ic3D
);
imageStore
(
i3D
,
ic3D
,
v
);
v
+=
imageLoad
(
iCube
,
ic3D
);
imageStore
(
iCube
,
ic3D
,
v
);
v
+=
imageLoad
(
iCubeArray
,
ic3D
);
imageStore
(
iCubeArray
,
ic3D
,
v
);
v
+=
imageLoad
(
i2DRect
,
ic2D
);
imageStore
(
i2DRect
,
ic2D
,
v
);
v
+=
imageLoad
(
i1DArray
,
ic2D
);
imageStore
(
i1DArray
,
ic2D
,
v
);
v
+=
imageLoad
(
i2DArray
,
ic3D
);
imageStore
(
i2DArray
,
ic3D
,
v
);
v
+=
imageLoad
(
iBuffer
,
ic1D
);
imageStore
(
iBuffer
,
ic1D
,
v
);
v
+=
imageLoad
(
i2DMS
,
ic2D
,
1
);
imageStore
(
i2DMS
,
ic2D
,
2
,
v
);
v
+=
imageLoad
(
i2DMSArray
,
ic3D
,
3
);
imageStore
(
i2DMSArray
,
ic3D
,
4
,
v
);
imageStore
(
wo2D
,
ic2D
,
v
);
fragData
=
v
;
}
glslang/MachineIndependent/ParseHelper.cpp
View file @
f44d89a3
...
@@ -4499,8 +4499,11 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
...
@@ -4499,8 +4499,11 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
}
}
}
}
}
}
}
else
if
(
type
.
isImage
()
&&
!
qualifier
.
writeonly
)
}
else
if
(
type
.
isImage
()
&&
!
qualifier
.
writeonly
)
{
error
(
loc
,
"image variables not declared 'writeonly' must have a format layout qualifier"
,
""
,
""
);
const
char
*
explanation
=
"image variables declared 'writeonly' without a format layout qualifier"
;
requireProfile
(
loc
,
ECoreProfile
|
ECompatibilityProfile
,
explanation
);
profileRequires
(
loc
,
ECoreProfile
|
ECompatibilityProfile
,
0
,
E_GL_EXT_shader_image_load_formatted
,
explanation
);
}
if
(
qualifier
.
layoutPushConstant
&&
type
.
getBasicType
()
!=
EbtBlock
)
if
(
qualifier
.
layoutPushConstant
&&
type
.
getBasicType
()
!=
EbtBlock
)
error
(
loc
,
"can only be used with a block"
,
"push_constant"
,
""
);
error
(
loc
,
"can only be used with a block"
,
"push_constant"
,
""
);
...
...
glslang/MachineIndependent/Versions.cpp
View file @
f44d89a3
...
@@ -182,6 +182,7 @@ void TParseVersions::initializeExtensionBehavior()
...
@@ -182,6 +182,7 @@ void TParseVersions::initializeExtensionBehavior()
// extensionBehavior[E_GL_ARB_cull_distance] = EBhDisable; // present for 4.5, but need extension control over block members
// extensionBehavior[E_GL_ARB_cull_distance] = EBhDisable; // present for 4.5, but need extension control over block members
extensionBehavior
[
E_GL_EXT_shader_non_constant_global_initializers
]
=
EBhDisable
;
extensionBehavior
[
E_GL_EXT_shader_non_constant_global_initializers
]
=
EBhDisable
;
extensionBehavior
[
E_GL_EXT_shader_image_load_formatted
]
=
EBhDisable
;
// #line and #include
// #line and #include
extensionBehavior
[
E_GL_GOOGLE_cpp_style_line_directive
]
=
EBhDisable
;
extensionBehavior
[
E_GL_GOOGLE_cpp_style_line_directive
]
=
EBhDisable
;
...
@@ -303,6 +304,7 @@ void TParseVersions::getPreamble(std::string& preamble)
...
@@ -303,6 +304,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_ARB_sparse_texture_clamp 1
\n
"
"#define GL_ARB_sparse_texture_clamp 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
"#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
"
#ifdef AMD_EXTENSIONS
#ifdef AMD_EXTENSIONS
"#define GL_AMD_shader_ballot 1
\n
"
"#define GL_AMD_shader_ballot 1
\n
"
...
...
glslang/MachineIndependent/Versions.h
View file @
f44d89a3
...
@@ -130,6 +130,7 @@ const char* const E_GL_ARB_sparse_texture_clamp = "GL_ARB_sparse_texture
...
@@ -130,6 +130,7 @@ const char* const E_GL_ARB_sparse_texture_clamp = "GL_ARB_sparse_texture
// const char* const E_GL_ARB_cull_distance = "GL_ARB_cull_distance"; // present for 4.5, but need extension control over block members
// const char* const E_GL_ARB_cull_distance = "GL_ARB_cull_distance"; // present for 4.5, but need extension control over block members
const
char
*
const
E_GL_EXT_shader_non_constant_global_initializers
=
"GL_EXT_shader_non_constant_global_initializers"
;
const
char
*
const
E_GL_EXT_shader_non_constant_global_initializers
=
"GL_EXT_shader_non_constant_global_initializers"
;
const
char
*
const
E_GL_EXT_shader_image_load_formatted
=
"GL_EXT_shader_image_load_formatted"
;
// #line and #include
// #line and #include
const
char
*
const
E_GL_GOOGLE_cpp_style_line_directive
=
"GL_GOOGLE_cpp_style_line_directive"
;
const
char
*
const
E_GL_GOOGLE_cpp_style_line_directive
=
"GL_GOOGLE_cpp_style_line_directive"
;
...
...
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