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
260f5061
Commit
260f5061
authored
Aug 14, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPV: Correct selection of storage-image capabilities. Fixes #986.
Code was reflecting an old historical use of sampled as a SPIR-V 2-valued operand, instead of its current 3 values.
parent
e516d433
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
36 additions
and
34 deletions
+36
-34
SpvBuilder.cpp
SPIRV/SpvBuilder.cpp
+10
-7
hlsl.getdimensions.dx10.frag.out
Test/baseResults/hlsl.getdimensions.dx10.frag.out
+0
-1
hlsl.getdimensions.rw.dx10.frag.out
Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out
+2
-2
hlsl.getsampleposition.dx10.frag.out
Test/baseResults/hlsl.getsampleposition.dx10.frag.out
+0
-1
hlsl.load.2dms.dx10.frag.out
Test/baseResults/hlsl.load.2dms.dx10.frag.out
+0
-1
hlsl.load.rwbuffer.dx10.frag.out
Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out
+1
-1
hlsl.load.rwtexture.array.dx10.frag.out
Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out
+1
-1
hlsl.load.rwtexture.dx10.frag.out
Test/baseResults/hlsl.load.rwtexture.dx10.frag.out
+1
-1
hlsl.promote.atomic.frag.out
Test/baseResults/hlsl.promote.atomic.frag.out
+1
-1
hlsl.rw.atomics.frag.out
Test/baseResults/hlsl.rw.atomics.frag.out
+2
-2
hlsl.rw.bracket.frag.out
Test/baseResults/hlsl.rw.bracket.frag.out
+1
-1
hlsl.rw.register.frag.out
Test/baseResults/hlsl.rw.register.frag.out
+2
-2
hlsl.rw.scalar.bracket.frag.out
Test/baseResults/hlsl.rw.scalar.bracket.frag.out
+1
-1
hlsl.rw.swizzle.frag.out
Test/baseResults/hlsl.rw.swizzle.frag.out
+1
-1
hlsl.rw.vec2.bracket.frag.out
Test/baseResults/hlsl.rw.vec2.bracket.frag.out
+1
-1
hlsl.structbuffer.fn2.comp.out
Test/baseResults/hlsl.structbuffer.fn2.comp.out
+1
-1
spv.image.frag.out
Test/baseResults/spv.image.frag.out
+5
-4
spv.memoryQualifier.frag.out
Test/baseResults/spv.memoryQualifier.frag.out
+2
-2
spv.rw.autoassign.frag.out
Test/baseResults/spv.rw.autoassign.frag.out
+2
-2
spv.separate.frag.out
Test/baseResults/spv.separate.frag.out
+0
-1
spv.sparseTexture.frag.out
Test/baseResults/spv.sparseTexture.frag.out
+1
-0
spv.subpass.frag.out
Test/baseResults/spv.subpass.frag.out
+1
-0
No files found.
SPIRV/SpvBuilder.cpp
View file @
260f5061
...
@@ -402,6 +402,8 @@ Id Builder::makeFunctionType(Id returnType, const std::vector<Id>& paramTypes)
...
@@ -402,6 +402,8 @@ Id Builder::makeFunctionType(Id returnType, const std::vector<Id>& paramTypes)
Id
Builder
::
makeImageType
(
Id
sampledType
,
Dim
dim
,
bool
depth
,
bool
arrayed
,
bool
ms
,
unsigned
sampled
,
ImageFormat
format
)
Id
Builder
::
makeImageType
(
Id
sampledType
,
Dim
dim
,
bool
depth
,
bool
arrayed
,
bool
ms
,
unsigned
sampled
,
ImageFormat
format
)
{
{
assert
(
sampled
==
1
||
sampled
==
2
);
// try to find it
// try to find it
Instruction
*
type
;
Instruction
*
type
;
for
(
int
t
=
0
;
t
<
(
int
)
groupedTypes
[
OpTypeImage
].
size
();
++
t
)
{
for
(
int
t
=
0
;
t
<
(
int
)
groupedTypes
[
OpTypeImage
].
size
();
++
t
)
{
...
@@ -433,27 +435,27 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo
...
@@ -433,27 +435,27 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo
// deal with capabilities
// deal with capabilities
switch
(
dim
)
{
switch
(
dim
)
{
case
DimBuffer
:
case
DimBuffer
:
if
(
sampled
)
if
(
sampled
==
1
)
addCapability
(
CapabilitySampledBuffer
);
addCapability
(
CapabilitySampledBuffer
);
else
else
addCapability
(
CapabilityImageBuffer
);
addCapability
(
CapabilityImageBuffer
);
break
;
break
;
case
Dim1D
:
case
Dim1D
:
if
(
sampled
)
if
(
sampled
==
1
)
addCapability
(
CapabilitySampled1D
);
addCapability
(
CapabilitySampled1D
);
else
else
addCapability
(
CapabilityImage1D
);
addCapability
(
CapabilityImage1D
);
break
;
break
;
case
DimCube
:
case
DimCube
:
if
(
arrayed
)
{
if
(
arrayed
)
{
if
(
sampled
)
if
(
sampled
==
1
)
addCapability
(
CapabilitySampledCubeArray
);
addCapability
(
CapabilitySampledCubeArray
);
else
else
addCapability
(
CapabilityImageCubeArray
);
addCapability
(
CapabilityImageCubeArray
);
}
}
break
;
break
;
case
DimRect
:
case
DimRect
:
if
(
sampled
)
if
(
sampled
==
1
)
addCapability
(
CapabilitySampledRect
);
addCapability
(
CapabilitySampledRect
);
else
else
addCapability
(
CapabilityImageRect
);
addCapability
(
CapabilityImageRect
);
...
@@ -466,10 +468,11 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo
...
@@ -466,10 +468,11 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo
}
}
if
(
ms
)
{
if
(
ms
)
{
if
(
arrayed
)
if
(
sampled
==
2
)
{
addCapability
(
CapabilityImageMSArray
);
if
(
!
sampled
)
addCapability
(
CapabilityStorageImageMultisample
);
addCapability
(
CapabilityStorageImageMultisample
);
if
(
arrayed
)
addCapability
(
CapabilityImageMSArray
);
}
}
}
return
type
->
getResultId
();
return
type
->
getResultId
();
...
...
Test/baseResults/hlsl.getdimensions.dx10.frag.out
View file @
260f5061
...
@@ -2322,7 +2322,6 @@ gl_FragCoord origin is upper left
...
@@ -2322,7 +2322,6 @@ gl_FragCoord origin is upper left
Capability Shader
Capability Shader
Capability Sampled1D
Capability Sampled1D
Capability SampledCubeArray
Capability SampledCubeArray
Capability ImageMSArray
Capability ImageQuery
Capability ImageQuery
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
...
...
Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out
View file @
260f5061
...
@@ -720,8 +720,8 @@ gl_FragCoord origin is upper left
...
@@ -720,8 +720,8 @@ gl_FragCoord origin is upper left
// Id's are bound by 232
// Id's are bound by 232
Capability Shader
Capability Shader
Capability
Sampled
1D
Capability
Image
1D
Capability
Sampled
Buffer
Capability
Image
Buffer
Capability ImageQuery
Capability ImageQuery
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
...
...
Test/baseResults/hlsl.getsampleposition.dx10.frag.out
View file @
260f5061
...
@@ -582,7 +582,6 @@ gl_FragCoord origin is upper left
...
@@ -582,7 +582,6 @@ gl_FragCoord origin is upper left
// Id's are bound by 221
// Id's are bound by 221
Capability Shader
Capability Shader
Capability ImageMSArray
Capability ImageQuery
Capability ImageQuery
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
...
...
Test/baseResults/hlsl.load.2dms.dx10.frag.out
View file @
260f5061
...
@@ -361,7 +361,6 @@ gl_FragCoord origin is upper left
...
@@ -361,7 +361,6 @@ gl_FragCoord origin is upper left
Capability Shader
Capability Shader
Capability ImageGatherExtended
Capability ImageGatherExtended
Capability ImageMSArray
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 120 124
EntryPoint Fragment 4 "main" 120 124
...
...
Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out
View file @
260f5061
...
@@ -114,7 +114,7 @@ gl_FragCoord origin is upper left
...
@@ -114,7 +114,7 @@ gl_FragCoord origin is upper left
// Id's are bound by 57
// Id's are bound by 57
Capability Shader
Capability Shader
Capability
Sampled
Buffer
Capability
Image
Buffer
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 54
EntryPoint Fragment 4 "main" 54
...
...
Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out
View file @
260f5061
...
@@ -210,7 +210,7 @@ gl_FragCoord origin is upper left
...
@@ -210,7 +210,7 @@ gl_FragCoord origin is upper left
// Id's are bound by 119
// Id's are bound by 119
Capability Shader
Capability Shader
Capability
Sampled
1D
Capability
Image
1D
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 82 86
EntryPoint Fragment 4 "main" 82 86
...
...
Test/baseResults/hlsl.load.rwtexture.dx10.frag.out
View file @
260f5061
...
@@ -246,7 +246,7 @@ gl_FragCoord origin is upper left
...
@@ -246,7 +246,7 @@ gl_FragCoord origin is upper left
// Id's are bound by 132
// Id's are bound by 132
Capability Shader
Capability Shader
Capability
Sampled
1D
Capability
Image
1D
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 104 108
EntryPoint Fragment 4 "main" 104 108
...
...
Test/baseResults/hlsl.promote.atomic.frag.out
View file @
260f5061
...
@@ -68,7 +68,7 @@ gl_FragCoord origin is upper left
...
@@ -68,7 +68,7 @@ gl_FragCoord origin is upper left
// Id's are bound by 36
// Id's are bound by 36
Capability Shader
Capability Shader
Capability
Sampled
Buffer
Capability
Image
Buffer
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 34
EntryPoint Fragment 4 "main" 34
...
...
Test/baseResults/hlsl.rw.atomics.frag.out
View file @
260f5061
...
@@ -3950,8 +3950,8 @@ gl_FragCoord origin is upper left
...
@@ -3950,8 +3950,8 @@ gl_FragCoord origin is upper left
// Id's are bound by 1147
// Id's are bound by 1147
Capability Shader
Capability Shader
Capability
Sampled
1D
Capability
Image
1D
Capability
Sampled
Buffer
Capability
Image
Buffer
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 1117
EntryPoint Fragment 4 "main" 1117
...
...
Test/baseResults/hlsl.rw.bracket.frag.out
View file @
260f5061
...
@@ -1748,7 +1748,7 @@ gl_FragCoord origin is upper left
...
@@ -1748,7 +1748,7 @@ gl_FragCoord origin is upper left
// Id's are bound by 607
// Id's are bound by 607
Capability Shader
Capability Shader
Capability
Sampled
1D
Capability
Image
1D
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 583
EntryPoint Fragment 4 "main" 583
...
...
Test/baseResults/hlsl.rw.register.frag.out
View file @
260f5061
...
@@ -102,8 +102,8 @@ gl_FragCoord origin is upper left
...
@@ -102,8 +102,8 @@ gl_FragCoord origin is upper left
// Id's are bound by 42
// Id's are bound by 42
Capability Shader
Capability Shader
Capability
Sampled
1D
Capability
Image
1D
Capability
Sampled
Buffer
Capability
Image
Buffer
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 39
EntryPoint Fragment 4 "main" 39
...
...
Test/baseResults/hlsl.rw.scalar.bracket.frag.out
View file @
260f5061
...
@@ -1694,7 +1694,7 @@ gl_FragCoord origin is upper left
...
@@ -1694,7 +1694,7 @@ gl_FragCoord origin is upper left
// Id's are bound by 571
// Id's are bound by 571
Capability Shader
Capability Shader
Capability
Sampled
1D
Capability
Image
1D
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 547
EntryPoint Fragment 4 "main" 547
...
...
Test/baseResults/hlsl.rw.swizzle.frag.out
View file @
260f5061
...
@@ -206,7 +206,7 @@ gl_FragCoord origin is upper left
...
@@ -206,7 +206,7 @@ gl_FragCoord origin is upper left
// Id's are bound by 63
// Id's are bound by 63
Capability Shader
Capability Shader
Capability
Sampled
Buffer
Capability
Image
Buffer
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 58
EntryPoint Fragment 4 "main" 58
...
...
Test/baseResults/hlsl.rw.vec2.bracket.frag.out
View file @
260f5061
...
@@ -1712,7 +1712,7 @@ gl_FragCoord origin is upper left
...
@@ -1712,7 +1712,7 @@ gl_FragCoord origin is upper left
// Id's are bound by 605
// Id's are bound by 605
Capability Shader
Capability Shader
Capability
Sampled
1D
Capability
Image
1D
Capability StorageImageExtendedFormats
Capability StorageImageExtendedFormats
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
...
...
Test/baseResults/hlsl.structbuffer.fn2.comp.out
View file @
260f5061
...
@@ -138,7 +138,7 @@ local_size = (256, 1, 1)
...
@@ -138,7 +138,7 @@ local_size = (256, 1, 1)
// Id's are bound by 61
// Id's are bound by 61
Capability Shader
Capability Shader
Capability
Sampled
Buffer
Capability
Image
Buffer
Capability StorageImageExtendedFormats
Capability StorageImageExtendedFormats
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
...
...
Test/baseResults/spv.image.frag.out
View file @
260f5061
...
@@ -4,10 +4,11 @@ spv.image.frag
...
@@ -4,10 +4,11 @@ spv.image.frag
// Id's are bound by 376
// Id's are bound by 376
Capability Shader
Capability Shader
Capability SampledRect
Capability StorageImageMultisample
Capability Sampled1D
Capability ImageCubeArray
Capability SampledCubeArray
Capability ImageRect
Capability SampledBuffer
Capability Image1D
Capability ImageBuffer
Capability ImageMSArray
Capability ImageMSArray
Capability StorageImageExtendedFormats
Capability StorageImageExtendedFormats
Capability ImageQuery
Capability ImageQuery
...
...
Test/baseResults/spv.memoryQualifier.frag.out
View file @
260f5061
...
@@ -4,8 +4,8 @@ spv.memoryQualifier.frag
...
@@ -4,8 +4,8 @@ spv.memoryQualifier.frag
// Id's are bound by 97
// Id's are bound by 97
Capability Shader
Capability Shader
Capability
Sampled
Rect
Capability
Image
Rect
Capability
Sampled
1D
Capability
Image
1D
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
EntryPoint Fragment 4 "main"
...
...
Test/baseResults/spv.rw.autoassign.frag.out
View file @
260f5061
...
@@ -4,8 +4,8 @@ spv.rw.autoassign.frag
...
@@ -4,8 +4,8 @@ spv.rw.autoassign.frag
// Id's are bound by 42
// Id's are bound by 42
Capability Shader
Capability Shader
Capability
Sampled
1D
Capability
Image
1D
Capability
Sampled
Buffer
Capability
Image
Buffer
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 39
EntryPoint Fragment 4 "main" 39
...
...
Test/baseResults/spv.separate.frag.out
View file @
260f5061
...
@@ -8,7 +8,6 @@ spv.separate.frag
...
@@ -8,7 +8,6 @@ spv.separate.frag
Capability Sampled1D
Capability Sampled1D
Capability SampledCubeArray
Capability SampledCubeArray
Capability SampledBuffer
Capability SampledBuffer
Capability ImageMSArray
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 11 34
EntryPoint Fragment 4 "main" 11 34
...
...
Test/baseResults/spv.sparseTexture.frag.out
View file @
260f5061
...
@@ -4,6 +4,7 @@ spv.sparseTexture.frag
...
@@ -4,6 +4,7 @@ spv.sparseTexture.frag
// Id's are bound by 438
// Id's are bound by 438
Capability Shader
Capability Shader
Capability StorageImageMultisample
Capability SampledRect
Capability SampledRect
Capability SparseResidency
Capability SparseResidency
Capability SampledCubeArray
Capability SampledCubeArray
...
...
Test/baseResults/spv.subpass.frag.out
View file @
260f5061
...
@@ -4,6 +4,7 @@ spv.subpass.frag
...
@@ -4,6 +4,7 @@ spv.subpass.frag
// Id's are bound by 67
// Id's are bound by 67
Capability Shader
Capability Shader
Capability StorageImageMultisample
Capability InputAttachment
Capability InputAttachment
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
...
...
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