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
3cf3f962
Commit
3cf3f962
authored
Jan 07, 2019
by
Piers Daniell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't output duplicate TypeAccelerationStructureNV declarations
parent
d12fbc4c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
8 deletions
+14
-8
SpvBuilder.cpp
SPIRV/SpvBuilder.cpp
+1
-0
spv.RayGenShader.rgen.out
Test/baseResults/spv.RayGenShader.rgen.out
+10
-6
spv.RayGenShader.rgen
Test/spv.RayGenShader.rgen
+3
-2
No files found.
SPIRV/SpvBuilder.cpp
View file @
3cf3f962
...
@@ -531,6 +531,7 @@ Id Builder::makeAccelerationStructureNVType()
...
@@ -531,6 +531,7 @@ Id Builder::makeAccelerationStructureNVType()
Instruction
*
type
;
Instruction
*
type
;
if
(
groupedTypes
[
OpTypeAccelerationStructureNV
].
size
()
==
0
)
{
if
(
groupedTypes
[
OpTypeAccelerationStructureNV
].
size
()
==
0
)
{
type
=
new
Instruction
(
getUniqueId
(),
NoType
,
OpTypeAccelerationStructureNV
);
type
=
new
Instruction
(
getUniqueId
(),
NoType
,
OpTypeAccelerationStructureNV
);
groupedTypes
[
OpTypeAccelerationStructureNV
].
push_back
(
type
);
constantsTypesGlobals
.
push_back
(
std
::
unique_ptr
<
Instruction
>
(
type
));
constantsTypesGlobals
.
push_back
(
std
::
unique_ptr
<
Instruction
>
(
type
));
module
.
mapInstruction
(
type
);
module
.
mapInstruction
(
type
);
}
else
{
}
else
{
...
...
Test/baseResults/spv.RayGenShader.rgen.out
View file @
3cf3f962
spv.RayGenShader.rgen
spv.RayGenShader.rgen
// Module Version 10000
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80007
// Id's are bound by 6
0
// Id's are bound by 6
1
Capability RayTracingNV
Capability RayTracingNV
Extension "SPV_NV_ray_tracing"
Extension "SPV_NV_ray_tracing"
...
@@ -17,21 +17,24 @@ spv.RayGenShader.rgen
...
@@ -17,21 +17,24 @@ spv.RayGenShader.rgen
Name 20 "sx"
Name 20 "sx"
Name 21 "gl_LaunchSizeNV"
Name 21 "gl_LaunchSizeNV"
Name 24 "sy"
Name 24 "sy"
Name 29 "accNV"
Name 29 "accNV
0
"
Name 48 "block"
Name 48 "block"
MemberName 48(block) 0 "arr"
MemberName 48(block) 0 "arr"
MemberName 48(block) 1 "pad"
MemberName 48(block) 1 "pad"
Name 50 ""
Name 50 ""
Name 56 "payload"
Name 56 "payload"
Name 60 "accNV1"
Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV
Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV
Decorate 21(gl_LaunchSizeNV) BuiltIn LaunchSizeNV
Decorate 21(gl_LaunchSizeNV) BuiltIn LaunchSizeNV
Decorate 29(accNV) DescriptorSet 0
Decorate 29(accNV
0
) DescriptorSet 0
Decorate 29(accNV) Binding 0
Decorate 29(accNV
0
) Binding 0
Decorate 46 ArrayStride 4
Decorate 46 ArrayStride 4
MemberDecorate 48(block) 0 Offset 0
MemberDecorate 48(block) 0 Offset 0
MemberDecorate 48(block) 1 Offset 16
MemberDecorate 48(block) 1 Offset 16
Decorate 48(block) BufferBlock
Decorate 48(block) BufferBlock
Decorate 56(payload) Location 0
Decorate 56(payload) Location 0
Decorate 60(accNV1) DescriptorSet 0
Decorate 60(accNV1) Binding 1
2: TypeVoid
2: TypeVoid
3: TypeFunction 2
3: TypeFunction 2
6: TypeInt 32 0
6: TypeInt 32 0
...
@@ -45,7 +48,7 @@ spv.RayGenShader.rgen
...
@@ -45,7 +48,7 @@ spv.RayGenShader.rgen
21(gl_LaunchSizeNV): 10(ptr) Variable Input
21(gl_LaunchSizeNV): 10(ptr) Variable Input
27: TypeAccelerationStructureNV
27: TypeAccelerationStructureNV
28: TypePointer UniformConstant 27
28: TypePointer UniformConstant 27
29(accNV
): 28(ptr) Variable UniformConstant
29(accNV0
): 28(ptr) Variable UniformConstant
35: TypeFloat 32
35: TypeFloat 32
36: TypeVector 35(float) 3
36: TypeVector 35(float) 3
37: 35(float) Constant 0
37: 35(float) Constant 0
...
@@ -68,6 +71,7 @@ spv.RayGenShader.rgen
...
@@ -68,6 +71,7 @@ spv.RayGenShader.rgen
55: TypePointer RayPayloadNV 47(fvec4)
55: TypePointer RayPayloadNV 47(fvec4)
56(payload): 55(ptr) Variable RayPayloadNV
56(payload): 55(ptr) Variable RayPayloadNV
58: TypePointer ShaderRecordBufferNV 47(fvec4)
58: TypePointer ShaderRecordBufferNV 47(fvec4)
60(accNV1): 28(ptr) Variable UniformConstant
4(main): 2 Function None 3
4(main): 2 Function None 3
5: Label
5: Label
8(lx): 7(ptr) Variable Function
8(lx): 7(ptr) Variable Function
...
@@ -86,7 +90,7 @@ spv.RayGenShader.rgen
...
@@ -86,7 +90,7 @@ spv.RayGenShader.rgen
25: 13(ptr) AccessChain 21(gl_LaunchSizeNV) 17
25: 13(ptr) AccessChain 21(gl_LaunchSizeNV) 17
26: 6(int) Load 25
26: 6(int) Load 25
Store 24(sy) 26
Store 24(sy) 26
30: 27 Load 29(accNV)
30: 27 Load 29(accNV
0
)
31: 6(int) Load 8(lx)
31: 6(int) Load 8(lx)
32: 6(int) Load 16(ly)
32: 6(int) Load 16(ly)
33: 6(int) Load 20(sx)
33: 6(int) Load 20(sx)
...
...
Test/spv.RayGenShader.rgen
View file @
3cf3f962
#version 460
#version 460
#extension GL_NV_ray_tracing : enable
#extension GL_NV_ray_tracing : enable
layout(binding = 0, set = 0) uniform accelerationStructureNV accNV;
layout(binding = 0, set = 0) uniform accelerationStructureNV accNV0;
layout(binding = 1, set = 0) uniform accelerationStructureNV accNV1; // Unused
layout(location = 0) rayPayloadNV vec4 payload;
layout(location = 0) rayPayloadNV vec4 payload;
layout(shaderRecordNV) buffer block
layout(shaderRecordNV) buffer block
{
{
...
@@ -13,7 +14,7 @@ void main()
...
@@ -13,7 +14,7 @@ void main()
uint ly = gl_LaunchIDNV.y;
uint ly = gl_LaunchIDNV.y;
uint sx = gl_LaunchSizeNV.x;
uint sx = gl_LaunchSizeNV.x;
uint sy = gl_LaunchSizeNV.y;
uint sy = gl_LaunchSizeNV.y;
traceNV(accNV, lx, ly, sx, sy, 0u, vec3(0.0f), 0.5f, vec3(1.0f), 0.75f, 1);
traceNV(accNV
0
, lx, ly, sx, sy, 0u, vec3(0.0f), 0.5f, vec3(1.0f), 0.75f, 1);
arr[3] = 1.0f;
arr[3] = 1.0f;
pad = payload;
pad = payload;
}
}
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