Gentoo Archives: gentoo-commits

From: Nick Sarnie <sarnex@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/spirv-tools/, dev-util/spirv-tools/files/
Date: Sun, 03 Mar 2019 14:48:09
Message-Id: 1551624460.1f846f1c5d2c33badd5274386ba3be75959fad53.sarnex@gentoo
1 commit: 1f846f1c5d2c33badd5274386ba3be75959fad53
2 Author: Nick Sarnie <sarnex <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 3 14:39:37 2019 +0000
4 Commit: Nick Sarnie <sarnex <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 3 14:47:40 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f846f1c
7
8 dev-util/spirv-tools: Bump revision
9
10 Package-Manager: Portage-2.3.62, Repoman-2.3.12
11 Signed-off-by: Nick Sarnie <sarnex <AT> gentoo.org>
12
13 ...v-tools-2019.1-Fix-vertex-instrumentation.patch | 113 +++++++++++++++++++++
14 ...-2019.1.ebuild => spirv-tools-2019.1-r1.ebuild} | 2 +
15 2 files changed, 115 insertions(+)
16
17 diff --git a/dev-util/spirv-tools/files/spirv-tools-2019.1-Fix-vertex-instrumentation.patch b/dev-util/spirv-tools/files/spirv-tools-2019.1-Fix-vertex-instrumentation.patch
18 new file mode 100644
19 index 00000000000..4ca2c53969a
20 --- /dev/null
21 +++ b/dev-util/spirv-tools/files/spirv-tools-2019.1-Fix-vertex-instrumentation.patch
22 @@ -0,0 +1,113 @@
23 +From 8d2d66f30c5c25029ac029af2bc9c4aa6979e5bc Mon Sep 17 00:00:00 2001
24 +From: greg-lunarg <greg@××××××.com>
25 +Date: Wed, 16 Jan 2019 16:02:07 -0700
26 +Subject: [PATCH] Fix vertex instrumentation to use VertexIndex and
27 + InstanceIndex (#2294)
28 +
29 +...instead of VertexId and InstanceId
30 +---
31 + include/spirv-tools/instrument.hpp | 4 ++--
32 + source/opt/instrument_pass.cpp | 8 ++++----
33 + source/opt/ir_context.cpp | 4 ++--
34 + test/opt/inst_bindless_check_test.cpp | 14 +++++++-------
35 + 4 files changed, 15 insertions(+), 15 deletions(-)
36 +
37 +diff --git a/include/spirv-tools/instrument.hpp b/include/spirv-tools/instrument.hpp
38 +index 69d1ad259..f8068099c 100644
39 +--- a/include/spirv-tools/instrument.hpp
40 ++++ b/include/spirv-tools/instrument.hpp
41 +@@ -75,8 +75,8 @@ static const int kInstCommonOutCnt = 4;
42 + // error.
43 + //
44 + // Vertex Shader Output Record Offsets
45 +-static const int kInstVertOutVertexId = kInstCommonOutCnt;
46 +-static const int kInstVertOutInstanceId = kInstCommonOutCnt + 1;
47 ++static const int kInstVertOutVertexIndex = kInstCommonOutCnt;
48 ++static const int kInstVertOutInstanceIndex = kInstCommonOutCnt + 1;
49 +
50 + // Frag Shader Output Record Offsets
51 + static const int kInstFragOutFragCoordX = kInstCommonOutCnt;
52 +diff --git a/source/opt/instrument_pass.cpp b/source/opt/instrument_pass.cpp
53 +index 8ba8ce504..6935a43dc 100644
54 +--- a/source/opt/instrument_pass.cpp
55 ++++ b/source/opt/instrument_pass.cpp
56 +@@ -168,10 +168,10 @@ void InstrumentPass::GenStageStreamWriteCode(uint32_t stage_idx,
57 + switch (stage_idx) {
58 + case SpvExecutionModelVertex: {
59 + // Load and store VertexId and InstanceId
60 +- GenBuiltinOutputCode(context()->GetBuiltinVarId(SpvBuiltInVertexId),
61 +- kInstVertOutVertexId, base_offset_id, builder);
62 +- GenBuiltinOutputCode(context()->GetBuiltinVarId(SpvBuiltInInstanceId),
63 +- kInstVertOutInstanceId, base_offset_id, builder);
64 ++ GenBuiltinOutputCode(context()->GetBuiltinVarId(SpvBuiltInVertexIndex),
65 ++ kInstVertOutVertexIndex, base_offset_id, builder);
66 ++ GenBuiltinOutputCode(context()->GetBuiltinVarId(SpvBuiltInInstanceIndex),
67 ++ kInstVertOutInstanceIndex, base_offset_id, builder);
68 + } break;
69 + case SpvExecutionModelGLCompute: {
70 + // Load and store GlobalInvocationId. Second word is unused; store zero.
71 +diff --git a/source/opt/ir_context.cpp b/source/opt/ir_context.cpp
72 +index a2f207c0c..fe69027f8 100644
73 +--- a/source/opt/ir_context.cpp
74 ++++ b/source/opt/ir_context.cpp
75 +@@ -669,8 +669,8 @@ uint32_t IRContext::GetBuiltinVarId(uint32_t builtin) {
76 + reg_type = type_mgr->GetRegisteredType(&v4float_ty);
77 + break;
78 + }
79 +- case SpvBuiltInVertexId:
80 +- case SpvBuiltInInstanceId:
81 ++ case SpvBuiltInVertexIndex:
82 ++ case SpvBuiltInInstanceIndex:
83 + case SpvBuiltInPrimitiveId:
84 + case SpvBuiltInInvocationId:
85 + case SpvBuiltInGlobalInvocationId: {
86 +diff --git a/test/opt/inst_bindless_check_test.cpp b/test/opt/inst_bindless_check_test.cpp
87 +index ddafb3dc2..a426ce04c 100644
88 +--- a/test/opt/inst_bindless_check_test.cpp
89 ++++ b/test/opt/inst_bindless_check_test.cpp
90 +@@ -1650,7 +1650,7 @@ OpCapability Sampled1D
91 + OpExtension "SPV_KHR_storage_buffer_storage_class"
92 + %1 = OpExtInstImport "GLSL.std.450"
93 + OpMemoryModel Logical GLSL450
94 +-OpEntryPoint Vertex %main "main" %_ %coords2D %gl_VertexID %gl_InstanceID
95 ++OpEntryPoint Vertex %main "main" %_ %coords2D %gl_VertexIndex %gl_InstanceIndex
96 + OpSource GLSL 450
97 + OpName %main "main"
98 + OpName %lod "lod"
99 +@@ -1684,8 +1684,8 @@ OpMemberDecorate %_struct_61 0 Offset 0
100 + OpMemberDecorate %_struct_61 1 Offset 4
101 + OpDecorate %63 DescriptorSet 7
102 + OpDecorate %63 Binding 0
103 +-OpDecorate %gl_VertexID BuiltIn VertexId
104 +-OpDecorate %gl_InstanceID BuiltIn InstanceId
105 ++OpDecorate %gl_VertexIndex BuiltIn VertexIndex
106 ++OpDecorate %gl_InstanceIndex BuiltIn InstanceIndex
107 + %void = OpTypeVoid
108 + %12 = OpTypeFunction %void
109 + %float = OpTypeFloat 32
110 +@@ -1730,8 +1730,8 @@ OpDecorate %gl_InstanceID BuiltIn InstanceId
111 + %uint_2 = OpConstant %uint 2
112 + %uint_3 = OpConstant %uint 3
113 + %_ptr_Input_uint = OpTypePointer Input %uint
114 +-%gl_VertexID = OpVariable %_ptr_Input_uint Input
115 +-%gl_InstanceID = OpVariable %_ptr_Input_uint Input
116 ++%gl_VertexIndex = OpVariable %_ptr_Input_uint Input
117 ++%gl_InstanceIndex = OpVariable %_ptr_Input_uint Input
118 + %uint_5 = OpConstant %uint 5
119 + %uint_6 = OpConstant %uint 6
120 + %uint_7 = OpConstant %uint 7
121 +@@ -1819,11 +1819,11 @@ OpStore %81 %55
122 + %83 = OpIAdd %uint %68 %uint_3
123 + %84 = OpAccessChain %_ptr_StorageBuffer_uint %63 %uint_1 %83
124 + OpStore %84 %uint_0
125 +-%87 = OpLoad %uint %gl_VertexID
126 ++%87 = OpLoad %uint %gl_VertexIndex
127 + %88 = OpIAdd %uint %68 %uint_4
128 + %89 = OpAccessChain %_ptr_StorageBuffer_uint %63 %uint_1 %88
129 + OpStore %89 %87
130 +-%91 = OpLoad %uint %gl_InstanceID
131 ++%91 = OpLoad %uint %gl_InstanceIndex
132 + %93 = OpIAdd %uint %68 %uint_5
133 + %94 = OpAccessChain %_ptr_StorageBuffer_uint %63 %uint_1 %93
134 + OpStore %94 %91
135 +
136
137 diff --git a/dev-util/spirv-tools/spirv-tools-2019.1.ebuild b/dev-util/spirv-tools/spirv-tools-2019.1-r1.ebuild
138 similarity index 93%
139 rename from dev-util/spirv-tools/spirv-tools-2019.1.ebuild
140 rename to dev-util/spirv-tools/spirv-tools-2019.1-r1.ebuild
141 index d59ad889f8b..49e7dc8a87d 100644
142 --- a/dev-util/spirv-tools/spirv-tools-2019.1.ebuild
143 +++ b/dev-util/spirv-tools/spirv-tools-2019.1-r1.ebuild
144 @@ -20,6 +20,8 @@ RDEPEND=""
145 DEPEND=">=dev-util/spirv-headers-1.3.4_pre20190302"
146 EGIT_COMMIT="2297d4a3dfcbfd2a8b4312fab055ae26e3289fd3"
147 S="${WORKDIR}/SPIRV-Tools-${PV}"
148 +PATCHES=( "${FILESDIR}"/${PN}-2019.1-Fix-vertex-instrumentation.patch )
149 +
150
151 multilib_src_configure() {
152 local mycmakeargs=(