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
f7c43377
Unverified
Commit
f7c43377
authored
Jan 28, 2021
by
greg-lunarg
Committed by
GitHub
Jan 28, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2513 from jeffbolznv/missingcap
Add missing capability when QueueFamily scope is used
parents
36df92e4
bfd84a39
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
0 deletions
+65
-0
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+4
-0
SpvPostProcess.cpp
SPIRV/SpvPostProcess.cpp
+7
-0
spv.queueFamilyScope.comp.out
Test/baseResults/spv.queueFamilyScope.comp.out
+43
-0
spv.queueFamilyScope.comp
Test/spv.queueFamilyScope.comp
+10
-0
Spv.FromFile.cpp
gtests/Spv.FromFile.cpp
+1
-0
No files found.
SPIRV/GlslangToSpv.cpp
View file @
f7c43377
...
...
@@ -6996,6 +6996,10 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
builder
.
addCapability
(
spv
::
CapabilityVulkanMemoryModelKHR
);
}
if
(
builder
.
getConstantScalar
(
scopeId
)
==
spv
::
ScopeQueueFamily
)
{
builder
.
addCapability
(
spv
::
CapabilityVulkanMemoryModelKHR
);
}
if
(
glslangIntermediate
->
usingVulkanMemoryModel
()
&&
builder
.
getConstantScalar
(
scopeId
)
==
spv
::
ScopeDevice
)
{
builder
.
addCapability
(
spv
::
CapabilityVulkanMemoryModelDeviceScopeKHR
);
}
...
...
SPIRV/SpvPostProcess.cpp
View file @
f7c43377
...
...
@@ -436,6 +436,13 @@ void Builder::postProcessFeatures() {
}
}
}
// If any Vulkan memory model-specific functionality is used, update the
// OpMemoryModel to match.
if
(
capabilities
.
find
(
spv
::
CapabilityVulkanMemoryModelKHR
)
!=
capabilities
.
end
())
{
memoryModel
=
spv
::
MemoryModelVulkanKHR
;
addIncorporatedExtension
(
spv
::
E_SPV_KHR_vulkan_memory_model
,
spv
::
Spv_1_5
);
}
}
#endif
...
...
Test/baseResults/spv.queueFamilyScope.comp.out
0 → 100644
View file @
f7c43377
spv.queueFamilyScope.comp
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 21
Capability Shader
Capability VulkanMemoryModelKHR
Extension "SPV_KHR_vulkan_memory_model"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical VulkanKHR
EntryPoint GLCompute 4 "main"
ExecutionMode 4 LocalSize 1 1 1
Source GLSL 450
SourceExtension "GL_KHR_memory_scope_semantics"
Name 4 "main"
Name 7 "Buffer"
MemberName 7(Buffer) 0 "a"
Name 9 "A"
MemberDecorate 7(Buffer) 0 Offset 0
Decorate 7(Buffer) Block
Decorate 9(A) DescriptorSet 0
Decorate 9(A) Binding 0
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7(Buffer): TypeStruct 6(int)
8: TypePointer StorageBuffer 7(Buffer)
9(A): 8(ptr) Variable StorageBuffer
10: TypeInt 32 1
11: 10(int) Constant 0
12: TypePointer StorageBuffer 6(int)
14: 10(int) Constant 5
15: 10(int) Constant 64
16: 10(int) Constant 2
17: 6(int) Constant 1
18: 6(int) Constant 0
19: 6(int) Constant 66
4(main): 2 Function None 3
5: Label
13: 12(ptr) AccessChain 9(A) 11
20: 6(int) AtomicLoad 13 14 19
Return
FunctionEnd
Test/spv.queueFamilyScope.comp
0 → 100644
View file @
f7c43377
#version 450
#extension GL_KHR_memory_scope_semantics : require
layout (binding = 0) buffer Buffer { uint a; } A;
void main()
{
atomicLoad(A.a, gl_ScopeQueueFamily, gl_StorageSemanticsBuffer, gl_SemanticsAcquire);
}
gtests/Spv.FromFile.cpp
View file @
f7c43377
...
...
@@ -503,6 +503,7 @@ INSTANTIATE_TEST_SUITE_P(
"spv.memoryScopeSemantics.comp"
,
"spv.memoryScopeSemantics_Error.comp"
,
"spv.multiView.frag"
,
"spv.queueFamilyScope.comp"
,
"spv.RayGenShader11.rgen"
,
"spv.subgroup.frag"
,
"spv.subgroup.geom"
,
...
...
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