Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1 | // Copyright 2020 The Tint Authors. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | #include "gmock/gmock.h" |
| 16 | #include "src/tint/ast/builtin_texture_helper_test.h" |
| 17 | #include "src/tint/ast/call_statement.h" |
| 18 | #include "src/tint/ast/stage_attribute.h" |
| 19 | #include "src/tint/writer/spirv/spv_dump.h" |
| 20 | #include "src/tint/writer/spirv/test_helper.h" |
| 21 | |
dan sinclair | 411d065 | 2022-04-07 14:16:34 +0000 | [diff] [blame] | 22 | namespace tint::writer::spirv { |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 23 | namespace { |
| 24 | |
| 25 | struct expected_texture_overload_spirv { |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 26 | std::string types; |
| 27 | std::string instructions; |
| 28 | std::string capabilities; |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 29 | }; |
| 30 | |
| 31 | expected_texture_overload_spirv expected_texture_overload( |
| 32 | ast::builtin::test::ValidTextureOverload overload) { |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 33 | using ValidTextureOverload = ast::builtin::test::ValidTextureOverload; |
| 34 | switch (overload) { |
| 35 | case ValidTextureOverload::kDimensions1d: |
| 36 | return { |
| 37 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 38 | %4 = OpTypeFloat 32 |
| 39 | %3 = OpTypeImage %4 1D 0 0 0 1 Unknown |
| 40 | %2 = OpTypePointer UniformConstant %3 |
| 41 | %1 = OpVariable %2 UniformConstant |
| 42 | %7 = OpTypeSampler |
| 43 | %6 = OpTypePointer UniformConstant %7 |
| 44 | %5 = OpVariable %6 UniformConstant |
| 45 | %9 = OpTypeInt 32 1 |
| 46 | %11 = OpConstant %9 0 |
| 47 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 48 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 49 | %10 = OpLoad %3 %1 |
| 50 | %8 = OpImageQuerySizeLod %9 %10 %11 |
| 51 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 52 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 53 | OpCapability Sampled1D |
| 54 | OpCapability ImageQuery |
| 55 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 56 | case ValidTextureOverload::kDimensions2d: |
| 57 | return { |
| 58 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 59 | %4 = OpTypeFloat 32 |
| 60 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
| 61 | %2 = OpTypePointer UniformConstant %3 |
| 62 | %1 = OpVariable %2 UniformConstant |
| 63 | %7 = OpTypeSampler |
| 64 | %6 = OpTypePointer UniformConstant %7 |
| 65 | %5 = OpVariable %6 UniformConstant |
| 66 | %10 = OpTypeInt 32 1 |
| 67 | %9 = OpTypeVector %10 2 |
| 68 | %12 = OpConstant %10 0 |
| 69 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 70 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 71 | %11 = OpLoad %3 %1 |
| 72 | %8 = OpImageQuerySizeLod %9 %11 %12 |
| 73 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 74 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 75 | OpCapability ImageQuery |
| 76 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 77 | case ValidTextureOverload::kDimensions2dLevel: |
| 78 | return { |
| 79 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 80 | %4 = OpTypeFloat 32 |
| 81 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
| 82 | %2 = OpTypePointer UniformConstant %3 |
| 83 | %1 = OpVariable %2 UniformConstant |
| 84 | %7 = OpTypeSampler |
| 85 | %6 = OpTypePointer UniformConstant %7 |
| 86 | %5 = OpVariable %6 UniformConstant |
| 87 | %10 = OpTypeInt 32 1 |
| 88 | %9 = OpTypeVector %10 2 |
| 89 | %12 = OpConstant %10 1 |
| 90 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 91 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 92 | %11 = OpLoad %3 %1 |
| 93 | %8 = OpImageQuerySizeLod %9 %11 %12 |
| 94 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 95 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 96 | OpCapability ImageQuery |
| 97 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 98 | case ValidTextureOverload::kDimensions2dArray: |
| 99 | return { |
| 100 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 101 | %4 = OpTypeFloat 32 |
| 102 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
| 103 | %2 = OpTypePointer UniformConstant %3 |
| 104 | %1 = OpVariable %2 UniformConstant |
| 105 | %7 = OpTypeSampler |
| 106 | %6 = OpTypePointer UniformConstant %7 |
| 107 | %5 = OpVariable %6 UniformConstant |
| 108 | %10 = OpTypeInt 32 1 |
| 109 | %9 = OpTypeVector %10 2 |
| 110 | %12 = OpTypeVector %10 3 |
| 111 | %14 = OpConstant %10 0 |
| 112 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 113 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 114 | %13 = OpLoad %3 %1 |
| 115 | %11 = OpImageQuerySizeLod %12 %13 %14 |
| 116 | %8 = OpVectorShuffle %9 %11 %11 0 1 |
| 117 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 118 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 119 | OpCapability ImageQuery |
| 120 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 121 | case ValidTextureOverload::kDimensions2dArrayLevel: |
| 122 | return { |
| 123 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 124 | %4 = OpTypeFloat 32 |
| 125 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
| 126 | %2 = OpTypePointer UniformConstant %3 |
| 127 | %1 = OpVariable %2 UniformConstant |
| 128 | %7 = OpTypeSampler |
| 129 | %6 = OpTypePointer UniformConstant %7 |
| 130 | %5 = OpVariable %6 UniformConstant |
| 131 | %10 = OpTypeInt 32 1 |
| 132 | %9 = OpTypeVector %10 2 |
| 133 | %12 = OpTypeVector %10 3 |
| 134 | %14 = OpConstant %10 1 |
| 135 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 136 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 137 | %13 = OpLoad %3 %1 |
| 138 | %11 = OpImageQuerySizeLod %12 %13 %14 |
| 139 | %8 = OpVectorShuffle %9 %11 %11 0 1 |
| 140 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 141 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 142 | OpCapability ImageQuery |
| 143 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 144 | case ValidTextureOverload::kDimensions3d: |
| 145 | return { |
| 146 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 147 | %4 = OpTypeFloat 32 |
| 148 | %3 = OpTypeImage %4 3D 0 0 0 1 Unknown |
| 149 | %2 = OpTypePointer UniformConstant %3 |
| 150 | %1 = OpVariable %2 UniformConstant |
| 151 | %7 = OpTypeSampler |
| 152 | %6 = OpTypePointer UniformConstant %7 |
| 153 | %5 = OpVariable %6 UniformConstant |
| 154 | %10 = OpTypeInt 32 1 |
| 155 | %9 = OpTypeVector %10 3 |
| 156 | %12 = OpConstant %10 0 |
| 157 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 158 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 159 | %11 = OpLoad %3 %1 |
| 160 | %8 = OpImageQuerySizeLod %9 %11 %12 |
| 161 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 162 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 163 | OpCapability ImageQuery |
| 164 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 165 | case ValidTextureOverload::kDimensions3dLevel: |
| 166 | return { |
| 167 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 168 | %4 = OpTypeFloat 32 |
| 169 | %3 = OpTypeImage %4 3D 0 0 0 1 Unknown |
| 170 | %2 = OpTypePointer UniformConstant %3 |
| 171 | %1 = OpVariable %2 UniformConstant |
| 172 | %7 = OpTypeSampler |
| 173 | %6 = OpTypePointer UniformConstant %7 |
| 174 | %5 = OpVariable %6 UniformConstant |
| 175 | %10 = OpTypeInt 32 1 |
| 176 | %9 = OpTypeVector %10 3 |
| 177 | %12 = OpConstant %10 1 |
| 178 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 179 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 180 | %11 = OpLoad %3 %1 |
| 181 | %8 = OpImageQuerySizeLod %9 %11 %12 |
| 182 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 183 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 184 | OpCapability ImageQuery |
| 185 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 186 | case ValidTextureOverload::kDimensionsCube: |
| 187 | return { |
| 188 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 189 | %4 = OpTypeFloat 32 |
| 190 | %3 = OpTypeImage %4 Cube 0 0 0 1 Unknown |
| 191 | %2 = OpTypePointer UniformConstant %3 |
| 192 | %1 = OpVariable %2 UniformConstant |
| 193 | %7 = OpTypeSampler |
| 194 | %6 = OpTypePointer UniformConstant %7 |
| 195 | %5 = OpVariable %6 UniformConstant |
| 196 | %10 = OpTypeInt 32 1 |
| 197 | %9 = OpTypeVector %10 2 |
| 198 | %12 = OpConstant %10 0 |
| 199 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 200 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 201 | %11 = OpLoad %3 %1 |
| 202 | %8 = OpImageQuerySizeLod %9 %11 %12 |
| 203 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 204 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 205 | OpCapability ImageQuery |
| 206 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 207 | case ValidTextureOverload::kDimensionsCubeLevel: |
| 208 | return { |
| 209 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 210 | %4 = OpTypeFloat 32 |
| 211 | %3 = OpTypeImage %4 Cube 0 0 0 1 Unknown |
| 212 | %2 = OpTypePointer UniformConstant %3 |
| 213 | %1 = OpVariable %2 UniformConstant |
| 214 | %7 = OpTypeSampler |
| 215 | %6 = OpTypePointer UniformConstant %7 |
| 216 | %5 = OpVariable %6 UniformConstant |
| 217 | %10 = OpTypeInt 32 1 |
| 218 | %9 = OpTypeVector %10 2 |
| 219 | %12 = OpConstant %10 1 |
| 220 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 221 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 222 | %11 = OpLoad %3 %1 |
| 223 | %8 = OpImageQuerySizeLod %9 %11 %12 |
| 224 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 225 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 226 | OpCapability ImageQuery |
| 227 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 228 | case ValidTextureOverload::kDimensionsCubeArray: |
| 229 | return { |
| 230 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 231 | %4 = OpTypeFloat 32 |
| 232 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
| 233 | %2 = OpTypePointer UniformConstant %3 |
| 234 | %1 = OpVariable %2 UniformConstant |
| 235 | %7 = OpTypeSampler |
| 236 | %6 = OpTypePointer UniformConstant %7 |
| 237 | %5 = OpVariable %6 UniformConstant |
| 238 | %10 = OpTypeInt 32 1 |
| 239 | %9 = OpTypeVector %10 2 |
| 240 | %12 = OpTypeVector %10 3 |
| 241 | %14 = OpConstant %10 0 |
| 242 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 243 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 244 | %13 = OpLoad %3 %1 |
| 245 | %11 = OpImageQuerySizeLod %12 %13 %14 |
| 246 | %8 = OpVectorShuffle %9 %11 %11 0 1 |
| 247 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 248 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 249 | OpCapability SampledCubeArray |
| 250 | OpCapability ImageQuery |
| 251 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 252 | case ValidTextureOverload::kDimensionsCubeArrayLevel: |
| 253 | return { |
| 254 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 255 | %4 = OpTypeFloat 32 |
| 256 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
| 257 | %2 = OpTypePointer UniformConstant %3 |
| 258 | %1 = OpVariable %2 UniformConstant |
| 259 | %7 = OpTypeSampler |
| 260 | %6 = OpTypePointer UniformConstant %7 |
| 261 | %5 = OpVariable %6 UniformConstant |
| 262 | %10 = OpTypeInt 32 1 |
| 263 | %9 = OpTypeVector %10 2 |
| 264 | %12 = OpTypeVector %10 3 |
| 265 | %14 = OpConstant %10 1 |
| 266 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 267 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 268 | %13 = OpLoad %3 %1 |
| 269 | %11 = OpImageQuerySizeLod %12 %13 %14 |
| 270 | %8 = OpVectorShuffle %9 %11 %11 0 1 |
| 271 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 272 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 273 | OpCapability SampledCubeArray |
| 274 | OpCapability ImageQuery |
| 275 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 276 | case ValidTextureOverload::kDimensionsMultisampled2d: |
| 277 | return { |
| 278 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 279 | %4 = OpTypeFloat 32 |
| 280 | %3 = OpTypeImage %4 2D 0 0 1 1 Unknown |
| 281 | %2 = OpTypePointer UniformConstant %3 |
| 282 | %1 = OpVariable %2 UniformConstant |
| 283 | %7 = OpTypeSampler |
| 284 | %6 = OpTypePointer UniformConstant %7 |
| 285 | %5 = OpVariable %6 UniformConstant |
| 286 | %10 = OpTypeInt 32 1 |
| 287 | %9 = OpTypeVector %10 2 |
| 288 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 289 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 290 | %11 = OpLoad %3 %1 |
| 291 | %8 = OpImageQuerySize %9 %11 |
| 292 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 293 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 294 | OpCapability ImageQuery |
| 295 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 296 | case ValidTextureOverload::kDimensionsDepth2d: |
| 297 | return { |
| 298 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 299 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 300 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 301 | %2 = OpTypePointer UniformConstant %3 |
| 302 | %1 = OpVariable %2 UniformConstant |
| 303 | %7 = OpTypeSampler |
| 304 | %6 = OpTypePointer UniformConstant %7 |
| 305 | %5 = OpVariable %6 UniformConstant |
| 306 | %10 = OpTypeInt 32 1 |
| 307 | %9 = OpTypeVector %10 2 |
| 308 | %12 = OpConstant %10 0 |
| 309 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 310 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 311 | %11 = OpLoad %3 %1 |
| 312 | %8 = OpImageQuerySizeLod %9 %11 %12 |
| 313 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 314 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 315 | OpCapability ImageQuery |
| 316 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 317 | case ValidTextureOverload::kDimensionsDepth2dLevel: |
| 318 | return { |
| 319 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 320 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 321 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 322 | %2 = OpTypePointer UniformConstant %3 |
| 323 | %1 = OpVariable %2 UniformConstant |
| 324 | %7 = OpTypeSampler |
| 325 | %6 = OpTypePointer UniformConstant %7 |
| 326 | %5 = OpVariable %6 UniformConstant |
| 327 | %10 = OpTypeInt 32 1 |
| 328 | %9 = OpTypeVector %10 2 |
| 329 | %12 = OpConstant %10 1 |
| 330 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 331 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 332 | %11 = OpLoad %3 %1 |
| 333 | %8 = OpImageQuerySizeLod %9 %11 %12 |
| 334 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 335 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 336 | OpCapability ImageQuery |
| 337 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 338 | case ValidTextureOverload::kDimensionsDepth2dArray: |
| 339 | return { |
| 340 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 341 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 342 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 343 | %2 = OpTypePointer UniformConstant %3 |
| 344 | %1 = OpVariable %2 UniformConstant |
| 345 | %7 = OpTypeSampler |
| 346 | %6 = OpTypePointer UniformConstant %7 |
| 347 | %5 = OpVariable %6 UniformConstant |
| 348 | %10 = OpTypeInt 32 1 |
| 349 | %9 = OpTypeVector %10 2 |
| 350 | %12 = OpTypeVector %10 3 |
| 351 | %14 = OpConstant %10 0 |
| 352 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 353 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 354 | %13 = OpLoad %3 %1 |
| 355 | %11 = OpImageQuerySizeLod %12 %13 %14 |
| 356 | %8 = OpVectorShuffle %9 %11 %11 0 1 |
| 357 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 358 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 359 | OpCapability ImageQuery |
| 360 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 361 | case ValidTextureOverload::kDimensionsDepth2dArrayLevel: |
| 362 | return { |
| 363 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 364 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 365 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 366 | %2 = OpTypePointer UniformConstant %3 |
| 367 | %1 = OpVariable %2 UniformConstant |
| 368 | %7 = OpTypeSampler |
| 369 | %6 = OpTypePointer UniformConstant %7 |
| 370 | %5 = OpVariable %6 UniformConstant |
| 371 | %10 = OpTypeInt 32 1 |
| 372 | %9 = OpTypeVector %10 2 |
| 373 | %12 = OpTypeVector %10 3 |
| 374 | %14 = OpConstant %10 1 |
| 375 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 376 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 377 | %13 = OpLoad %3 %1 |
| 378 | %11 = OpImageQuerySizeLod %12 %13 %14 |
| 379 | %8 = OpVectorShuffle %9 %11 %11 0 1 |
| 380 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 381 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 382 | OpCapability ImageQuery |
| 383 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 384 | case ValidTextureOverload::kDimensionsDepthCube: |
| 385 | return { |
| 386 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 387 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 388 | %3 = OpTypeImage %4 Cube 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 389 | %2 = OpTypePointer UniformConstant %3 |
| 390 | %1 = OpVariable %2 UniformConstant |
| 391 | %7 = OpTypeSampler |
| 392 | %6 = OpTypePointer UniformConstant %7 |
| 393 | %5 = OpVariable %6 UniformConstant |
| 394 | %10 = OpTypeInt 32 1 |
| 395 | %9 = OpTypeVector %10 2 |
| 396 | %12 = OpConstant %10 0 |
| 397 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 398 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 399 | %11 = OpLoad %3 %1 |
| 400 | %8 = OpImageQuerySizeLod %9 %11 %12 |
| 401 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 402 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 403 | OpCapability ImageQuery |
| 404 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 405 | case ValidTextureOverload::kDimensionsDepthCubeLevel: |
| 406 | return { |
| 407 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 408 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 409 | %3 = OpTypeImage %4 Cube 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 410 | %2 = OpTypePointer UniformConstant %3 |
| 411 | %1 = OpVariable %2 UniformConstant |
| 412 | %7 = OpTypeSampler |
| 413 | %6 = OpTypePointer UniformConstant %7 |
| 414 | %5 = OpVariable %6 UniformConstant |
| 415 | %10 = OpTypeInt 32 1 |
| 416 | %9 = OpTypeVector %10 2 |
| 417 | %12 = OpConstant %10 1 |
| 418 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 419 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 420 | %11 = OpLoad %3 %1 |
| 421 | %8 = OpImageQuerySizeLod %9 %11 %12 |
| 422 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 423 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 424 | OpCapability ImageQuery |
| 425 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 426 | case ValidTextureOverload::kDimensionsDepthCubeArray: |
| 427 | return { |
| 428 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 429 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 430 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 431 | %2 = OpTypePointer UniformConstant %3 |
| 432 | %1 = OpVariable %2 UniformConstant |
| 433 | %7 = OpTypeSampler |
| 434 | %6 = OpTypePointer UniformConstant %7 |
| 435 | %5 = OpVariable %6 UniformConstant |
| 436 | %10 = OpTypeInt 32 1 |
| 437 | %9 = OpTypeVector %10 2 |
| 438 | %12 = OpTypeVector %10 3 |
| 439 | %14 = OpConstant %10 0 |
| 440 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 441 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 442 | %13 = OpLoad %3 %1 |
| 443 | %11 = OpImageQuerySizeLod %12 %13 %14 |
| 444 | %8 = OpVectorShuffle %9 %11 %11 0 1 |
| 445 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 446 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 447 | OpCapability SampledCubeArray |
| 448 | OpCapability ImageQuery |
| 449 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 450 | case ValidTextureOverload::kDimensionsDepthCubeArrayLevel: |
| 451 | return { |
| 452 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 453 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 454 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 455 | %2 = OpTypePointer UniformConstant %3 |
| 456 | %1 = OpVariable %2 UniformConstant |
| 457 | %7 = OpTypeSampler |
| 458 | %6 = OpTypePointer UniformConstant %7 |
| 459 | %5 = OpVariable %6 UniformConstant |
| 460 | %10 = OpTypeInt 32 1 |
| 461 | %9 = OpTypeVector %10 2 |
| 462 | %12 = OpTypeVector %10 3 |
| 463 | %14 = OpConstant %10 1 |
| 464 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 465 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 466 | %13 = OpLoad %3 %1 |
| 467 | %11 = OpImageQuerySizeLod %12 %13 %14 |
| 468 | %8 = OpVectorShuffle %9 %11 %11 0 1 |
| 469 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 470 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 471 | OpCapability SampledCubeArray |
| 472 | OpCapability ImageQuery |
| 473 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 474 | case ValidTextureOverload::kDimensionsDepthMultisampled2d: |
| 475 | return { |
| 476 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 477 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 478 | %3 = OpTypeImage %4 2D 0 0 1 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 479 | %2 = OpTypePointer UniformConstant %3 |
| 480 | %1 = OpVariable %2 UniformConstant |
| 481 | %7 = OpTypeSampler |
| 482 | %6 = OpTypePointer UniformConstant %7 |
| 483 | %5 = OpVariable %6 UniformConstant |
| 484 | %10 = OpTypeInt 32 1 |
| 485 | %9 = OpTypeVector %10 2 |
| 486 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 487 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 488 | %11 = OpLoad %3 %1 |
| 489 | %8 = OpImageQuerySize %9 %11 |
| 490 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 491 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 492 | OpCapability ImageQuery |
| 493 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 494 | case ValidTextureOverload::kDimensionsStorageWO1d: |
| 495 | return { |
| 496 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 497 | %4 = OpTypeFloat 32 |
| 498 | %3 = OpTypeImage %4 1D 0 0 0 2 Rgba32f |
| 499 | %2 = OpTypePointer UniformConstant %3 |
| 500 | %1 = OpVariable %2 UniformConstant |
| 501 | %7 = OpTypeSampler |
| 502 | %6 = OpTypePointer UniformConstant %7 |
| 503 | %5 = OpVariable %6 UniformConstant |
| 504 | %9 = OpTypeInt 32 1 |
| 505 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 506 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 507 | %10 = OpLoad %3 %1 |
| 508 | %8 = OpImageQuerySize %9 %10 |
| 509 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 510 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 511 | OpCapability Image1D |
| 512 | OpCapability ImageQuery |
| 513 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 514 | case ValidTextureOverload::kDimensionsStorageWO2d: |
| 515 | return { |
| 516 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 517 | %4 = OpTypeFloat 32 |
| 518 | %3 = OpTypeImage %4 2D 0 0 0 2 Rgba32f |
| 519 | %2 = OpTypePointer UniformConstant %3 |
| 520 | %1 = OpVariable %2 UniformConstant |
| 521 | %7 = OpTypeSampler |
| 522 | %6 = OpTypePointer UniformConstant %7 |
| 523 | %5 = OpVariable %6 UniformConstant |
| 524 | %10 = OpTypeInt 32 1 |
| 525 | %9 = OpTypeVector %10 2 |
| 526 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 527 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 528 | %11 = OpLoad %3 %1 |
| 529 | %8 = OpImageQuerySize %9 %11 |
| 530 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 531 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 532 | OpCapability ImageQuery |
| 533 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 534 | case ValidTextureOverload::kDimensionsStorageWO2dArray: |
| 535 | return { |
| 536 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 537 | %4 = OpTypeFloat 32 |
| 538 | %3 = OpTypeImage %4 2D 0 1 0 2 Rgba32f |
| 539 | %2 = OpTypePointer UniformConstant %3 |
| 540 | %1 = OpVariable %2 UniformConstant |
| 541 | %7 = OpTypeSampler |
| 542 | %6 = OpTypePointer UniformConstant %7 |
| 543 | %5 = OpVariable %6 UniformConstant |
| 544 | %10 = OpTypeInt 32 1 |
| 545 | %9 = OpTypeVector %10 2 |
| 546 | %12 = OpTypeVector %10 3 |
| 547 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 548 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 549 | %13 = OpLoad %3 %1 |
| 550 | %11 = OpImageQuerySize %12 %13 |
| 551 | %8 = OpVectorShuffle %9 %11 %11 0 1 |
| 552 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 553 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 554 | OpCapability ImageQuery |
| 555 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 556 | case ValidTextureOverload::kDimensionsStorageWO3d: |
| 557 | return { |
| 558 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 559 | %4 = OpTypeFloat 32 |
| 560 | %3 = OpTypeImage %4 3D 0 0 0 2 Rgba32f |
| 561 | %2 = OpTypePointer UniformConstant %3 |
| 562 | %1 = OpVariable %2 UniformConstant |
| 563 | %7 = OpTypeSampler |
| 564 | %6 = OpTypePointer UniformConstant %7 |
| 565 | %5 = OpVariable %6 UniformConstant |
| 566 | %10 = OpTypeInt 32 1 |
| 567 | %9 = OpTypeVector %10 3 |
| 568 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 569 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 570 | %11 = OpLoad %3 %1 |
| 571 | %8 = OpImageQuerySize %9 %11 |
| 572 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 573 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 574 | OpCapability ImageQuery |
| 575 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 576 | case ValidTextureOverload::kGather2dF32: |
| 577 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 578 | %4 = OpTypeFloat 32 |
| 579 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
| 580 | %2 = OpTypePointer UniformConstant %3 |
| 581 | %1 = OpVariable %2 UniformConstant |
| 582 | %7 = OpTypeSampler |
| 583 | %6 = OpTypePointer UniformConstant %7 |
| 584 | %5 = OpVariable %6 UniformConstant |
| 585 | %9 = OpTypeVector %4 4 |
| 586 | %12 = OpTypeSampledImage %3 |
| 587 | %14 = OpTypeVector %4 2 |
| 588 | %15 = OpConstant %4 1 |
| 589 | %16 = OpConstant %4 2 |
| 590 | %17 = OpConstantComposite %14 %15 %16 |
| 591 | %18 = OpTypeInt 32 1 |
Ben Clayton | 8e34852 | 2022-06-01 15:57:22 +0000 | [diff] [blame] | 592 | %19 = OpConstantNull %18 |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 593 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 594 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 595 | %10 = OpLoad %7 %5 |
| 596 | %11 = OpLoad %3 %1 |
| 597 | %13 = OpSampledImage %12 %11 %10 |
| 598 | %8 = OpImageGather %9 %13 %17 %19 |
| 599 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 600 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 601 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 602 | case ValidTextureOverload::kGather2dOffsetF32: |
| 603 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 604 | %4 = OpTypeFloat 32 |
| 605 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
| 606 | %2 = OpTypePointer UniformConstant %3 |
| 607 | %1 = OpVariable %2 UniformConstant |
| 608 | %7 = OpTypeSampler |
| 609 | %6 = OpTypePointer UniformConstant %7 |
| 610 | %5 = OpVariable %6 UniformConstant |
| 611 | %9 = OpTypeVector %4 4 |
| 612 | %12 = OpTypeSampledImage %3 |
| 613 | %14 = OpTypeVector %4 2 |
| 614 | %15 = OpConstant %4 1 |
| 615 | %16 = OpConstant %4 2 |
| 616 | %17 = OpConstantComposite %14 %15 %16 |
| 617 | %18 = OpTypeInt 32 1 |
Ben Clayton | 8e34852 | 2022-06-01 15:57:22 +0000 | [diff] [blame] | 618 | %19 = OpConstantNull %18 |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 619 | %20 = OpTypeVector %18 2 |
| 620 | %21 = OpConstant %18 3 |
| 621 | %22 = OpConstant %18 4 |
| 622 | %23 = OpConstantComposite %20 %21 %22 |
| 623 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 624 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 625 | %10 = OpLoad %7 %5 |
| 626 | %11 = OpLoad %3 %1 |
| 627 | %13 = OpSampledImage %12 %11 %10 |
| 628 | %8 = OpImageGather %9 %13 %17 %19 ConstOffset %23 |
| 629 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 630 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 631 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 632 | case ValidTextureOverload::kGather2dArrayF32: |
| 633 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 634 | %4 = OpTypeFloat 32 |
| 635 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
| 636 | %2 = OpTypePointer UniformConstant %3 |
| 637 | %1 = OpVariable %2 UniformConstant |
| 638 | %7 = OpTypeSampler |
| 639 | %6 = OpTypePointer UniformConstant %7 |
| 640 | %5 = OpVariable %6 UniformConstant |
| 641 | %9 = OpTypeVector %4 4 |
| 642 | %12 = OpTypeSampledImage %3 |
| 643 | %14 = OpTypeVector %4 3 |
| 644 | %15 = OpConstant %4 1 |
| 645 | %16 = OpConstant %4 2 |
| 646 | %18 = OpTypeInt 32 1 |
| 647 | %19 = OpConstant %18 3 |
Ben Clayton | 8e34852 | 2022-06-01 15:57:22 +0000 | [diff] [blame] | 648 | %21 = OpConstantNull %18 |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 649 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 650 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 651 | %10 = OpLoad %7 %5 |
| 652 | %11 = OpLoad %3 %1 |
| 653 | %13 = OpSampledImage %12 %11 %10 |
| 654 | %17 = OpConvertSToF %4 %19 |
| 655 | %20 = OpCompositeConstruct %14 %15 %16 %17 |
| 656 | %8 = OpImageGather %9 %13 %20 %21 |
| 657 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 658 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 659 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 660 | case ValidTextureOverload::kGather2dArrayOffsetF32: |
| 661 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 662 | %4 = OpTypeFloat 32 |
| 663 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
| 664 | %2 = OpTypePointer UniformConstant %3 |
| 665 | %1 = OpVariable %2 UniformConstant |
| 666 | %7 = OpTypeSampler |
| 667 | %6 = OpTypePointer UniformConstant %7 |
| 668 | %5 = OpVariable %6 UniformConstant |
| 669 | %9 = OpTypeVector %4 4 |
| 670 | %12 = OpTypeSampledImage %3 |
| 671 | %14 = OpTypeVector %4 3 |
| 672 | %15 = OpConstant %4 1 |
| 673 | %16 = OpConstant %4 2 |
| 674 | %18 = OpTypeInt 32 1 |
| 675 | %19 = OpConstant %18 3 |
Ben Clayton | 8e34852 | 2022-06-01 15:57:22 +0000 | [diff] [blame] | 676 | %21 = OpConstantNull %18 |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 677 | %22 = OpTypeVector %18 2 |
| 678 | %23 = OpConstant %18 4 |
| 679 | %24 = OpConstant %18 5 |
| 680 | %25 = OpConstantComposite %22 %23 %24 |
| 681 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 682 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 683 | %10 = OpLoad %7 %5 |
| 684 | %11 = OpLoad %3 %1 |
| 685 | %13 = OpSampledImage %12 %11 %10 |
| 686 | %17 = OpConvertSToF %4 %19 |
| 687 | %20 = OpCompositeConstruct %14 %15 %16 %17 |
| 688 | %8 = OpImageGather %9 %13 %20 %21 ConstOffset %25 |
| 689 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 690 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 691 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 692 | case ValidTextureOverload::kGatherCubeF32: |
| 693 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 694 | %4 = OpTypeFloat 32 |
| 695 | %3 = OpTypeImage %4 Cube 0 0 0 1 Unknown |
| 696 | %2 = OpTypePointer UniformConstant %3 |
| 697 | %1 = OpVariable %2 UniformConstant |
| 698 | %7 = OpTypeSampler |
| 699 | %6 = OpTypePointer UniformConstant %7 |
| 700 | %5 = OpVariable %6 UniformConstant |
| 701 | %9 = OpTypeVector %4 4 |
| 702 | %12 = OpTypeSampledImage %3 |
| 703 | %14 = OpTypeVector %4 3 |
| 704 | %15 = OpConstant %4 1 |
| 705 | %16 = OpConstant %4 2 |
| 706 | %17 = OpConstant %4 3 |
| 707 | %18 = OpConstantComposite %14 %15 %16 %17 |
| 708 | %19 = OpTypeInt 32 1 |
Ben Clayton | 8e34852 | 2022-06-01 15:57:22 +0000 | [diff] [blame] | 709 | %20 = OpConstantNull %19 |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 710 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 711 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 712 | %10 = OpLoad %7 %5 |
| 713 | %11 = OpLoad %3 %1 |
| 714 | %13 = OpSampledImage %12 %11 %10 |
| 715 | %8 = OpImageGather %9 %13 %18 %20 |
| 716 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 717 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 718 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 719 | case ValidTextureOverload::kGatherCubeArrayF32: |
| 720 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 721 | %4 = OpTypeFloat 32 |
| 722 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
| 723 | %2 = OpTypePointer UniformConstant %3 |
| 724 | %1 = OpVariable %2 UniformConstant |
| 725 | %7 = OpTypeSampler |
| 726 | %6 = OpTypePointer UniformConstant %7 |
| 727 | %5 = OpVariable %6 UniformConstant |
| 728 | %9 = OpTypeVector %4 4 |
| 729 | %12 = OpTypeSampledImage %3 |
| 730 | %14 = OpConstant %4 1 |
| 731 | %15 = OpConstant %4 2 |
| 732 | %16 = OpConstant %4 3 |
| 733 | %18 = OpTypeInt 32 1 |
| 734 | %19 = OpConstant %18 4 |
Ben Clayton | 8e34852 | 2022-06-01 15:57:22 +0000 | [diff] [blame] | 735 | %21 = OpConstantNull %18 |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 736 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 737 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 738 | %10 = OpLoad %7 %5 |
| 739 | %11 = OpLoad %3 %1 |
| 740 | %13 = OpSampledImage %12 %11 %10 |
| 741 | %17 = OpConvertSToF %4 %19 |
| 742 | %20 = OpCompositeConstruct %9 %14 %15 %16 %17 |
| 743 | %8 = OpImageGather %9 %13 %20 %21 |
| 744 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 745 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 746 | OpCapability SampledCubeArray |
| 747 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 748 | case ValidTextureOverload::kGatherDepth2dF32: |
| 749 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 750 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 751 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 752 | %2 = OpTypePointer UniformConstant %3 |
| 753 | %1 = OpVariable %2 UniformConstant |
| 754 | %7 = OpTypeSampler |
| 755 | %6 = OpTypePointer UniformConstant %7 |
| 756 | %5 = OpVariable %6 UniformConstant |
| 757 | %9 = OpTypeVector %4 4 |
| 758 | %12 = OpTypeSampledImage %3 |
| 759 | %14 = OpTypeVector %4 2 |
| 760 | %15 = OpConstant %4 1 |
| 761 | %16 = OpConstant %4 2 |
| 762 | %17 = OpConstantComposite %14 %15 %16 |
| 763 | %18 = OpTypeInt 32 1 |
| 764 | %19 = OpConstant %18 0 |
| 765 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 766 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 767 | %10 = OpLoad %7 %5 |
| 768 | %11 = OpLoad %3 %1 |
| 769 | %13 = OpSampledImage %12 %11 %10 |
| 770 | %8 = OpImageGather %9 %13 %17 %19 |
| 771 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 772 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 773 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 774 | case ValidTextureOverload::kGatherDepth2dOffsetF32: |
| 775 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 776 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 777 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 778 | %2 = OpTypePointer UniformConstant %3 |
| 779 | %1 = OpVariable %2 UniformConstant |
| 780 | %7 = OpTypeSampler |
| 781 | %6 = OpTypePointer UniformConstant %7 |
| 782 | %5 = OpVariable %6 UniformConstant |
| 783 | %9 = OpTypeVector %4 4 |
| 784 | %12 = OpTypeSampledImage %3 |
| 785 | %14 = OpTypeVector %4 2 |
| 786 | %15 = OpConstant %4 1 |
| 787 | %16 = OpConstant %4 2 |
| 788 | %17 = OpConstantComposite %14 %15 %16 |
| 789 | %18 = OpTypeInt 32 1 |
| 790 | %19 = OpConstant %18 0 |
| 791 | %20 = OpTypeVector %18 2 |
| 792 | %21 = OpConstant %18 3 |
| 793 | %22 = OpConstant %18 4 |
| 794 | %23 = OpConstantComposite %20 %21 %22 |
| 795 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 796 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 797 | %10 = OpLoad %7 %5 |
| 798 | %11 = OpLoad %3 %1 |
| 799 | %13 = OpSampledImage %12 %11 %10 |
| 800 | %8 = OpImageGather %9 %13 %17 %19 ConstOffset %23 |
| 801 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 802 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 803 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 804 | case ValidTextureOverload::kGatherDepth2dArrayF32: |
| 805 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 806 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 807 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 808 | %2 = OpTypePointer UniformConstant %3 |
| 809 | %1 = OpVariable %2 UniformConstant |
| 810 | %7 = OpTypeSampler |
| 811 | %6 = OpTypePointer UniformConstant %7 |
| 812 | %5 = OpVariable %6 UniformConstant |
| 813 | %9 = OpTypeVector %4 4 |
| 814 | %12 = OpTypeSampledImage %3 |
| 815 | %14 = OpTypeVector %4 3 |
| 816 | %15 = OpConstant %4 1 |
| 817 | %16 = OpConstant %4 2 |
| 818 | %18 = OpTypeInt 32 1 |
| 819 | %19 = OpConstant %18 3 |
| 820 | %21 = OpConstant %18 0 |
| 821 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 822 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 823 | %10 = OpLoad %7 %5 |
| 824 | %11 = OpLoad %3 %1 |
| 825 | %13 = OpSampledImage %12 %11 %10 |
| 826 | %17 = OpConvertSToF %4 %19 |
| 827 | %20 = OpCompositeConstruct %14 %15 %16 %17 |
| 828 | %8 = OpImageGather %9 %13 %20 %21 |
| 829 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 830 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 831 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 832 | case ValidTextureOverload::kGatherDepth2dArrayOffsetF32: |
| 833 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 834 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 835 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 836 | %2 = OpTypePointer UniformConstant %3 |
| 837 | %1 = OpVariable %2 UniformConstant |
| 838 | %7 = OpTypeSampler |
| 839 | %6 = OpTypePointer UniformConstant %7 |
| 840 | %5 = OpVariable %6 UniformConstant |
| 841 | %9 = OpTypeVector %4 4 |
| 842 | %12 = OpTypeSampledImage %3 |
| 843 | %14 = OpTypeVector %4 3 |
| 844 | %15 = OpConstant %4 1 |
| 845 | %16 = OpConstant %4 2 |
| 846 | %18 = OpTypeInt 32 1 |
| 847 | %19 = OpConstant %18 3 |
| 848 | %21 = OpConstant %18 0 |
| 849 | %22 = OpTypeVector %18 2 |
| 850 | %23 = OpConstant %18 4 |
| 851 | %24 = OpConstant %18 5 |
| 852 | %25 = OpConstantComposite %22 %23 %24 |
| 853 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 854 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 855 | %10 = OpLoad %7 %5 |
| 856 | %11 = OpLoad %3 %1 |
| 857 | %13 = OpSampledImage %12 %11 %10 |
| 858 | %17 = OpConvertSToF %4 %19 |
| 859 | %20 = OpCompositeConstruct %14 %15 %16 %17 |
| 860 | %8 = OpImageGather %9 %13 %20 %21 ConstOffset %25 |
| 861 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 862 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 863 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 864 | case ValidTextureOverload::kGatherDepthCubeF32: |
| 865 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 866 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 867 | %3 = OpTypeImage %4 Cube 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 868 | %2 = OpTypePointer UniformConstant %3 |
| 869 | %1 = OpVariable %2 UniformConstant |
| 870 | %7 = OpTypeSampler |
| 871 | %6 = OpTypePointer UniformConstant %7 |
| 872 | %5 = OpVariable %6 UniformConstant |
| 873 | %9 = OpTypeVector %4 4 |
| 874 | %12 = OpTypeSampledImage %3 |
| 875 | %14 = OpTypeVector %4 3 |
| 876 | %15 = OpConstant %4 1 |
| 877 | %16 = OpConstant %4 2 |
| 878 | %17 = OpConstant %4 3 |
| 879 | %18 = OpConstantComposite %14 %15 %16 %17 |
| 880 | %19 = OpTypeInt 32 1 |
| 881 | %20 = OpConstant %19 0 |
| 882 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 883 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 884 | %10 = OpLoad %7 %5 |
| 885 | %11 = OpLoad %3 %1 |
| 886 | %13 = OpSampledImage %12 %11 %10 |
| 887 | %8 = OpImageGather %9 %13 %18 %20 |
| 888 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 889 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 890 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 891 | case ValidTextureOverload::kGatherDepthCubeArrayF32: |
| 892 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 893 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 894 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 895 | %2 = OpTypePointer UniformConstant %3 |
| 896 | %1 = OpVariable %2 UniformConstant |
| 897 | %7 = OpTypeSampler |
| 898 | %6 = OpTypePointer UniformConstant %7 |
| 899 | %5 = OpVariable %6 UniformConstant |
| 900 | %9 = OpTypeVector %4 4 |
| 901 | %12 = OpTypeSampledImage %3 |
| 902 | %14 = OpConstant %4 1 |
| 903 | %15 = OpConstant %4 2 |
| 904 | %16 = OpConstant %4 3 |
| 905 | %18 = OpTypeInt 32 1 |
| 906 | %19 = OpConstant %18 4 |
| 907 | %21 = OpConstant %18 0 |
| 908 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 909 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 910 | %10 = OpLoad %7 %5 |
| 911 | %11 = OpLoad %3 %1 |
| 912 | %13 = OpSampledImage %12 %11 %10 |
| 913 | %17 = OpConvertSToF %4 %19 |
| 914 | %20 = OpCompositeConstruct %9 %14 %15 %16 %17 |
| 915 | %8 = OpImageGather %9 %13 %20 %21 |
| 916 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 917 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 918 | OpCapability SampledCubeArray |
| 919 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 920 | case ValidTextureOverload::kGatherCompareDepth2dF32: |
| 921 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 922 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 923 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 924 | %2 = OpTypePointer UniformConstant %3 |
| 925 | %1 = OpVariable %2 UniformConstant |
| 926 | %7 = OpTypeSampler |
| 927 | %6 = OpTypePointer UniformConstant %7 |
| 928 | %5 = OpVariable %6 UniformConstant |
| 929 | %9 = OpTypeVector %4 4 |
| 930 | %12 = OpTypeSampledImage %3 |
| 931 | %14 = OpTypeVector %4 2 |
| 932 | %15 = OpConstant %4 1 |
| 933 | %16 = OpConstant %4 2 |
| 934 | %17 = OpConstantComposite %14 %15 %16 |
| 935 | %18 = OpConstant %4 3 |
| 936 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 937 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 938 | %10 = OpLoad %7 %5 |
| 939 | %11 = OpLoad %3 %1 |
| 940 | %13 = OpSampledImage %12 %11 %10 |
| 941 | %8 = OpImageDrefGather %9 %13 %17 %18 |
| 942 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 943 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 944 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 945 | case ValidTextureOverload::kGatherCompareDepth2dOffsetF32: |
| 946 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 947 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 948 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 949 | %2 = OpTypePointer UniformConstant %3 |
| 950 | %1 = OpVariable %2 UniformConstant |
| 951 | %7 = OpTypeSampler |
| 952 | %6 = OpTypePointer UniformConstant %7 |
| 953 | %5 = OpVariable %6 UniformConstant |
| 954 | %9 = OpTypeVector %4 4 |
| 955 | %12 = OpTypeSampledImage %3 |
| 956 | %14 = OpTypeVector %4 2 |
| 957 | %15 = OpConstant %4 1 |
| 958 | %16 = OpConstant %4 2 |
| 959 | %17 = OpConstantComposite %14 %15 %16 |
| 960 | %18 = OpConstant %4 3 |
| 961 | %20 = OpTypeInt 32 1 |
| 962 | %19 = OpTypeVector %20 2 |
| 963 | %21 = OpConstant %20 4 |
| 964 | %22 = OpConstant %20 5 |
| 965 | %23 = OpConstantComposite %19 %21 %22 |
| 966 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 967 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 968 | %10 = OpLoad %7 %5 |
| 969 | %11 = OpLoad %3 %1 |
| 970 | %13 = OpSampledImage %12 %11 %10 |
| 971 | %8 = OpImageDrefGather %9 %13 %17 %18 ConstOffset %23 |
| 972 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 973 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 974 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 975 | case ValidTextureOverload::kGatherCompareDepth2dArrayF32: |
| 976 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 977 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 978 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 979 | %2 = OpTypePointer UniformConstant %3 |
| 980 | %1 = OpVariable %2 UniformConstant |
| 981 | %7 = OpTypeSampler |
| 982 | %6 = OpTypePointer UniformConstant %7 |
| 983 | %5 = OpVariable %6 UniformConstant |
| 984 | %9 = OpTypeVector %4 4 |
| 985 | %12 = OpTypeSampledImage %3 |
| 986 | %14 = OpTypeVector %4 3 |
| 987 | %15 = OpConstant %4 1 |
| 988 | %16 = OpConstant %4 2 |
| 989 | %18 = OpTypeInt 32 1 |
| 990 | %19 = OpConstant %18 3 |
| 991 | %21 = OpConstant %4 4 |
| 992 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 993 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 994 | %10 = OpLoad %7 %5 |
| 995 | %11 = OpLoad %3 %1 |
| 996 | %13 = OpSampledImage %12 %11 %10 |
| 997 | %17 = OpConvertSToF %4 %19 |
| 998 | %20 = OpCompositeConstruct %14 %15 %16 %17 |
| 999 | %8 = OpImageDrefGather %9 %13 %20 %21 |
| 1000 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1001 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1002 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1003 | case ValidTextureOverload::kGatherCompareDepth2dArrayOffsetF32: |
| 1004 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1005 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 1006 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1007 | %2 = OpTypePointer UniformConstant %3 |
| 1008 | %1 = OpVariable %2 UniformConstant |
| 1009 | %7 = OpTypeSampler |
| 1010 | %6 = OpTypePointer UniformConstant %7 |
| 1011 | %5 = OpVariable %6 UniformConstant |
| 1012 | %9 = OpTypeVector %4 4 |
| 1013 | %12 = OpTypeSampledImage %3 |
| 1014 | %14 = OpTypeVector %4 3 |
| 1015 | %15 = OpConstant %4 1 |
| 1016 | %16 = OpConstant %4 2 |
| 1017 | %18 = OpTypeInt 32 1 |
| 1018 | %19 = OpConstant %18 3 |
| 1019 | %21 = OpConstant %4 4 |
| 1020 | %22 = OpTypeVector %18 2 |
| 1021 | %23 = OpConstant %18 5 |
| 1022 | %24 = OpConstant %18 6 |
| 1023 | %25 = OpConstantComposite %22 %23 %24 |
| 1024 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1025 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1026 | %10 = OpLoad %7 %5 |
| 1027 | %11 = OpLoad %3 %1 |
| 1028 | %13 = OpSampledImage %12 %11 %10 |
| 1029 | %17 = OpConvertSToF %4 %19 |
| 1030 | %20 = OpCompositeConstruct %14 %15 %16 %17 |
| 1031 | %8 = OpImageDrefGather %9 %13 %20 %21 ConstOffset %25 |
| 1032 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1033 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1034 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1035 | case ValidTextureOverload::kGatherCompareDepthCubeF32: |
| 1036 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1037 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 1038 | %3 = OpTypeImage %4 Cube 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1039 | %2 = OpTypePointer UniformConstant %3 |
| 1040 | %1 = OpVariable %2 UniformConstant |
| 1041 | %7 = OpTypeSampler |
| 1042 | %6 = OpTypePointer UniformConstant %7 |
| 1043 | %5 = OpVariable %6 UniformConstant |
| 1044 | %9 = OpTypeVector %4 4 |
| 1045 | %12 = OpTypeSampledImage %3 |
| 1046 | %14 = OpTypeVector %4 3 |
| 1047 | %15 = OpConstant %4 1 |
| 1048 | %16 = OpConstant %4 2 |
| 1049 | %17 = OpConstant %4 3 |
| 1050 | %18 = OpConstantComposite %14 %15 %16 %17 |
| 1051 | %19 = OpConstant %4 4 |
| 1052 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1053 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1054 | %10 = OpLoad %7 %5 |
| 1055 | %11 = OpLoad %3 %1 |
| 1056 | %13 = OpSampledImage %12 %11 %10 |
| 1057 | %8 = OpImageDrefGather %9 %13 %18 %19 |
| 1058 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1059 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1060 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1061 | case ValidTextureOverload::kGatherCompareDepthCubeArrayF32: |
| 1062 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1063 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 1064 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1065 | %2 = OpTypePointer UniformConstant %3 |
| 1066 | %1 = OpVariable %2 UniformConstant |
| 1067 | %7 = OpTypeSampler |
| 1068 | %6 = OpTypePointer UniformConstant %7 |
| 1069 | %5 = OpVariable %6 UniformConstant |
| 1070 | %9 = OpTypeVector %4 4 |
| 1071 | %12 = OpTypeSampledImage %3 |
| 1072 | %14 = OpConstant %4 1 |
| 1073 | %15 = OpConstant %4 2 |
| 1074 | %16 = OpConstant %4 3 |
| 1075 | %18 = OpTypeInt 32 1 |
| 1076 | %19 = OpConstant %18 4 |
| 1077 | %21 = OpConstant %4 5 |
| 1078 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1079 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1080 | %10 = OpLoad %7 %5 |
| 1081 | %11 = OpLoad %3 %1 |
| 1082 | %13 = OpSampledImage %12 %11 %10 |
| 1083 | %17 = OpConvertSToF %4 %19 |
| 1084 | %20 = OpCompositeConstruct %9 %14 %15 %16 %17 |
| 1085 | %8 = OpImageDrefGather %9 %13 %20 %21 |
| 1086 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1087 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1088 | OpCapability SampledCubeArray |
| 1089 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1090 | case ValidTextureOverload::kNumLayers2dArray: |
| 1091 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1092 | %4 = OpTypeFloat 32 |
| 1093 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
| 1094 | %2 = OpTypePointer UniformConstant %3 |
| 1095 | %1 = OpVariable %2 UniformConstant |
| 1096 | %7 = OpTypeSampler |
| 1097 | %6 = OpTypePointer UniformConstant %7 |
| 1098 | %5 = OpVariable %6 UniformConstant |
| 1099 | %9 = OpTypeInt 32 1 |
| 1100 | %11 = OpTypeVector %9 3 |
| 1101 | %13 = OpConstant %9 0 |
| 1102 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1103 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1104 | %12 = OpLoad %3 %1 |
| 1105 | %10 = OpImageQuerySizeLod %11 %12 %13 |
| 1106 | %8 = OpCompositeExtract %9 %10 2 |
| 1107 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1108 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1109 | OpCapability ImageQuery |
| 1110 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1111 | case ValidTextureOverload::kNumLayersCubeArray: |
| 1112 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1113 | %4 = OpTypeFloat 32 |
| 1114 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
| 1115 | %2 = OpTypePointer UniformConstant %3 |
| 1116 | %1 = OpVariable %2 UniformConstant |
| 1117 | %7 = OpTypeSampler |
| 1118 | %6 = OpTypePointer UniformConstant %7 |
| 1119 | %5 = OpVariable %6 UniformConstant |
| 1120 | %9 = OpTypeInt 32 1 |
| 1121 | %11 = OpTypeVector %9 3 |
| 1122 | %13 = OpConstant %9 0 |
| 1123 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1124 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1125 | %12 = OpLoad %3 %1 |
| 1126 | %10 = OpImageQuerySizeLod %11 %12 %13 |
| 1127 | %8 = OpCompositeExtract %9 %10 2 |
| 1128 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1129 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1130 | OpCapability SampledCubeArray |
| 1131 | OpCapability ImageQuery |
| 1132 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1133 | case ValidTextureOverload::kNumLayersDepth2dArray: |
| 1134 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1135 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 1136 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1137 | %2 = OpTypePointer UniformConstant %3 |
| 1138 | %1 = OpVariable %2 UniformConstant |
| 1139 | %7 = OpTypeSampler |
| 1140 | %6 = OpTypePointer UniformConstant %7 |
| 1141 | %5 = OpVariable %6 UniformConstant |
| 1142 | %9 = OpTypeInt 32 1 |
| 1143 | %11 = OpTypeVector %9 3 |
| 1144 | %13 = OpConstant %9 0 |
| 1145 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1146 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1147 | %12 = OpLoad %3 %1 |
| 1148 | %10 = OpImageQuerySizeLod %11 %12 %13 |
| 1149 | %8 = OpCompositeExtract %9 %10 2 |
| 1150 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1151 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1152 | OpCapability ImageQuery |
| 1153 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1154 | case ValidTextureOverload::kNumLayersDepthCubeArray: |
| 1155 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1156 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 1157 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1158 | %2 = OpTypePointer UniformConstant %3 |
| 1159 | %1 = OpVariable %2 UniformConstant |
| 1160 | %7 = OpTypeSampler |
| 1161 | %6 = OpTypePointer UniformConstant %7 |
| 1162 | %5 = OpVariable %6 UniformConstant |
| 1163 | %9 = OpTypeInt 32 1 |
| 1164 | %11 = OpTypeVector %9 3 |
| 1165 | %13 = OpConstant %9 0 |
| 1166 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1167 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1168 | %12 = OpLoad %3 %1 |
| 1169 | %10 = OpImageQuerySizeLod %11 %12 %13 |
| 1170 | %8 = OpCompositeExtract %9 %10 2 |
| 1171 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1172 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1173 | OpCapability SampledCubeArray |
| 1174 | OpCapability ImageQuery |
| 1175 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1176 | case ValidTextureOverload::kNumLayersStorageWO2dArray: |
| 1177 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1178 | %4 = OpTypeFloat 32 |
| 1179 | %3 = OpTypeImage %4 2D 0 1 0 2 Rgba32f |
| 1180 | %2 = OpTypePointer UniformConstant %3 |
| 1181 | %1 = OpVariable %2 UniformConstant |
| 1182 | %7 = OpTypeSampler |
| 1183 | %6 = OpTypePointer UniformConstant %7 |
| 1184 | %5 = OpVariable %6 UniformConstant |
| 1185 | %9 = OpTypeInt 32 1 |
| 1186 | %11 = OpTypeVector %9 3 |
| 1187 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1188 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1189 | %12 = OpLoad %3 %1 |
| 1190 | %10 = OpImageQuerySize %11 %12 |
| 1191 | %8 = OpCompositeExtract %9 %10 2 |
| 1192 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1193 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1194 | OpCapability ImageQuery |
| 1195 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1196 | case ValidTextureOverload::kNumLevels2d: |
| 1197 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1198 | %4 = OpTypeFloat 32 |
| 1199 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
| 1200 | %2 = OpTypePointer UniformConstant %3 |
| 1201 | %1 = OpVariable %2 UniformConstant |
| 1202 | %7 = OpTypeSampler |
| 1203 | %6 = OpTypePointer UniformConstant %7 |
| 1204 | %5 = OpVariable %6 UniformConstant |
| 1205 | %9 = OpTypeInt 32 1 |
| 1206 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1207 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1208 | %10 = OpLoad %3 %1 |
| 1209 | %8 = OpImageQueryLevels %9 %10 |
| 1210 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1211 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1212 | OpCapability ImageQuery |
| 1213 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1214 | case ValidTextureOverload::kNumLevels2dArray: |
| 1215 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1216 | %4 = OpTypeFloat 32 |
| 1217 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
| 1218 | %2 = OpTypePointer UniformConstant %3 |
| 1219 | %1 = OpVariable %2 UniformConstant |
| 1220 | %7 = OpTypeSampler |
| 1221 | %6 = OpTypePointer UniformConstant %7 |
| 1222 | %5 = OpVariable %6 UniformConstant |
| 1223 | %9 = OpTypeInt 32 1 |
| 1224 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1225 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1226 | %10 = OpLoad %3 %1 |
| 1227 | %8 = OpImageQueryLevels %9 %10 |
| 1228 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1229 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1230 | OpCapability ImageQuery |
| 1231 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1232 | case ValidTextureOverload::kNumLevels3d: |
| 1233 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1234 | %4 = OpTypeFloat 32 |
| 1235 | %3 = OpTypeImage %4 3D 0 0 0 1 Unknown |
| 1236 | %2 = OpTypePointer UniformConstant %3 |
| 1237 | %1 = OpVariable %2 UniformConstant |
| 1238 | %7 = OpTypeSampler |
| 1239 | %6 = OpTypePointer UniformConstant %7 |
| 1240 | %5 = OpVariable %6 UniformConstant |
| 1241 | %9 = OpTypeInt 32 1 |
| 1242 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1243 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1244 | %10 = OpLoad %3 %1 |
| 1245 | %8 = OpImageQueryLevels %9 %10 |
| 1246 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1247 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1248 | OpCapability ImageQuery |
| 1249 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1250 | case ValidTextureOverload::kNumLevelsCube: |
| 1251 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1252 | %4 = OpTypeFloat 32 |
| 1253 | %3 = OpTypeImage %4 Cube 0 0 0 1 Unknown |
| 1254 | %2 = OpTypePointer UniformConstant %3 |
| 1255 | %1 = OpVariable %2 UniformConstant |
| 1256 | %7 = OpTypeSampler |
| 1257 | %6 = OpTypePointer UniformConstant %7 |
| 1258 | %5 = OpVariable %6 UniformConstant |
| 1259 | %9 = OpTypeInt 32 1 |
| 1260 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1261 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1262 | %10 = OpLoad %3 %1 |
| 1263 | %8 = OpImageQueryLevels %9 %10 |
| 1264 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1265 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1266 | OpCapability ImageQuery |
| 1267 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1268 | case ValidTextureOverload::kNumLevelsCubeArray: |
| 1269 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1270 | %4 = OpTypeFloat 32 |
| 1271 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
| 1272 | %2 = OpTypePointer UniformConstant %3 |
| 1273 | %1 = OpVariable %2 UniformConstant |
| 1274 | %7 = OpTypeSampler |
| 1275 | %6 = OpTypePointer UniformConstant %7 |
| 1276 | %5 = OpVariable %6 UniformConstant |
| 1277 | %9 = OpTypeInt 32 1 |
| 1278 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1279 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1280 | %10 = OpLoad %3 %1 |
| 1281 | %8 = OpImageQueryLevels %9 %10 |
| 1282 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1283 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1284 | OpCapability SampledCubeArray |
| 1285 | OpCapability ImageQuery |
| 1286 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1287 | case ValidTextureOverload::kNumLevelsDepth2d: |
| 1288 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1289 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 1290 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1291 | %2 = OpTypePointer UniformConstant %3 |
| 1292 | %1 = OpVariable %2 UniformConstant |
| 1293 | %7 = OpTypeSampler |
| 1294 | %6 = OpTypePointer UniformConstant %7 |
| 1295 | %5 = OpVariable %6 UniformConstant |
| 1296 | %9 = OpTypeInt 32 1 |
| 1297 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1298 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1299 | %10 = OpLoad %3 %1 |
| 1300 | %8 = OpImageQueryLevels %9 %10 |
| 1301 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1302 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1303 | OpCapability ImageQuery |
| 1304 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1305 | case ValidTextureOverload::kNumLevelsDepth2dArray: |
| 1306 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1307 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 1308 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1309 | %2 = OpTypePointer UniformConstant %3 |
| 1310 | %1 = OpVariable %2 UniformConstant |
| 1311 | %7 = OpTypeSampler |
| 1312 | %6 = OpTypePointer UniformConstant %7 |
| 1313 | %5 = OpVariable %6 UniformConstant |
| 1314 | %9 = OpTypeInt 32 1 |
| 1315 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1316 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1317 | %10 = OpLoad %3 %1 |
| 1318 | %8 = OpImageQueryLevels %9 %10 |
| 1319 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1320 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1321 | OpCapability ImageQuery |
| 1322 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1323 | case ValidTextureOverload::kNumLevelsDepthCube: |
| 1324 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1325 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 1326 | %3 = OpTypeImage %4 Cube 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1327 | %2 = OpTypePointer UniformConstant %3 |
| 1328 | %1 = OpVariable %2 UniformConstant |
| 1329 | %7 = OpTypeSampler |
| 1330 | %6 = OpTypePointer UniformConstant %7 |
| 1331 | %5 = OpVariable %6 UniformConstant |
| 1332 | %9 = OpTypeInt 32 1 |
| 1333 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1334 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1335 | %10 = OpLoad %3 %1 |
| 1336 | %8 = OpImageQueryLevels %9 %10 |
| 1337 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1338 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1339 | OpCapability ImageQuery |
| 1340 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1341 | case ValidTextureOverload::kNumLevelsDepthCubeArray: |
| 1342 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1343 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 1344 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1345 | %2 = OpTypePointer UniformConstant %3 |
| 1346 | %1 = OpVariable %2 UniformConstant |
| 1347 | %7 = OpTypeSampler |
| 1348 | %6 = OpTypePointer UniformConstant %7 |
| 1349 | %5 = OpVariable %6 UniformConstant |
| 1350 | %9 = OpTypeInt 32 1 |
| 1351 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1352 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1353 | %10 = OpLoad %3 %1 |
| 1354 | %8 = OpImageQueryLevels %9 %10 |
| 1355 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1356 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1357 | OpCapability SampledCubeArray |
| 1358 | OpCapability ImageQuery |
| 1359 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1360 | case ValidTextureOverload::kNumSamplesMultisampled2d: |
| 1361 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1362 | %4 = OpTypeFloat 32 |
| 1363 | %3 = OpTypeImage %4 2D 0 0 1 1 Unknown |
| 1364 | %2 = OpTypePointer UniformConstant %3 |
| 1365 | %1 = OpVariable %2 UniformConstant |
| 1366 | %7 = OpTypeSampler |
| 1367 | %6 = OpTypePointer UniformConstant %7 |
| 1368 | %5 = OpVariable %6 UniformConstant |
| 1369 | %9 = OpTypeInt 32 1 |
| 1370 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1371 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1372 | %10 = OpLoad %3 %1 |
| 1373 | %8 = OpImageQuerySamples %9 %10 |
| 1374 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1375 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1376 | OpCapability ImageQuery |
| 1377 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1378 | case ValidTextureOverload::kNumSamplesDepthMultisampled2d: |
| 1379 | return {R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1380 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 1381 | %3 = OpTypeImage %4 2D 0 0 1 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1382 | %2 = OpTypePointer UniformConstant %3 |
| 1383 | %1 = OpVariable %2 UniformConstant |
| 1384 | %7 = OpTypeSampler |
| 1385 | %6 = OpTypePointer UniformConstant %7 |
| 1386 | %5 = OpVariable %6 UniformConstant |
| 1387 | %9 = OpTypeInt 32 1 |
| 1388 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1389 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1390 | %10 = OpLoad %3 %1 |
| 1391 | %8 = OpImageQuerySamples %9 %10 |
| 1392 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1393 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1394 | OpCapability ImageQuery |
| 1395 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1396 | case ValidTextureOverload::kSample1dF32: |
| 1397 | return { |
| 1398 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1399 | %4 = OpTypeFloat 32 |
| 1400 | %3 = OpTypeImage %4 1D 0 0 0 1 Unknown |
| 1401 | %2 = OpTypePointer UniformConstant %3 |
| 1402 | %1 = OpVariable %2 UniformConstant |
| 1403 | %7 = OpTypeSampler |
| 1404 | %6 = OpTypePointer UniformConstant %7 |
| 1405 | %5 = OpVariable %6 UniformConstant |
| 1406 | %9 = OpTypeVector %4 4 |
| 1407 | %12 = OpTypeSampledImage %3 |
| 1408 | %14 = OpConstant %4 1 |
| 1409 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1410 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1411 | %10 = OpLoad %7 %5 |
| 1412 | %11 = OpLoad %3 %1 |
| 1413 | %13 = OpSampledImage %12 %11 %10 |
| 1414 | %8 = OpImageSampleImplicitLod %9 %13 %14 |
| 1415 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1416 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1417 | OpCapability Sampled1D |
| 1418 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1419 | case ValidTextureOverload::kSample2dF32: |
| 1420 | return { |
| 1421 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1422 | %4 = OpTypeFloat 32 |
| 1423 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
| 1424 | %2 = OpTypePointer UniformConstant %3 |
| 1425 | %1 = OpVariable %2 UniformConstant |
| 1426 | %7 = OpTypeSampler |
| 1427 | %6 = OpTypePointer UniformConstant %7 |
| 1428 | %5 = OpVariable %6 UniformConstant |
| 1429 | %9 = OpTypeVector %4 4 |
| 1430 | %12 = OpTypeSampledImage %3 |
| 1431 | %14 = OpTypeVector %4 2 |
| 1432 | %15 = OpConstant %4 1 |
| 1433 | %16 = OpConstant %4 2 |
| 1434 | %17 = OpConstantComposite %14 %15 %16 |
| 1435 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1436 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1437 | %10 = OpLoad %7 %5 |
| 1438 | %11 = OpLoad %3 %1 |
| 1439 | %13 = OpSampledImage %12 %11 %10 |
| 1440 | %8 = OpImageSampleImplicitLod %9 %13 %17 |
| 1441 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1442 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1443 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1444 | case ValidTextureOverload::kSample2dOffsetF32: |
| 1445 | return { |
| 1446 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1447 | %4 = OpTypeFloat 32 |
| 1448 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
| 1449 | %2 = OpTypePointer UniformConstant %3 |
| 1450 | %1 = OpVariable %2 UniformConstant |
| 1451 | %7 = OpTypeSampler |
| 1452 | %6 = OpTypePointer UniformConstant %7 |
| 1453 | %5 = OpVariable %6 UniformConstant |
| 1454 | %9 = OpTypeVector %4 4 |
| 1455 | %12 = OpTypeSampledImage %3 |
| 1456 | %14 = OpTypeVector %4 2 |
| 1457 | %15 = OpConstant %4 1 |
| 1458 | %16 = OpConstant %4 2 |
| 1459 | %17 = OpConstantComposite %14 %15 %16 |
| 1460 | %19 = OpTypeInt 32 1 |
| 1461 | %18 = OpTypeVector %19 2 |
| 1462 | %20 = OpConstant %19 3 |
| 1463 | %21 = OpConstant %19 4 |
| 1464 | %22 = OpConstantComposite %18 %20 %21 |
| 1465 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1466 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1467 | %10 = OpLoad %7 %5 |
| 1468 | %11 = OpLoad %3 %1 |
| 1469 | %13 = OpSampledImage %12 %11 %10 |
| 1470 | %8 = OpImageSampleImplicitLod %9 %13 %17 ConstOffset %22 |
| 1471 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1472 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1473 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1474 | case ValidTextureOverload::kSample2dArrayF32: |
| 1475 | return { |
| 1476 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1477 | %4 = OpTypeFloat 32 |
| 1478 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
| 1479 | %2 = OpTypePointer UniformConstant %3 |
| 1480 | %1 = OpVariable %2 UniformConstant |
| 1481 | %7 = OpTypeSampler |
| 1482 | %6 = OpTypePointer UniformConstant %7 |
| 1483 | %5 = OpVariable %6 UniformConstant |
| 1484 | %9 = OpTypeVector %4 4 |
| 1485 | %12 = OpTypeSampledImage %3 |
| 1486 | %14 = OpTypeVector %4 3 |
| 1487 | %15 = OpConstant %4 1 |
| 1488 | %16 = OpConstant %4 2 |
| 1489 | %18 = OpTypeInt 32 1 |
| 1490 | %19 = OpConstant %18 3 |
| 1491 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1492 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1493 | %10 = OpLoad %7 %5 |
| 1494 | %11 = OpLoad %3 %1 |
| 1495 | %13 = OpSampledImage %12 %11 %10 |
| 1496 | %17 = OpConvertSToF %4 %19 |
| 1497 | %20 = OpCompositeConstruct %14 %15 %16 %17 |
| 1498 | %8 = OpImageSampleImplicitLod %9 %13 %20 |
| 1499 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1500 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1501 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1502 | case ValidTextureOverload::kSample2dArrayOffsetF32: |
| 1503 | return { |
| 1504 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1505 | %4 = OpTypeFloat 32 |
| 1506 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
| 1507 | %2 = OpTypePointer UniformConstant %3 |
| 1508 | %1 = OpVariable %2 UniformConstant |
| 1509 | %7 = OpTypeSampler |
| 1510 | %6 = OpTypePointer UniformConstant %7 |
| 1511 | %5 = OpVariable %6 UniformConstant |
| 1512 | %9 = OpTypeVector %4 4 |
| 1513 | %12 = OpTypeSampledImage %3 |
| 1514 | %14 = OpTypeVector %4 3 |
| 1515 | %15 = OpConstant %4 1 |
| 1516 | %16 = OpConstant %4 2 |
| 1517 | %18 = OpTypeInt 32 1 |
| 1518 | %19 = OpConstant %18 3 |
| 1519 | %21 = OpTypeVector %18 2 |
| 1520 | %22 = OpConstant %18 4 |
| 1521 | %23 = OpConstant %18 5 |
| 1522 | %24 = OpConstantComposite %21 %22 %23 |
| 1523 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1524 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1525 | %10 = OpLoad %7 %5 |
| 1526 | %11 = OpLoad %3 %1 |
| 1527 | %13 = OpSampledImage %12 %11 %10 |
| 1528 | %17 = OpConvertSToF %4 %19 |
| 1529 | %20 = OpCompositeConstruct %14 %15 %16 %17 |
| 1530 | %8 = OpImageSampleImplicitLod %9 %13 %20 ConstOffset %24 |
| 1531 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1532 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1533 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1534 | case ValidTextureOverload::kSample3dF32: |
| 1535 | return { |
| 1536 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1537 | %4 = OpTypeFloat 32 |
| 1538 | %3 = OpTypeImage %4 3D 0 0 0 1 Unknown |
| 1539 | %2 = OpTypePointer UniformConstant %3 |
| 1540 | %1 = OpVariable %2 UniformConstant |
| 1541 | %7 = OpTypeSampler |
| 1542 | %6 = OpTypePointer UniformConstant %7 |
| 1543 | %5 = OpVariable %6 UniformConstant |
| 1544 | %9 = OpTypeVector %4 4 |
| 1545 | %12 = OpTypeSampledImage %3 |
| 1546 | %14 = OpTypeVector %4 3 |
| 1547 | %15 = OpConstant %4 1 |
| 1548 | %16 = OpConstant %4 2 |
| 1549 | %17 = OpConstant %4 3 |
| 1550 | %18 = OpConstantComposite %14 %15 %16 %17 |
| 1551 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1552 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1553 | %10 = OpLoad %7 %5 |
| 1554 | %11 = OpLoad %3 %1 |
| 1555 | %13 = OpSampledImage %12 %11 %10 |
| 1556 | %8 = OpImageSampleImplicitLod %9 %13 %18 |
| 1557 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1558 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1559 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1560 | case ValidTextureOverload::kSample3dOffsetF32: |
| 1561 | return { |
| 1562 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1563 | %4 = OpTypeFloat 32 |
| 1564 | %3 = OpTypeImage %4 3D 0 0 0 1 Unknown |
| 1565 | %2 = OpTypePointer UniformConstant %3 |
| 1566 | %1 = OpVariable %2 UniformConstant |
| 1567 | %7 = OpTypeSampler |
| 1568 | %6 = OpTypePointer UniformConstant %7 |
| 1569 | %5 = OpVariable %6 UniformConstant |
| 1570 | %9 = OpTypeVector %4 4 |
| 1571 | %12 = OpTypeSampledImage %3 |
| 1572 | %14 = OpTypeVector %4 3 |
| 1573 | %15 = OpConstant %4 1 |
| 1574 | %16 = OpConstant %4 2 |
| 1575 | %17 = OpConstant %4 3 |
| 1576 | %18 = OpConstantComposite %14 %15 %16 %17 |
| 1577 | %20 = OpTypeInt 32 1 |
| 1578 | %19 = OpTypeVector %20 3 |
| 1579 | %21 = OpConstant %20 4 |
| 1580 | %22 = OpConstant %20 5 |
| 1581 | %23 = OpConstant %20 6 |
| 1582 | %24 = OpConstantComposite %19 %21 %22 %23 |
| 1583 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1584 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1585 | %10 = OpLoad %7 %5 |
| 1586 | %11 = OpLoad %3 %1 |
| 1587 | %13 = OpSampledImage %12 %11 %10 |
| 1588 | %8 = OpImageSampleImplicitLod %9 %13 %18 ConstOffset %24 |
| 1589 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1590 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1591 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1592 | case ValidTextureOverload::kSampleCubeF32: |
| 1593 | return { |
| 1594 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1595 | %4 = OpTypeFloat 32 |
| 1596 | %3 = OpTypeImage %4 Cube 0 0 0 1 Unknown |
| 1597 | %2 = OpTypePointer UniformConstant %3 |
| 1598 | %1 = OpVariable %2 UniformConstant |
| 1599 | %7 = OpTypeSampler |
| 1600 | %6 = OpTypePointer UniformConstant %7 |
| 1601 | %5 = OpVariable %6 UniformConstant |
| 1602 | %9 = OpTypeVector %4 4 |
| 1603 | %12 = OpTypeSampledImage %3 |
| 1604 | %14 = OpTypeVector %4 3 |
| 1605 | %15 = OpConstant %4 1 |
| 1606 | %16 = OpConstant %4 2 |
| 1607 | %17 = OpConstant %4 3 |
| 1608 | %18 = OpConstantComposite %14 %15 %16 %17 |
| 1609 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1610 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1611 | %10 = OpLoad %7 %5 |
| 1612 | %11 = OpLoad %3 %1 |
| 1613 | %13 = OpSampledImage %12 %11 %10 |
| 1614 | %8 = OpImageSampleImplicitLod %9 %13 %18 |
| 1615 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1616 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1617 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1618 | case ValidTextureOverload::kSampleCubeArrayF32: |
| 1619 | return { |
| 1620 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1621 | %4 = OpTypeFloat 32 |
| 1622 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
| 1623 | %2 = OpTypePointer UniformConstant %3 |
| 1624 | %1 = OpVariable %2 UniformConstant |
| 1625 | %7 = OpTypeSampler |
| 1626 | %6 = OpTypePointer UniformConstant %7 |
| 1627 | %5 = OpVariable %6 UniformConstant |
| 1628 | %9 = OpTypeVector %4 4 |
| 1629 | %12 = OpTypeSampledImage %3 |
| 1630 | %14 = OpConstant %4 1 |
| 1631 | %15 = OpConstant %4 2 |
| 1632 | %16 = OpConstant %4 3 |
| 1633 | %18 = OpTypeInt 32 1 |
| 1634 | %19 = OpConstant %18 4 |
| 1635 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1636 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1637 | %10 = OpLoad %7 %5 |
| 1638 | %11 = OpLoad %3 %1 |
| 1639 | %13 = OpSampledImage %12 %11 %10 |
| 1640 | %17 = OpConvertSToF %4 %19 |
| 1641 | %20 = OpCompositeConstruct %9 %14 %15 %16 %17 |
| 1642 | %8 = OpImageSampleImplicitLod %9 %13 %20 |
| 1643 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1644 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1645 | OpCapability SampledCubeArray |
| 1646 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1647 | case ValidTextureOverload::kSampleDepth2dF32: |
| 1648 | return { |
| 1649 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1650 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 1651 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1652 | %2 = OpTypePointer UniformConstant %3 |
| 1653 | %1 = OpVariable %2 UniformConstant |
| 1654 | %7 = OpTypeSampler |
| 1655 | %6 = OpTypePointer UniformConstant %7 |
| 1656 | %5 = OpVariable %6 UniformConstant |
| 1657 | %10 = OpTypeVector %4 4 |
| 1658 | %13 = OpTypeSampledImage %3 |
| 1659 | %15 = OpTypeVector %4 2 |
| 1660 | %16 = OpConstant %4 1 |
| 1661 | %17 = OpConstant %4 2 |
| 1662 | %18 = OpConstantComposite %15 %16 %17 |
| 1663 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1664 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1665 | %11 = OpLoad %7 %5 |
| 1666 | %12 = OpLoad %3 %1 |
| 1667 | %14 = OpSampledImage %13 %12 %11 |
| 1668 | %9 = OpImageSampleImplicitLod %10 %14 %18 |
| 1669 | %8 = OpCompositeExtract %4 %9 0 |
| 1670 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1671 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1672 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1673 | case ValidTextureOverload::kSampleDepth2dOffsetF32: |
| 1674 | return { |
| 1675 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1676 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 1677 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1678 | %2 = OpTypePointer UniformConstant %3 |
| 1679 | %1 = OpVariable %2 UniformConstant |
| 1680 | %7 = OpTypeSampler |
| 1681 | %6 = OpTypePointer UniformConstant %7 |
| 1682 | %5 = OpVariable %6 UniformConstant |
| 1683 | %10 = OpTypeVector %4 4 |
| 1684 | %13 = OpTypeSampledImage %3 |
| 1685 | %15 = OpTypeVector %4 2 |
| 1686 | %16 = OpConstant %4 1 |
| 1687 | %17 = OpConstant %4 2 |
| 1688 | %18 = OpConstantComposite %15 %16 %17 |
| 1689 | %20 = OpTypeInt 32 1 |
| 1690 | %19 = OpTypeVector %20 2 |
| 1691 | %21 = OpConstant %20 3 |
| 1692 | %22 = OpConstant %20 4 |
| 1693 | %23 = OpConstantComposite %19 %21 %22 |
| 1694 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1695 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1696 | %11 = OpLoad %7 %5 |
| 1697 | %12 = OpLoad %3 %1 |
| 1698 | %14 = OpSampledImage %13 %12 %11 |
| 1699 | %9 = OpImageSampleImplicitLod %10 %14 %18 ConstOffset %23 |
| 1700 | %8 = OpCompositeExtract %4 %9 0 |
| 1701 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1702 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1703 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1704 | case ValidTextureOverload::kSampleDepth2dArrayF32: |
| 1705 | return { |
| 1706 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1707 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 1708 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1709 | %2 = OpTypePointer UniformConstant %3 |
| 1710 | %1 = OpVariable %2 UniformConstant |
| 1711 | %7 = OpTypeSampler |
| 1712 | %6 = OpTypePointer UniformConstant %7 |
| 1713 | %5 = OpVariable %6 UniformConstant |
| 1714 | %10 = OpTypeVector %4 4 |
| 1715 | %13 = OpTypeSampledImage %3 |
| 1716 | %15 = OpTypeVector %4 3 |
| 1717 | %16 = OpConstant %4 1 |
| 1718 | %17 = OpConstant %4 2 |
| 1719 | %19 = OpTypeInt 32 1 |
| 1720 | %20 = OpConstant %19 3 |
| 1721 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1722 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1723 | %11 = OpLoad %7 %5 |
| 1724 | %12 = OpLoad %3 %1 |
| 1725 | %14 = OpSampledImage %13 %12 %11 |
| 1726 | %18 = OpConvertSToF %4 %20 |
| 1727 | %21 = OpCompositeConstruct %15 %16 %17 %18 |
| 1728 | %9 = OpImageSampleImplicitLod %10 %14 %21 |
| 1729 | %8 = OpCompositeExtract %4 %9 0 |
| 1730 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1731 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1732 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1733 | case ValidTextureOverload::kSampleDepth2dArrayOffsetF32: |
| 1734 | return { |
| 1735 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1736 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 1737 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1738 | %2 = OpTypePointer UniformConstant %3 |
| 1739 | %1 = OpVariable %2 UniformConstant |
| 1740 | %7 = OpTypeSampler |
| 1741 | %6 = OpTypePointer UniformConstant %7 |
| 1742 | %5 = OpVariable %6 UniformConstant |
| 1743 | %10 = OpTypeVector %4 4 |
| 1744 | %13 = OpTypeSampledImage %3 |
| 1745 | %15 = OpTypeVector %4 3 |
| 1746 | %16 = OpConstant %4 1 |
| 1747 | %17 = OpConstant %4 2 |
| 1748 | %19 = OpTypeInt 32 1 |
| 1749 | %20 = OpConstant %19 3 |
| 1750 | %22 = OpTypeVector %19 2 |
| 1751 | %23 = OpConstant %19 4 |
| 1752 | %24 = OpConstant %19 5 |
| 1753 | %25 = OpConstantComposite %22 %23 %24 |
| 1754 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1755 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1756 | %11 = OpLoad %7 %5 |
| 1757 | %12 = OpLoad %3 %1 |
| 1758 | %14 = OpSampledImage %13 %12 %11 |
| 1759 | %18 = OpConvertSToF %4 %20 |
| 1760 | %21 = OpCompositeConstruct %15 %16 %17 %18 |
| 1761 | %9 = OpImageSampleImplicitLod %10 %14 %21 ConstOffset %25 |
| 1762 | %8 = OpCompositeExtract %4 %9 0 |
| 1763 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1764 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1765 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1766 | case ValidTextureOverload::kSampleDepthCubeF32: |
| 1767 | return { |
| 1768 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1769 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 1770 | %3 = OpTypeImage %4 Cube 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1771 | %2 = OpTypePointer UniformConstant %3 |
| 1772 | %1 = OpVariable %2 UniformConstant |
| 1773 | %7 = OpTypeSampler |
| 1774 | %6 = OpTypePointer UniformConstant %7 |
| 1775 | %5 = OpVariable %6 UniformConstant |
| 1776 | %10 = OpTypeVector %4 4 |
| 1777 | %13 = OpTypeSampledImage %3 |
| 1778 | %15 = OpTypeVector %4 3 |
| 1779 | %16 = OpConstant %4 1 |
| 1780 | %17 = OpConstant %4 2 |
| 1781 | %18 = OpConstant %4 3 |
| 1782 | %19 = OpConstantComposite %15 %16 %17 %18 |
| 1783 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1784 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1785 | %11 = OpLoad %7 %5 |
| 1786 | %12 = OpLoad %3 %1 |
| 1787 | %14 = OpSampledImage %13 %12 %11 |
| 1788 | %9 = OpImageSampleImplicitLod %10 %14 %19 |
| 1789 | %8 = OpCompositeExtract %4 %9 0 |
| 1790 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1791 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1792 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1793 | case ValidTextureOverload::kSampleDepthCubeArrayF32: |
| 1794 | return { |
| 1795 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1796 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 1797 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1798 | %2 = OpTypePointer UniformConstant %3 |
| 1799 | %1 = OpVariable %2 UniformConstant |
| 1800 | %7 = OpTypeSampler |
| 1801 | %6 = OpTypePointer UniformConstant %7 |
| 1802 | %5 = OpVariable %6 UniformConstant |
| 1803 | %10 = OpTypeVector %4 4 |
| 1804 | %13 = OpTypeSampledImage %3 |
| 1805 | %15 = OpConstant %4 1 |
| 1806 | %16 = OpConstant %4 2 |
| 1807 | %17 = OpConstant %4 3 |
| 1808 | %19 = OpTypeInt 32 1 |
| 1809 | %20 = OpConstant %19 4 |
| 1810 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1811 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1812 | %11 = OpLoad %7 %5 |
| 1813 | %12 = OpLoad %3 %1 |
| 1814 | %14 = OpSampledImage %13 %12 %11 |
| 1815 | %18 = OpConvertSToF %4 %20 |
| 1816 | %21 = OpCompositeConstruct %10 %15 %16 %17 %18 |
| 1817 | %9 = OpImageSampleImplicitLod %10 %14 %21 |
| 1818 | %8 = OpCompositeExtract %4 %9 0 |
| 1819 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1820 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1821 | OpCapability SampledCubeArray |
| 1822 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1823 | case ValidTextureOverload::kSampleBias2dF32: |
| 1824 | return { |
| 1825 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1826 | %4 = OpTypeFloat 32 |
| 1827 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
| 1828 | %2 = OpTypePointer UniformConstant %3 |
| 1829 | %1 = OpVariable %2 UniformConstant |
| 1830 | %7 = OpTypeSampler |
| 1831 | %6 = OpTypePointer UniformConstant %7 |
| 1832 | %5 = OpVariable %6 UniformConstant |
| 1833 | %9 = OpTypeVector %4 4 |
| 1834 | %12 = OpTypeSampledImage %3 |
| 1835 | %14 = OpTypeVector %4 2 |
| 1836 | %15 = OpConstant %4 1 |
| 1837 | %16 = OpConstant %4 2 |
| 1838 | %17 = OpConstantComposite %14 %15 %16 |
| 1839 | %18 = OpConstant %4 3 |
| 1840 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1841 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1842 | %10 = OpLoad %7 %5 |
| 1843 | %11 = OpLoad %3 %1 |
| 1844 | %13 = OpSampledImage %12 %11 %10 |
| 1845 | %8 = OpImageSampleImplicitLod %9 %13 %17 Bias %18 |
| 1846 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1847 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1848 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1849 | case ValidTextureOverload::kSampleBias2dOffsetF32: |
| 1850 | return { |
| 1851 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1852 | %4 = OpTypeFloat 32 |
| 1853 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
| 1854 | %2 = OpTypePointer UniformConstant %3 |
| 1855 | %1 = OpVariable %2 UniformConstant |
| 1856 | %7 = OpTypeSampler |
| 1857 | %6 = OpTypePointer UniformConstant %7 |
| 1858 | %5 = OpVariable %6 UniformConstant |
| 1859 | %9 = OpTypeVector %4 4 |
| 1860 | %12 = OpTypeSampledImage %3 |
| 1861 | %14 = OpTypeVector %4 2 |
| 1862 | %15 = OpConstant %4 1 |
| 1863 | %16 = OpConstant %4 2 |
| 1864 | %17 = OpConstantComposite %14 %15 %16 |
| 1865 | %18 = OpConstant %4 3 |
| 1866 | %20 = OpTypeInt 32 1 |
| 1867 | %19 = OpTypeVector %20 2 |
| 1868 | %21 = OpConstant %20 4 |
| 1869 | %22 = OpConstant %20 5 |
| 1870 | %23 = OpConstantComposite %19 %21 %22 |
| 1871 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1872 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1873 | %10 = OpLoad %7 %5 |
| 1874 | %11 = OpLoad %3 %1 |
| 1875 | %13 = OpSampledImage %12 %11 %10 |
| 1876 | %8 = OpImageSampleImplicitLod %9 %13 %17 Bias|ConstOffset %18 %23 |
| 1877 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1878 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1879 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1880 | case ValidTextureOverload::kSampleBias2dArrayF32: |
| 1881 | return { |
| 1882 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1883 | %4 = OpTypeFloat 32 |
| 1884 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
| 1885 | %2 = OpTypePointer UniformConstant %3 |
| 1886 | %1 = OpVariable %2 UniformConstant |
| 1887 | %7 = OpTypeSampler |
| 1888 | %6 = OpTypePointer UniformConstant %7 |
| 1889 | %5 = OpVariable %6 UniformConstant |
| 1890 | %9 = OpTypeVector %4 4 |
| 1891 | %12 = OpTypeSampledImage %3 |
| 1892 | %14 = OpTypeVector %4 3 |
| 1893 | %15 = OpConstant %4 1 |
| 1894 | %16 = OpConstant %4 2 |
| 1895 | %18 = OpTypeInt 32 1 |
| 1896 | %19 = OpConstant %18 4 |
| 1897 | %21 = OpConstant %4 3 |
| 1898 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1899 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1900 | %10 = OpLoad %7 %5 |
| 1901 | %11 = OpLoad %3 %1 |
| 1902 | %13 = OpSampledImage %12 %11 %10 |
| 1903 | %17 = OpConvertSToF %4 %19 |
| 1904 | %20 = OpCompositeConstruct %14 %15 %16 %17 |
| 1905 | %8 = OpImageSampleImplicitLod %9 %13 %20 Bias %21 |
| 1906 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1907 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1908 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1909 | case ValidTextureOverload::kSampleBias2dArrayOffsetF32: |
| 1910 | return { |
| 1911 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1912 | %4 = OpTypeFloat 32 |
| 1913 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
| 1914 | %2 = OpTypePointer UniformConstant %3 |
| 1915 | %1 = OpVariable %2 UniformConstant |
| 1916 | %7 = OpTypeSampler |
| 1917 | %6 = OpTypePointer UniformConstant %7 |
| 1918 | %5 = OpVariable %6 UniformConstant |
| 1919 | %9 = OpTypeVector %4 4 |
| 1920 | %12 = OpTypeSampledImage %3 |
| 1921 | %14 = OpTypeVector %4 3 |
| 1922 | %15 = OpConstant %4 1 |
| 1923 | %16 = OpConstant %4 2 |
| 1924 | %18 = OpTypeInt 32 1 |
| 1925 | %19 = OpConstant %18 3 |
| 1926 | %21 = OpConstant %4 4 |
| 1927 | %22 = OpTypeVector %18 2 |
| 1928 | %23 = OpConstant %18 5 |
| 1929 | %24 = OpConstant %18 6 |
| 1930 | %25 = OpConstantComposite %22 %23 %24 |
| 1931 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1932 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1933 | %10 = OpLoad %7 %5 |
| 1934 | %11 = OpLoad %3 %1 |
| 1935 | %13 = OpSampledImage %12 %11 %10 |
| 1936 | %17 = OpConvertSToF %4 %19 |
| 1937 | %20 = OpCompositeConstruct %14 %15 %16 %17 |
| 1938 | %8 = OpImageSampleImplicitLod %9 %13 %20 Bias|ConstOffset %21 %25 |
| 1939 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1940 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1941 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1942 | case ValidTextureOverload::kSampleBias3dF32: |
| 1943 | return { |
| 1944 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1945 | %4 = OpTypeFloat 32 |
| 1946 | %3 = OpTypeImage %4 3D 0 0 0 1 Unknown |
| 1947 | %2 = OpTypePointer UniformConstant %3 |
| 1948 | %1 = OpVariable %2 UniformConstant |
| 1949 | %7 = OpTypeSampler |
| 1950 | %6 = OpTypePointer UniformConstant %7 |
| 1951 | %5 = OpVariable %6 UniformConstant |
| 1952 | %9 = OpTypeVector %4 4 |
| 1953 | %12 = OpTypeSampledImage %3 |
| 1954 | %14 = OpTypeVector %4 3 |
| 1955 | %15 = OpConstant %4 1 |
| 1956 | %16 = OpConstant %4 2 |
| 1957 | %17 = OpConstant %4 3 |
| 1958 | %18 = OpConstantComposite %14 %15 %16 %17 |
| 1959 | %19 = OpConstant %4 4 |
| 1960 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1961 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1962 | %10 = OpLoad %7 %5 |
| 1963 | %11 = OpLoad %3 %1 |
| 1964 | %13 = OpSampledImage %12 %11 %10 |
| 1965 | %8 = OpImageSampleImplicitLod %9 %13 %18 Bias %19 |
| 1966 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1967 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1968 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1969 | case ValidTextureOverload::kSampleBias3dOffsetF32: |
| 1970 | return { |
| 1971 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1972 | %4 = OpTypeFloat 32 |
| 1973 | %3 = OpTypeImage %4 3D 0 0 0 1 Unknown |
| 1974 | %2 = OpTypePointer UniformConstant %3 |
| 1975 | %1 = OpVariable %2 UniformConstant |
| 1976 | %7 = OpTypeSampler |
| 1977 | %6 = OpTypePointer UniformConstant %7 |
| 1978 | %5 = OpVariable %6 UniformConstant |
| 1979 | %9 = OpTypeVector %4 4 |
| 1980 | %12 = OpTypeSampledImage %3 |
| 1981 | %14 = OpTypeVector %4 3 |
| 1982 | %15 = OpConstant %4 1 |
| 1983 | %16 = OpConstant %4 2 |
| 1984 | %17 = OpConstant %4 3 |
| 1985 | %18 = OpConstantComposite %14 %15 %16 %17 |
| 1986 | %19 = OpConstant %4 4 |
| 1987 | %21 = OpTypeInt 32 1 |
| 1988 | %20 = OpTypeVector %21 3 |
| 1989 | %22 = OpConstant %21 5 |
| 1990 | %23 = OpConstant %21 6 |
| 1991 | %24 = OpConstant %21 7 |
| 1992 | %25 = OpConstantComposite %20 %22 %23 %24 |
| 1993 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 1994 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 1995 | %10 = OpLoad %7 %5 |
| 1996 | %11 = OpLoad %3 %1 |
| 1997 | %13 = OpSampledImage %12 %11 %10 |
| 1998 | %8 = OpImageSampleImplicitLod %9 %13 %18 Bias|ConstOffset %19 %25 |
| 1999 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2000 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2001 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2002 | case ValidTextureOverload::kSampleBiasCubeF32: |
| 2003 | return { |
| 2004 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2005 | %4 = OpTypeFloat 32 |
| 2006 | %3 = OpTypeImage %4 Cube 0 0 0 1 Unknown |
| 2007 | %2 = OpTypePointer UniformConstant %3 |
| 2008 | %1 = OpVariable %2 UniformConstant |
| 2009 | %7 = OpTypeSampler |
| 2010 | %6 = OpTypePointer UniformConstant %7 |
| 2011 | %5 = OpVariable %6 UniformConstant |
| 2012 | %9 = OpTypeVector %4 4 |
| 2013 | %12 = OpTypeSampledImage %3 |
| 2014 | %14 = OpTypeVector %4 3 |
| 2015 | %15 = OpConstant %4 1 |
| 2016 | %16 = OpConstant %4 2 |
| 2017 | %17 = OpConstant %4 3 |
| 2018 | %18 = OpConstantComposite %14 %15 %16 %17 |
| 2019 | %19 = OpConstant %4 4 |
| 2020 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2021 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2022 | %10 = OpLoad %7 %5 |
| 2023 | %11 = OpLoad %3 %1 |
| 2024 | %13 = OpSampledImage %12 %11 %10 |
| 2025 | %8 = OpImageSampleImplicitLod %9 %13 %18 Bias %19 |
| 2026 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2027 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2028 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2029 | case ValidTextureOverload::kSampleBiasCubeArrayF32: |
| 2030 | return { |
| 2031 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2032 | %4 = OpTypeFloat 32 |
| 2033 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
| 2034 | %2 = OpTypePointer UniformConstant %3 |
| 2035 | %1 = OpVariable %2 UniformConstant |
| 2036 | %7 = OpTypeSampler |
| 2037 | %6 = OpTypePointer UniformConstant %7 |
| 2038 | %5 = OpVariable %6 UniformConstant |
| 2039 | %9 = OpTypeVector %4 4 |
| 2040 | %12 = OpTypeSampledImage %3 |
| 2041 | %14 = OpConstant %4 1 |
| 2042 | %15 = OpConstant %4 2 |
| 2043 | %16 = OpConstant %4 3 |
| 2044 | %18 = OpTypeInt 32 1 |
| 2045 | %19 = OpConstant %18 3 |
| 2046 | %21 = OpConstant %4 4 |
| 2047 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2048 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2049 | %10 = OpLoad %7 %5 |
| 2050 | %11 = OpLoad %3 %1 |
| 2051 | %13 = OpSampledImage %12 %11 %10 |
| 2052 | %17 = OpConvertSToF %4 %19 |
| 2053 | %20 = OpCompositeConstruct %9 %14 %15 %16 %17 |
| 2054 | %8 = OpImageSampleImplicitLod %9 %13 %20 Bias %21 |
| 2055 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2056 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2057 | OpCapability SampledCubeArray |
| 2058 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2059 | case ValidTextureOverload::kSampleLevel2dF32: |
| 2060 | return { |
| 2061 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2062 | %4 = OpTypeFloat 32 |
| 2063 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
| 2064 | %2 = OpTypePointer UniformConstant %3 |
| 2065 | %1 = OpVariable %2 UniformConstant |
| 2066 | %7 = OpTypeSampler |
| 2067 | %6 = OpTypePointer UniformConstant %7 |
| 2068 | %5 = OpVariable %6 UniformConstant |
| 2069 | %9 = OpTypeVector %4 4 |
| 2070 | %12 = OpTypeSampledImage %3 |
| 2071 | %14 = OpTypeVector %4 2 |
| 2072 | %15 = OpConstant %4 1 |
| 2073 | %16 = OpConstant %4 2 |
| 2074 | %17 = OpConstantComposite %14 %15 %16 |
| 2075 | %18 = OpConstant %4 3 |
| 2076 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2077 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2078 | %10 = OpLoad %7 %5 |
| 2079 | %11 = OpLoad %3 %1 |
| 2080 | %13 = OpSampledImage %12 %11 %10 |
| 2081 | %8 = OpImageSampleExplicitLod %9 %13 %17 Lod %18 |
| 2082 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2083 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2084 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2085 | case ValidTextureOverload::kSampleLevel2dOffsetF32: |
| 2086 | return { |
| 2087 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2088 | %4 = OpTypeFloat 32 |
| 2089 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
| 2090 | %2 = OpTypePointer UniformConstant %3 |
| 2091 | %1 = OpVariable %2 UniformConstant |
| 2092 | %7 = OpTypeSampler |
| 2093 | %6 = OpTypePointer UniformConstant %7 |
| 2094 | %5 = OpVariable %6 UniformConstant |
| 2095 | %9 = OpTypeVector %4 4 |
| 2096 | %12 = OpTypeSampledImage %3 |
| 2097 | %14 = OpTypeVector %4 2 |
| 2098 | %15 = OpConstant %4 1 |
| 2099 | %16 = OpConstant %4 2 |
| 2100 | %17 = OpConstantComposite %14 %15 %16 |
| 2101 | %18 = OpConstant %4 3 |
| 2102 | %20 = OpTypeInt 32 1 |
| 2103 | %19 = OpTypeVector %20 2 |
| 2104 | %21 = OpConstant %20 4 |
| 2105 | %22 = OpConstant %20 5 |
| 2106 | %23 = OpConstantComposite %19 %21 %22 |
| 2107 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2108 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2109 | %10 = OpLoad %7 %5 |
| 2110 | %11 = OpLoad %3 %1 |
| 2111 | %13 = OpSampledImage %12 %11 %10 |
| 2112 | %8 = OpImageSampleExplicitLod %9 %13 %17 Lod|ConstOffset %18 %23 |
| 2113 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2114 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2115 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2116 | case ValidTextureOverload::kSampleLevel2dArrayF32: |
| 2117 | return { |
| 2118 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2119 | %4 = OpTypeFloat 32 |
| 2120 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
| 2121 | %2 = OpTypePointer UniformConstant %3 |
| 2122 | %1 = OpVariable %2 UniformConstant |
| 2123 | %7 = OpTypeSampler |
| 2124 | %6 = OpTypePointer UniformConstant %7 |
| 2125 | %5 = OpVariable %6 UniformConstant |
| 2126 | %9 = OpTypeVector %4 4 |
| 2127 | %12 = OpTypeSampledImage %3 |
| 2128 | %14 = OpTypeVector %4 3 |
| 2129 | %15 = OpConstant %4 1 |
| 2130 | %16 = OpConstant %4 2 |
| 2131 | %18 = OpTypeInt 32 1 |
| 2132 | %19 = OpConstant %18 3 |
| 2133 | %21 = OpConstant %4 4 |
| 2134 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2135 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2136 | %10 = OpLoad %7 %5 |
| 2137 | %11 = OpLoad %3 %1 |
| 2138 | %13 = OpSampledImage %12 %11 %10 |
| 2139 | %17 = OpConvertSToF %4 %19 |
| 2140 | %20 = OpCompositeConstruct %14 %15 %16 %17 |
| 2141 | %8 = OpImageSampleExplicitLod %9 %13 %20 Lod %21 |
| 2142 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2143 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2144 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2145 | case ValidTextureOverload::kSampleLevel2dArrayOffsetF32: |
| 2146 | return { |
| 2147 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2148 | %4 = OpTypeFloat 32 |
| 2149 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
| 2150 | %2 = OpTypePointer UniformConstant %3 |
| 2151 | %1 = OpVariable %2 UniformConstant |
| 2152 | %7 = OpTypeSampler |
| 2153 | %6 = OpTypePointer UniformConstant %7 |
| 2154 | %5 = OpVariable %6 UniformConstant |
| 2155 | %9 = OpTypeVector %4 4 |
| 2156 | %12 = OpTypeSampledImage %3 |
| 2157 | %14 = OpTypeVector %4 3 |
| 2158 | %15 = OpConstant %4 1 |
| 2159 | %16 = OpConstant %4 2 |
| 2160 | %18 = OpTypeInt 32 1 |
| 2161 | %19 = OpConstant %18 3 |
| 2162 | %21 = OpConstant %4 4 |
| 2163 | %22 = OpTypeVector %18 2 |
| 2164 | %23 = OpConstant %18 5 |
| 2165 | %24 = OpConstant %18 6 |
| 2166 | %25 = OpConstantComposite %22 %23 %24 |
| 2167 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2168 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2169 | %10 = OpLoad %7 %5 |
| 2170 | %11 = OpLoad %3 %1 |
| 2171 | %13 = OpSampledImage %12 %11 %10 |
| 2172 | %17 = OpConvertSToF %4 %19 |
| 2173 | %20 = OpCompositeConstruct %14 %15 %16 %17 |
| 2174 | %8 = OpImageSampleExplicitLod %9 %13 %20 Lod|ConstOffset %21 %25 |
| 2175 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2176 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2177 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2178 | case ValidTextureOverload::kSampleLevel3dF32: |
| 2179 | return { |
| 2180 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2181 | %4 = OpTypeFloat 32 |
| 2182 | %3 = OpTypeImage %4 3D 0 0 0 1 Unknown |
| 2183 | %2 = OpTypePointer UniformConstant %3 |
| 2184 | %1 = OpVariable %2 UniformConstant |
| 2185 | %7 = OpTypeSampler |
| 2186 | %6 = OpTypePointer UniformConstant %7 |
| 2187 | %5 = OpVariable %6 UniformConstant |
| 2188 | %9 = OpTypeVector %4 4 |
| 2189 | %12 = OpTypeSampledImage %3 |
| 2190 | %14 = OpTypeVector %4 3 |
| 2191 | %15 = OpConstant %4 1 |
| 2192 | %16 = OpConstant %4 2 |
| 2193 | %17 = OpConstant %4 3 |
| 2194 | %18 = OpConstantComposite %14 %15 %16 %17 |
| 2195 | %19 = OpConstant %4 4 |
| 2196 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2197 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2198 | %10 = OpLoad %7 %5 |
| 2199 | %11 = OpLoad %3 %1 |
| 2200 | %13 = OpSampledImage %12 %11 %10 |
| 2201 | %8 = OpImageSampleExplicitLod %9 %13 %18 Lod %19 |
| 2202 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2203 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2204 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2205 | case ValidTextureOverload::kSampleLevel3dOffsetF32: |
| 2206 | return { |
| 2207 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2208 | %4 = OpTypeFloat 32 |
| 2209 | %3 = OpTypeImage %4 3D 0 0 0 1 Unknown |
| 2210 | %2 = OpTypePointer UniformConstant %3 |
| 2211 | %1 = OpVariable %2 UniformConstant |
| 2212 | %7 = OpTypeSampler |
| 2213 | %6 = OpTypePointer UniformConstant %7 |
| 2214 | %5 = OpVariable %6 UniformConstant |
| 2215 | %9 = OpTypeVector %4 4 |
| 2216 | %12 = OpTypeSampledImage %3 |
| 2217 | %14 = OpTypeVector %4 3 |
| 2218 | %15 = OpConstant %4 1 |
| 2219 | %16 = OpConstant %4 2 |
| 2220 | %17 = OpConstant %4 3 |
| 2221 | %18 = OpConstantComposite %14 %15 %16 %17 |
| 2222 | %19 = OpConstant %4 4 |
| 2223 | %21 = OpTypeInt 32 1 |
| 2224 | %20 = OpTypeVector %21 3 |
| 2225 | %22 = OpConstant %21 5 |
| 2226 | %23 = OpConstant %21 6 |
| 2227 | %24 = OpConstant %21 7 |
| 2228 | %25 = OpConstantComposite %20 %22 %23 %24 |
| 2229 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2230 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2231 | %10 = OpLoad %7 %5 |
| 2232 | %11 = OpLoad %3 %1 |
| 2233 | %13 = OpSampledImage %12 %11 %10 |
| 2234 | %8 = OpImageSampleExplicitLod %9 %13 %18 Lod|ConstOffset %19 %25 |
| 2235 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2236 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2237 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2238 | case ValidTextureOverload::kSampleLevelCubeF32: |
| 2239 | return { |
| 2240 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2241 | %4 = OpTypeFloat 32 |
| 2242 | %3 = OpTypeImage %4 Cube 0 0 0 1 Unknown |
| 2243 | %2 = OpTypePointer UniformConstant %3 |
| 2244 | %1 = OpVariable %2 UniformConstant |
| 2245 | %7 = OpTypeSampler |
| 2246 | %6 = OpTypePointer UniformConstant %7 |
| 2247 | %5 = OpVariable %6 UniformConstant |
| 2248 | %9 = OpTypeVector %4 4 |
| 2249 | %12 = OpTypeSampledImage %3 |
| 2250 | %14 = OpTypeVector %4 3 |
| 2251 | %15 = OpConstant %4 1 |
| 2252 | %16 = OpConstant %4 2 |
| 2253 | %17 = OpConstant %4 3 |
| 2254 | %18 = OpConstantComposite %14 %15 %16 %17 |
| 2255 | %19 = OpConstant %4 4 |
| 2256 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2257 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2258 | %10 = OpLoad %7 %5 |
| 2259 | %11 = OpLoad %3 %1 |
| 2260 | %13 = OpSampledImage %12 %11 %10 |
| 2261 | %8 = OpImageSampleExplicitLod %9 %13 %18 Lod %19 |
| 2262 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2263 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2264 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2265 | case ValidTextureOverload::kSampleLevelCubeArrayF32: |
| 2266 | return { |
| 2267 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2268 | %4 = OpTypeFloat 32 |
| 2269 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
| 2270 | %2 = OpTypePointer UniformConstant %3 |
| 2271 | %1 = OpVariable %2 UniformConstant |
| 2272 | %7 = OpTypeSampler |
| 2273 | %6 = OpTypePointer UniformConstant %7 |
| 2274 | %5 = OpVariable %6 UniformConstant |
| 2275 | %9 = OpTypeVector %4 4 |
| 2276 | %12 = OpTypeSampledImage %3 |
| 2277 | %14 = OpConstant %4 1 |
| 2278 | %15 = OpConstant %4 2 |
| 2279 | %16 = OpConstant %4 3 |
| 2280 | %18 = OpTypeInt 32 1 |
| 2281 | %19 = OpConstant %18 4 |
| 2282 | %21 = OpConstant %4 5 |
| 2283 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2284 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2285 | %10 = OpLoad %7 %5 |
| 2286 | %11 = OpLoad %3 %1 |
| 2287 | %13 = OpSampledImage %12 %11 %10 |
| 2288 | %17 = OpConvertSToF %4 %19 |
| 2289 | %20 = OpCompositeConstruct %9 %14 %15 %16 %17 |
| 2290 | %8 = OpImageSampleExplicitLod %9 %13 %20 Lod %21 |
| 2291 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2292 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2293 | OpCapability SampledCubeArray |
| 2294 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2295 | case ValidTextureOverload::kSampleLevelDepth2dF32: |
| 2296 | return { |
| 2297 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2298 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 2299 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2300 | %2 = OpTypePointer UniformConstant %3 |
| 2301 | %1 = OpVariable %2 UniformConstant |
| 2302 | %7 = OpTypeSampler |
| 2303 | %6 = OpTypePointer UniformConstant %7 |
| 2304 | %5 = OpVariable %6 UniformConstant |
| 2305 | %10 = OpTypeVector %4 4 |
| 2306 | %13 = OpTypeSampledImage %3 |
| 2307 | %15 = OpTypeVector %4 2 |
| 2308 | %16 = OpConstant %4 1 |
| 2309 | %17 = OpConstant %4 2 |
| 2310 | %18 = OpConstantComposite %15 %16 %17 |
| 2311 | %20 = OpTypeInt 32 1 |
| 2312 | %21 = OpConstant %20 3 |
| 2313 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2314 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2315 | %11 = OpLoad %7 %5 |
| 2316 | %12 = OpLoad %3 %1 |
| 2317 | %14 = OpSampledImage %13 %12 %11 |
| 2318 | %19 = OpConvertSToF %4 %21 |
| 2319 | %9 = OpImageSampleExplicitLod %10 %14 %18 Lod %19 |
| 2320 | %8 = OpCompositeExtract %4 %9 0 |
| 2321 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2322 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2323 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2324 | case ValidTextureOverload::kSampleLevelDepth2dOffsetF32: |
| 2325 | return { |
| 2326 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2327 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 2328 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2329 | %2 = OpTypePointer UniformConstant %3 |
| 2330 | %1 = OpVariable %2 UniformConstant |
| 2331 | %7 = OpTypeSampler |
| 2332 | %6 = OpTypePointer UniformConstant %7 |
| 2333 | %5 = OpVariable %6 UniformConstant |
| 2334 | %10 = OpTypeVector %4 4 |
| 2335 | %13 = OpTypeSampledImage %3 |
| 2336 | %15 = OpTypeVector %4 2 |
| 2337 | %16 = OpConstant %4 1 |
| 2338 | %17 = OpConstant %4 2 |
| 2339 | %18 = OpConstantComposite %15 %16 %17 |
| 2340 | %20 = OpTypeInt 32 1 |
| 2341 | %21 = OpConstant %20 3 |
| 2342 | %22 = OpTypeVector %20 2 |
| 2343 | %23 = OpConstant %20 4 |
| 2344 | %24 = OpConstant %20 5 |
| 2345 | %25 = OpConstantComposite %22 %23 %24 |
| 2346 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2347 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2348 | %11 = OpLoad %7 %5 |
| 2349 | %12 = OpLoad %3 %1 |
| 2350 | %14 = OpSampledImage %13 %12 %11 |
| 2351 | %19 = OpConvertSToF %4 %21 |
| 2352 | %9 = OpImageSampleExplicitLod %10 %14 %18 Lod|ConstOffset %19 %25 |
| 2353 | %8 = OpCompositeExtract %4 %9 0 |
| 2354 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2355 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2356 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2357 | case ValidTextureOverload::kSampleLevelDepth2dArrayF32: |
| 2358 | return { |
| 2359 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2360 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 2361 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2362 | %2 = OpTypePointer UniformConstant %3 |
| 2363 | %1 = OpVariable %2 UniformConstant |
| 2364 | %7 = OpTypeSampler |
| 2365 | %6 = OpTypePointer UniformConstant %7 |
| 2366 | %5 = OpVariable %6 UniformConstant |
| 2367 | %10 = OpTypeVector %4 4 |
| 2368 | %13 = OpTypeSampledImage %3 |
| 2369 | %15 = OpTypeVector %4 3 |
| 2370 | %16 = OpConstant %4 1 |
| 2371 | %17 = OpConstant %4 2 |
| 2372 | %19 = OpTypeInt 32 1 |
| 2373 | %20 = OpConstant %19 3 |
| 2374 | %23 = OpConstant %19 4 |
| 2375 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2376 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2377 | %11 = OpLoad %7 %5 |
| 2378 | %12 = OpLoad %3 %1 |
| 2379 | %14 = OpSampledImage %13 %12 %11 |
| 2380 | %18 = OpConvertSToF %4 %20 |
| 2381 | %21 = OpCompositeConstruct %15 %16 %17 %18 |
| 2382 | %22 = OpConvertSToF %4 %23 |
| 2383 | %9 = OpImageSampleExplicitLod %10 %14 %21 Lod %22 |
| 2384 | %8 = OpCompositeExtract %4 %9 0 |
| 2385 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2386 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2387 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2388 | case ValidTextureOverload::kSampleLevelDepth2dArrayOffsetF32: |
| 2389 | return { |
| 2390 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2391 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 2392 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2393 | %2 = OpTypePointer UniformConstant %3 |
| 2394 | %1 = OpVariable %2 UniformConstant |
| 2395 | %7 = OpTypeSampler |
| 2396 | %6 = OpTypePointer UniformConstant %7 |
| 2397 | %5 = OpVariable %6 UniformConstant |
| 2398 | %10 = OpTypeVector %4 4 |
| 2399 | %13 = OpTypeSampledImage %3 |
| 2400 | %15 = OpTypeVector %4 3 |
| 2401 | %16 = OpConstant %4 1 |
| 2402 | %17 = OpConstant %4 2 |
| 2403 | %19 = OpTypeInt 32 1 |
| 2404 | %20 = OpConstant %19 3 |
| 2405 | %23 = OpConstant %19 4 |
| 2406 | %24 = OpTypeVector %19 2 |
| 2407 | %25 = OpConstant %19 5 |
| 2408 | %26 = OpConstant %19 6 |
| 2409 | %27 = OpConstantComposite %24 %25 %26 |
| 2410 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2411 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2412 | %11 = OpLoad %7 %5 |
| 2413 | %12 = OpLoad %3 %1 |
| 2414 | %14 = OpSampledImage %13 %12 %11 |
| 2415 | %18 = OpConvertSToF %4 %20 |
| 2416 | %21 = OpCompositeConstruct %15 %16 %17 %18 |
| 2417 | %22 = OpConvertSToF %4 %23 |
| 2418 | %9 = OpImageSampleExplicitLod %10 %14 %21 Lod|ConstOffset %22 %27 |
| 2419 | %8 = OpCompositeExtract %4 %9 0 |
| 2420 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2421 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2422 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2423 | case ValidTextureOverload::kSampleLevelDepthCubeF32: |
| 2424 | return { |
| 2425 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2426 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 2427 | %3 = OpTypeImage %4 Cube 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2428 | %2 = OpTypePointer UniformConstant %3 |
| 2429 | %1 = OpVariable %2 UniformConstant |
| 2430 | %7 = OpTypeSampler |
| 2431 | %6 = OpTypePointer UniformConstant %7 |
| 2432 | %5 = OpVariable %6 UniformConstant |
| 2433 | %10 = OpTypeVector %4 4 |
| 2434 | %13 = OpTypeSampledImage %3 |
| 2435 | %15 = OpTypeVector %4 3 |
| 2436 | %16 = OpConstant %4 1 |
| 2437 | %17 = OpConstant %4 2 |
| 2438 | %18 = OpConstant %4 3 |
| 2439 | %19 = OpConstantComposite %15 %16 %17 %18 |
| 2440 | %21 = OpTypeInt 32 1 |
| 2441 | %22 = OpConstant %21 4 |
| 2442 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2443 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2444 | %11 = OpLoad %7 %5 |
| 2445 | %12 = OpLoad %3 %1 |
| 2446 | %14 = OpSampledImage %13 %12 %11 |
| 2447 | %20 = OpConvertSToF %4 %22 |
| 2448 | %9 = OpImageSampleExplicitLod %10 %14 %19 Lod %20 |
| 2449 | %8 = OpCompositeExtract %4 %9 0 |
| 2450 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2451 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2452 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2453 | case ValidTextureOverload::kSampleLevelDepthCubeArrayF32: |
| 2454 | return { |
| 2455 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2456 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 2457 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2458 | %2 = OpTypePointer UniformConstant %3 |
| 2459 | %1 = OpVariable %2 UniformConstant |
| 2460 | %7 = OpTypeSampler |
| 2461 | %6 = OpTypePointer UniformConstant %7 |
| 2462 | %5 = OpVariable %6 UniformConstant |
| 2463 | %10 = OpTypeVector %4 4 |
| 2464 | %13 = OpTypeSampledImage %3 |
| 2465 | %15 = OpConstant %4 1 |
| 2466 | %16 = OpConstant %4 2 |
| 2467 | %17 = OpConstant %4 3 |
| 2468 | %19 = OpTypeInt 32 1 |
| 2469 | %20 = OpConstant %19 4 |
| 2470 | %23 = OpConstant %19 5 |
| 2471 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2472 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2473 | %11 = OpLoad %7 %5 |
| 2474 | %12 = OpLoad %3 %1 |
| 2475 | %14 = OpSampledImage %13 %12 %11 |
| 2476 | %18 = OpConvertSToF %4 %20 |
| 2477 | %21 = OpCompositeConstruct %10 %15 %16 %17 %18 |
| 2478 | %22 = OpConvertSToF %4 %23 |
| 2479 | %9 = OpImageSampleExplicitLod %10 %14 %21 Lod %22 |
| 2480 | %8 = OpCompositeExtract %4 %9 0 |
| 2481 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2482 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2483 | OpCapability SampledCubeArray |
| 2484 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2485 | case ValidTextureOverload::kSampleGrad2dF32: |
| 2486 | return { |
| 2487 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2488 | %4 = OpTypeFloat 32 |
| 2489 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
| 2490 | %2 = OpTypePointer UniformConstant %3 |
| 2491 | %1 = OpVariable %2 UniformConstant |
| 2492 | %7 = OpTypeSampler |
| 2493 | %6 = OpTypePointer UniformConstant %7 |
| 2494 | %5 = OpVariable %6 UniformConstant |
| 2495 | %9 = OpTypeVector %4 4 |
| 2496 | %12 = OpTypeSampledImage %3 |
| 2497 | %14 = OpTypeVector %4 2 |
| 2498 | %15 = OpConstant %4 1 |
| 2499 | %16 = OpConstant %4 2 |
| 2500 | %17 = OpConstantComposite %14 %15 %16 |
| 2501 | %18 = OpConstant %4 3 |
| 2502 | %19 = OpConstant %4 4 |
| 2503 | %20 = OpConstantComposite %14 %18 %19 |
| 2504 | %21 = OpConstant %4 5 |
| 2505 | %22 = OpConstant %4 6 |
| 2506 | %23 = OpConstantComposite %14 %21 %22 |
| 2507 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2508 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2509 | %10 = OpLoad %7 %5 |
| 2510 | %11 = OpLoad %3 %1 |
| 2511 | %13 = OpSampledImage %12 %11 %10 |
| 2512 | %8 = OpImageSampleExplicitLod %9 %13 %17 Grad %20 %23 |
| 2513 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2514 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2515 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2516 | case ValidTextureOverload::kSampleGrad2dOffsetF32: |
| 2517 | return { |
| 2518 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2519 | %4 = OpTypeFloat 32 |
| 2520 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
| 2521 | %2 = OpTypePointer UniformConstant %3 |
| 2522 | %1 = OpVariable %2 UniformConstant |
| 2523 | %7 = OpTypeSampler |
| 2524 | %6 = OpTypePointer UniformConstant %7 |
| 2525 | %5 = OpVariable %6 UniformConstant |
| 2526 | %9 = OpTypeVector %4 4 |
| 2527 | %12 = OpTypeSampledImage %3 |
| 2528 | %14 = OpTypeVector %4 2 |
| 2529 | %15 = OpConstant %4 1 |
| 2530 | %16 = OpConstant %4 2 |
| 2531 | %17 = OpConstantComposite %14 %15 %16 |
| 2532 | %18 = OpConstant %4 3 |
| 2533 | %19 = OpConstant %4 4 |
| 2534 | %20 = OpConstantComposite %14 %18 %19 |
| 2535 | %21 = OpConstant %4 5 |
| 2536 | %22 = OpConstant %4 6 |
| 2537 | %23 = OpConstantComposite %14 %21 %22 |
| 2538 | %25 = OpTypeInt 32 1 |
| 2539 | %24 = OpTypeVector %25 2 |
| 2540 | %26 = OpConstant %25 7 |
| 2541 | %27 = OpConstantComposite %24 %26 %26 |
| 2542 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2543 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2544 | %10 = OpLoad %7 %5 |
| 2545 | %11 = OpLoad %3 %1 |
| 2546 | %13 = OpSampledImage %12 %11 %10 |
| 2547 | %8 = OpImageSampleExplicitLod %9 %13 %17 Grad|ConstOffset %20 %23 %27 |
| 2548 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2549 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2550 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2551 | case ValidTextureOverload::kSampleGrad2dArrayF32: |
| 2552 | return { |
| 2553 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2554 | %4 = OpTypeFloat 32 |
| 2555 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
| 2556 | %2 = OpTypePointer UniformConstant %3 |
| 2557 | %1 = OpVariable %2 UniformConstant |
| 2558 | %7 = OpTypeSampler |
| 2559 | %6 = OpTypePointer UniformConstant %7 |
| 2560 | %5 = OpVariable %6 UniformConstant |
| 2561 | %9 = OpTypeVector %4 4 |
| 2562 | %12 = OpTypeSampledImage %3 |
| 2563 | %14 = OpTypeVector %4 3 |
| 2564 | %15 = OpConstant %4 1 |
| 2565 | %16 = OpConstant %4 2 |
| 2566 | %18 = OpTypeInt 32 1 |
| 2567 | %19 = OpConstant %18 3 |
| 2568 | %21 = OpTypeVector %4 2 |
| 2569 | %22 = OpConstant %4 4 |
| 2570 | %23 = OpConstant %4 5 |
| 2571 | %24 = OpConstantComposite %21 %22 %23 |
| 2572 | %25 = OpConstant %4 6 |
| 2573 | %26 = OpConstant %4 7 |
| 2574 | %27 = OpConstantComposite %21 %25 %26 |
| 2575 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2576 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2577 | %10 = OpLoad %7 %5 |
| 2578 | %11 = OpLoad %3 %1 |
| 2579 | %13 = OpSampledImage %12 %11 %10 |
| 2580 | %17 = OpConvertSToF %4 %19 |
| 2581 | %20 = OpCompositeConstruct %14 %15 %16 %17 |
| 2582 | %8 = OpImageSampleExplicitLod %9 %13 %20 Grad %24 %27 |
| 2583 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2584 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2585 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2586 | case ValidTextureOverload::kSampleGrad2dArrayOffsetF32: |
| 2587 | return { |
| 2588 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2589 | %4 = OpTypeFloat 32 |
| 2590 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
| 2591 | %2 = OpTypePointer UniformConstant %3 |
| 2592 | %1 = OpVariable %2 UniformConstant |
| 2593 | %7 = OpTypeSampler |
| 2594 | %6 = OpTypePointer UniformConstant %7 |
| 2595 | %5 = OpVariable %6 UniformConstant |
| 2596 | %9 = OpTypeVector %4 4 |
| 2597 | %12 = OpTypeSampledImage %3 |
| 2598 | %14 = OpTypeVector %4 3 |
| 2599 | %15 = OpConstant %4 1 |
| 2600 | %16 = OpConstant %4 2 |
| 2601 | %18 = OpTypeInt 32 1 |
| 2602 | %19 = OpConstant %18 3 |
| 2603 | %21 = OpTypeVector %4 2 |
| 2604 | %22 = OpConstant %4 4 |
| 2605 | %23 = OpConstant %4 5 |
| 2606 | %24 = OpConstantComposite %21 %22 %23 |
| 2607 | %25 = OpConstant %4 6 |
| 2608 | %26 = OpConstant %4 7 |
| 2609 | %27 = OpConstantComposite %21 %25 %26 |
| 2610 | %28 = OpTypeVector %18 2 |
| 2611 | %29 = OpConstant %18 6 |
| 2612 | %30 = OpConstant %18 7 |
| 2613 | %31 = OpConstantComposite %28 %29 %30 |
| 2614 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2615 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2616 | %10 = OpLoad %7 %5 |
| 2617 | %11 = OpLoad %3 %1 |
| 2618 | %13 = OpSampledImage %12 %11 %10 |
| 2619 | %17 = OpConvertSToF %4 %19 |
| 2620 | %20 = OpCompositeConstruct %14 %15 %16 %17 |
| 2621 | %8 = OpImageSampleExplicitLod %9 %13 %20 Grad|ConstOffset %24 %27 %31 |
| 2622 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2623 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2624 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2625 | case ValidTextureOverload::kSampleGrad3dF32: |
| 2626 | return { |
| 2627 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2628 | %4 = OpTypeFloat 32 |
| 2629 | %3 = OpTypeImage %4 3D 0 0 0 1 Unknown |
| 2630 | %2 = OpTypePointer UniformConstant %3 |
| 2631 | %1 = OpVariable %2 UniformConstant |
| 2632 | %7 = OpTypeSampler |
| 2633 | %6 = OpTypePointer UniformConstant %7 |
| 2634 | %5 = OpVariable %6 UniformConstant |
| 2635 | %9 = OpTypeVector %4 4 |
| 2636 | %12 = OpTypeSampledImage %3 |
| 2637 | %14 = OpTypeVector %4 3 |
| 2638 | %15 = OpConstant %4 1 |
| 2639 | %16 = OpConstant %4 2 |
| 2640 | %17 = OpConstant %4 3 |
| 2641 | %18 = OpConstantComposite %14 %15 %16 %17 |
| 2642 | %19 = OpConstant %4 4 |
| 2643 | %20 = OpConstant %4 5 |
| 2644 | %21 = OpConstant %4 6 |
| 2645 | %22 = OpConstantComposite %14 %19 %20 %21 |
| 2646 | %23 = OpConstant %4 7 |
| 2647 | %24 = OpConstant %4 8 |
| 2648 | %25 = OpConstant %4 9 |
| 2649 | %26 = OpConstantComposite %14 %23 %24 %25 |
| 2650 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2651 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2652 | %10 = OpLoad %7 %5 |
| 2653 | %11 = OpLoad %3 %1 |
| 2654 | %13 = OpSampledImage %12 %11 %10 |
| 2655 | %8 = OpImageSampleExplicitLod %9 %13 %18 Grad %22 %26 |
| 2656 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2657 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2658 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2659 | case ValidTextureOverload::kSampleGrad3dOffsetF32: |
| 2660 | return { |
| 2661 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2662 | %4 = OpTypeFloat 32 |
| 2663 | %3 = OpTypeImage %4 3D 0 0 0 1 Unknown |
| 2664 | %2 = OpTypePointer UniformConstant %3 |
| 2665 | %1 = OpVariable %2 UniformConstant |
| 2666 | %7 = OpTypeSampler |
| 2667 | %6 = OpTypePointer UniformConstant %7 |
| 2668 | %5 = OpVariable %6 UniformConstant |
| 2669 | %9 = OpTypeVector %4 4 |
| 2670 | %12 = OpTypeSampledImage %3 |
| 2671 | %14 = OpTypeVector %4 3 |
| 2672 | %15 = OpConstant %4 1 |
| 2673 | %16 = OpConstant %4 2 |
| 2674 | %17 = OpConstant %4 3 |
| 2675 | %18 = OpConstantComposite %14 %15 %16 %17 |
| 2676 | %19 = OpConstant %4 4 |
| 2677 | %20 = OpConstant %4 5 |
| 2678 | %21 = OpConstant %4 6 |
| 2679 | %22 = OpConstantComposite %14 %19 %20 %21 |
| 2680 | %23 = OpConstant %4 7 |
| 2681 | %24 = OpConstant %4 8 |
| 2682 | %25 = OpConstant %4 9 |
| 2683 | %26 = OpConstantComposite %14 %23 %24 %25 |
| 2684 | %28 = OpTypeInt 32 1 |
| 2685 | %27 = OpTypeVector %28 3 |
Ben Clayton | 5041480 | 2022-06-24 08:06:19 +0000 | [diff] [blame] | 2686 | %29 = OpConstantNull %28 |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2687 | %30 = OpConstant %28 1 |
| 2688 | %31 = OpConstant %28 2 |
| 2689 | %32 = OpConstantComposite %27 %29 %30 %31 |
| 2690 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2691 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2692 | %10 = OpLoad %7 %5 |
| 2693 | %11 = OpLoad %3 %1 |
| 2694 | %13 = OpSampledImage %12 %11 %10 |
| 2695 | %8 = OpImageSampleExplicitLod %9 %13 %18 Grad|ConstOffset %22 %26 %32 |
| 2696 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2697 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2698 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2699 | case ValidTextureOverload::kSampleGradCubeF32: |
| 2700 | return { |
| 2701 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2702 | %4 = OpTypeFloat 32 |
| 2703 | %3 = OpTypeImage %4 Cube 0 0 0 1 Unknown |
| 2704 | %2 = OpTypePointer UniformConstant %3 |
| 2705 | %1 = OpVariable %2 UniformConstant |
| 2706 | %7 = OpTypeSampler |
| 2707 | %6 = OpTypePointer UniformConstant %7 |
| 2708 | %5 = OpVariable %6 UniformConstant |
| 2709 | %9 = OpTypeVector %4 4 |
| 2710 | %12 = OpTypeSampledImage %3 |
| 2711 | %14 = OpTypeVector %4 3 |
| 2712 | %15 = OpConstant %4 1 |
| 2713 | %16 = OpConstant %4 2 |
| 2714 | %17 = OpConstant %4 3 |
| 2715 | %18 = OpConstantComposite %14 %15 %16 %17 |
| 2716 | %19 = OpConstant %4 4 |
| 2717 | %20 = OpConstant %4 5 |
| 2718 | %21 = OpConstant %4 6 |
| 2719 | %22 = OpConstantComposite %14 %19 %20 %21 |
| 2720 | %23 = OpConstant %4 7 |
| 2721 | %24 = OpConstant %4 8 |
| 2722 | %25 = OpConstant %4 9 |
| 2723 | %26 = OpConstantComposite %14 %23 %24 %25 |
| 2724 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2725 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2726 | %10 = OpLoad %7 %5 |
| 2727 | %11 = OpLoad %3 %1 |
| 2728 | %13 = OpSampledImage %12 %11 %10 |
| 2729 | %8 = OpImageSampleExplicitLod %9 %13 %18 Grad %22 %26 |
| 2730 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2731 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2732 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2733 | case ValidTextureOverload::kSampleGradCubeArrayF32: |
| 2734 | return { |
| 2735 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2736 | %4 = OpTypeFloat 32 |
| 2737 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
| 2738 | %2 = OpTypePointer UniformConstant %3 |
| 2739 | %1 = OpVariable %2 UniformConstant |
| 2740 | %7 = OpTypeSampler |
| 2741 | %6 = OpTypePointer UniformConstant %7 |
| 2742 | %5 = OpVariable %6 UniformConstant |
| 2743 | %9 = OpTypeVector %4 4 |
| 2744 | %12 = OpTypeSampledImage %3 |
| 2745 | %14 = OpConstant %4 1 |
| 2746 | %15 = OpConstant %4 2 |
| 2747 | %16 = OpConstant %4 3 |
| 2748 | %18 = OpTypeInt 32 1 |
| 2749 | %19 = OpConstant %18 4 |
| 2750 | %21 = OpTypeVector %4 3 |
| 2751 | %22 = OpConstant %4 5 |
| 2752 | %23 = OpConstant %4 6 |
| 2753 | %24 = OpConstant %4 7 |
| 2754 | %25 = OpConstantComposite %21 %22 %23 %24 |
| 2755 | %26 = OpConstant %4 8 |
| 2756 | %27 = OpConstant %4 9 |
| 2757 | %28 = OpConstant %4 10 |
| 2758 | %29 = OpConstantComposite %21 %26 %27 %28 |
| 2759 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2760 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2761 | %10 = OpLoad %7 %5 |
| 2762 | %11 = OpLoad %3 %1 |
| 2763 | %13 = OpSampledImage %12 %11 %10 |
| 2764 | %17 = OpConvertSToF %4 %19 |
| 2765 | %20 = OpCompositeConstruct %9 %14 %15 %16 %17 |
| 2766 | %8 = OpImageSampleExplicitLod %9 %13 %20 Grad %25 %29 |
| 2767 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2768 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2769 | OpCapability SampledCubeArray |
| 2770 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2771 | case ValidTextureOverload::kSampleCompareDepth2dF32: |
| 2772 | return { |
| 2773 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2774 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 2775 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2776 | %2 = OpTypePointer UniformConstant %3 |
| 2777 | %1 = OpVariable %2 UniformConstant |
| 2778 | %7 = OpTypeSampler |
| 2779 | %6 = OpTypePointer UniformConstant %7 |
| 2780 | %5 = OpVariable %6 UniformConstant |
| 2781 | %11 = OpTypeSampledImage %3 |
| 2782 | %13 = OpTypeVector %4 2 |
| 2783 | %14 = OpConstant %4 1 |
| 2784 | %15 = OpConstant %4 2 |
| 2785 | %16 = OpConstantComposite %13 %14 %15 |
| 2786 | %17 = OpConstant %4 3 |
| 2787 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2788 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2789 | %9 = OpLoad %7 %5 |
| 2790 | %10 = OpLoad %3 %1 |
| 2791 | %12 = OpSampledImage %11 %10 %9 |
| 2792 | %8 = OpImageSampleDrefImplicitLod %4 %12 %16 %17 |
| 2793 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2794 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2795 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2796 | case ValidTextureOverload::kSampleCompareDepth2dOffsetF32: |
| 2797 | return { |
| 2798 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2799 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 2800 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2801 | %2 = OpTypePointer UniformConstant %3 |
| 2802 | %1 = OpVariable %2 UniformConstant |
| 2803 | %7 = OpTypeSampler |
| 2804 | %6 = OpTypePointer UniformConstant %7 |
| 2805 | %5 = OpVariable %6 UniformConstant |
| 2806 | %11 = OpTypeSampledImage %3 |
| 2807 | %13 = OpTypeVector %4 2 |
| 2808 | %14 = OpConstant %4 1 |
| 2809 | %15 = OpConstant %4 2 |
| 2810 | %16 = OpConstantComposite %13 %14 %15 |
| 2811 | %17 = OpConstant %4 3 |
| 2812 | %19 = OpTypeInt 32 1 |
| 2813 | %18 = OpTypeVector %19 2 |
| 2814 | %20 = OpConstant %19 4 |
| 2815 | %21 = OpConstant %19 5 |
| 2816 | %22 = OpConstantComposite %18 %20 %21 |
| 2817 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2818 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2819 | %9 = OpLoad %7 %5 |
| 2820 | %10 = OpLoad %3 %1 |
| 2821 | %12 = OpSampledImage %11 %10 %9 |
| 2822 | %8 = OpImageSampleDrefImplicitLod %4 %12 %16 %17 ConstOffset %22 |
| 2823 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2824 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2825 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2826 | case ValidTextureOverload::kSampleCompareDepth2dArrayF32: |
| 2827 | return { |
| 2828 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2829 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 2830 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2831 | %2 = OpTypePointer UniformConstant %3 |
| 2832 | %1 = OpVariable %2 UniformConstant |
| 2833 | %7 = OpTypeSampler |
| 2834 | %6 = OpTypePointer UniformConstant %7 |
| 2835 | %5 = OpVariable %6 UniformConstant |
| 2836 | %11 = OpTypeSampledImage %3 |
| 2837 | %13 = OpTypeVector %4 3 |
| 2838 | %14 = OpConstant %4 1 |
| 2839 | %15 = OpConstant %4 2 |
| 2840 | %17 = OpTypeInt 32 1 |
| 2841 | %18 = OpConstant %17 4 |
| 2842 | %20 = OpConstant %4 3 |
| 2843 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2844 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2845 | %9 = OpLoad %7 %5 |
| 2846 | %10 = OpLoad %3 %1 |
| 2847 | %12 = OpSampledImage %11 %10 %9 |
| 2848 | %16 = OpConvertSToF %4 %18 |
| 2849 | %19 = OpCompositeConstruct %13 %14 %15 %16 |
| 2850 | %8 = OpImageSampleDrefImplicitLod %4 %12 %19 %20 |
| 2851 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2852 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2853 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2854 | case ValidTextureOverload::kSampleCompareDepth2dArrayOffsetF32: |
| 2855 | return { |
| 2856 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2857 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 2858 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2859 | %2 = OpTypePointer UniformConstant %3 |
| 2860 | %1 = OpVariable %2 UniformConstant |
| 2861 | %7 = OpTypeSampler |
| 2862 | %6 = OpTypePointer UniformConstant %7 |
| 2863 | %5 = OpVariable %6 UniformConstant |
| 2864 | %11 = OpTypeSampledImage %3 |
| 2865 | %13 = OpTypeVector %4 3 |
| 2866 | %14 = OpConstant %4 1 |
| 2867 | %15 = OpConstant %4 2 |
| 2868 | %17 = OpTypeInt 32 1 |
| 2869 | %18 = OpConstant %17 4 |
| 2870 | %20 = OpConstant %4 3 |
| 2871 | %21 = OpTypeVector %17 2 |
| 2872 | %22 = OpConstant %17 5 |
| 2873 | %23 = OpConstant %17 6 |
| 2874 | %24 = OpConstantComposite %21 %22 %23 |
| 2875 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2876 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2877 | %9 = OpLoad %7 %5 |
| 2878 | %10 = OpLoad %3 %1 |
| 2879 | %12 = OpSampledImage %11 %10 %9 |
| 2880 | %16 = OpConvertSToF %4 %18 |
| 2881 | %19 = OpCompositeConstruct %13 %14 %15 %16 |
| 2882 | %8 = OpImageSampleDrefImplicitLod %4 %12 %19 %20 ConstOffset %24 |
| 2883 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2884 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2885 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2886 | case ValidTextureOverload::kSampleCompareDepthCubeF32: |
| 2887 | return { |
| 2888 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2889 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 2890 | %3 = OpTypeImage %4 Cube 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2891 | %2 = OpTypePointer UniformConstant %3 |
| 2892 | %1 = OpVariable %2 UniformConstant |
| 2893 | %7 = OpTypeSampler |
| 2894 | %6 = OpTypePointer UniformConstant %7 |
| 2895 | %5 = OpVariable %6 UniformConstant |
| 2896 | %11 = OpTypeSampledImage %3 |
| 2897 | %13 = OpTypeVector %4 3 |
| 2898 | %14 = OpConstant %4 1 |
| 2899 | %15 = OpConstant %4 2 |
| 2900 | %16 = OpConstant %4 3 |
| 2901 | %17 = OpConstantComposite %13 %14 %15 %16 |
| 2902 | %18 = OpConstant %4 4 |
| 2903 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2904 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2905 | %9 = OpLoad %7 %5 |
| 2906 | %10 = OpLoad %3 %1 |
| 2907 | %12 = OpSampledImage %11 %10 %9 |
| 2908 | %8 = OpImageSampleDrefImplicitLod %4 %12 %17 %18 |
| 2909 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2910 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2911 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2912 | case ValidTextureOverload::kSampleCompareDepthCubeArrayF32: |
| 2913 | return { |
| 2914 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2915 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 2916 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2917 | %2 = OpTypePointer UniformConstant %3 |
| 2918 | %1 = OpVariable %2 UniformConstant |
| 2919 | %7 = OpTypeSampler |
| 2920 | %6 = OpTypePointer UniformConstant %7 |
| 2921 | %5 = OpVariable %6 UniformConstant |
| 2922 | %11 = OpTypeSampledImage %3 |
| 2923 | %13 = OpTypeVector %4 4 |
| 2924 | %14 = OpConstant %4 1 |
| 2925 | %15 = OpConstant %4 2 |
| 2926 | %16 = OpConstant %4 3 |
| 2927 | %18 = OpTypeInt 32 1 |
| 2928 | %19 = OpConstant %18 4 |
| 2929 | %21 = OpConstant %4 5 |
| 2930 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2931 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2932 | %9 = OpLoad %7 %5 |
| 2933 | %10 = OpLoad %3 %1 |
| 2934 | %12 = OpSampledImage %11 %10 %9 |
| 2935 | %17 = OpConvertSToF %4 %19 |
| 2936 | %20 = OpCompositeConstruct %13 %14 %15 %16 %17 |
| 2937 | %8 = OpImageSampleDrefImplicitLod %4 %12 %20 %21 |
| 2938 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2939 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2940 | OpCapability SampledCubeArray |
| 2941 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2942 | case ValidTextureOverload::kSampleCompareLevelDepth2dF32: |
| 2943 | return { |
| 2944 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2945 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 2946 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2947 | %2 = OpTypePointer UniformConstant %3 |
| 2948 | %1 = OpVariable %2 UniformConstant |
| 2949 | %7 = OpTypeSampler |
| 2950 | %6 = OpTypePointer UniformConstant %7 |
| 2951 | %5 = OpVariable %6 UniformConstant |
| 2952 | %11 = OpTypeSampledImage %3 |
| 2953 | %13 = OpTypeVector %4 2 |
| 2954 | %14 = OpConstant %4 1 |
| 2955 | %15 = OpConstant %4 2 |
| 2956 | %16 = OpConstantComposite %13 %14 %15 |
| 2957 | %17 = OpConstant %4 3 |
| 2958 | %18 = OpConstant %4 0 |
| 2959 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2960 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2961 | %9 = OpLoad %7 %5 |
| 2962 | %10 = OpLoad %3 %1 |
| 2963 | %12 = OpSampledImage %11 %10 %9 |
| 2964 | %8 = OpImageSampleDrefExplicitLod %4 %12 %16 %17 Lod %18 |
| 2965 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2966 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2967 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2968 | case ValidTextureOverload::kSampleCompareLevelDepth2dOffsetF32: |
| 2969 | return { |
| 2970 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2971 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 2972 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2973 | %2 = OpTypePointer UniformConstant %3 |
| 2974 | %1 = OpVariable %2 UniformConstant |
| 2975 | %7 = OpTypeSampler |
| 2976 | %6 = OpTypePointer UniformConstant %7 |
| 2977 | %5 = OpVariable %6 UniformConstant |
| 2978 | %11 = OpTypeSampledImage %3 |
| 2979 | %13 = OpTypeVector %4 2 |
| 2980 | %14 = OpConstant %4 1 |
| 2981 | %15 = OpConstant %4 2 |
| 2982 | %16 = OpConstantComposite %13 %14 %15 |
| 2983 | %17 = OpConstant %4 3 |
| 2984 | %18 = OpConstant %4 0 |
| 2985 | %20 = OpTypeInt 32 1 |
| 2986 | %19 = OpTypeVector %20 2 |
| 2987 | %21 = OpConstant %20 4 |
| 2988 | %22 = OpConstant %20 5 |
| 2989 | %23 = OpConstantComposite %19 %21 %22 |
| 2990 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2991 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2992 | %9 = OpLoad %7 %5 |
| 2993 | %10 = OpLoad %3 %1 |
| 2994 | %12 = OpSampledImage %11 %10 %9 |
| 2995 | %8 = OpImageSampleDrefExplicitLod %4 %12 %16 %17 Lod|ConstOffset %18 %23 |
| 2996 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2997 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 2998 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 2999 | case ValidTextureOverload::kSampleCompareLevelDepth2dArrayF32: |
| 3000 | return { |
| 3001 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3002 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 3003 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3004 | %2 = OpTypePointer UniformConstant %3 |
| 3005 | %1 = OpVariable %2 UniformConstant |
| 3006 | %7 = OpTypeSampler |
| 3007 | %6 = OpTypePointer UniformConstant %7 |
| 3008 | %5 = OpVariable %6 UniformConstant |
| 3009 | %11 = OpTypeSampledImage %3 |
| 3010 | %13 = OpTypeVector %4 3 |
| 3011 | %14 = OpConstant %4 1 |
| 3012 | %15 = OpConstant %4 2 |
| 3013 | %17 = OpTypeInt 32 1 |
| 3014 | %18 = OpConstant %17 4 |
| 3015 | %20 = OpConstant %4 3 |
| 3016 | %21 = OpConstant %4 0 |
| 3017 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3018 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3019 | %9 = OpLoad %7 %5 |
| 3020 | %10 = OpLoad %3 %1 |
| 3021 | %12 = OpSampledImage %11 %10 %9 |
| 3022 | %16 = OpConvertSToF %4 %18 |
| 3023 | %19 = OpCompositeConstruct %13 %14 %15 %16 |
| 3024 | %8 = OpImageSampleDrefExplicitLod %4 %12 %19 %20 Lod %21 |
| 3025 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3026 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3027 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3028 | case ValidTextureOverload::kSampleCompareLevelDepth2dArrayOffsetF32: |
| 3029 | return { |
| 3030 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3031 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 3032 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3033 | %2 = OpTypePointer UniformConstant %3 |
| 3034 | %1 = OpVariable %2 UniformConstant |
| 3035 | %7 = OpTypeSampler |
| 3036 | %6 = OpTypePointer UniformConstant %7 |
| 3037 | %5 = OpVariable %6 UniformConstant |
| 3038 | %11 = OpTypeSampledImage %3 |
| 3039 | %13 = OpTypeVector %4 3 |
| 3040 | %14 = OpConstant %4 1 |
| 3041 | %15 = OpConstant %4 2 |
| 3042 | %17 = OpTypeInt 32 1 |
| 3043 | %18 = OpConstant %17 4 |
| 3044 | %20 = OpConstant %4 3 |
| 3045 | %21 = OpConstant %4 0 |
| 3046 | %22 = OpTypeVector %17 2 |
| 3047 | %23 = OpConstant %17 5 |
| 3048 | %24 = OpConstant %17 6 |
| 3049 | %25 = OpConstantComposite %22 %23 %24 |
| 3050 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3051 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3052 | %9 = OpLoad %7 %5 |
| 3053 | %10 = OpLoad %3 %1 |
| 3054 | %12 = OpSampledImage %11 %10 %9 |
| 3055 | %16 = OpConvertSToF %4 %18 |
| 3056 | %19 = OpCompositeConstruct %13 %14 %15 %16 |
| 3057 | %8 = OpImageSampleDrefExplicitLod %4 %12 %19 %20 Lod|ConstOffset %21 %25 |
| 3058 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3059 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3060 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3061 | case ValidTextureOverload::kSampleCompareLevelDepthCubeF32: |
| 3062 | return { |
| 3063 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3064 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 3065 | %3 = OpTypeImage %4 Cube 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3066 | %2 = OpTypePointer UniformConstant %3 |
| 3067 | %1 = OpVariable %2 UniformConstant |
| 3068 | %7 = OpTypeSampler |
| 3069 | %6 = OpTypePointer UniformConstant %7 |
| 3070 | %5 = OpVariable %6 UniformConstant |
| 3071 | %11 = OpTypeSampledImage %3 |
| 3072 | %13 = OpTypeVector %4 3 |
| 3073 | %14 = OpConstant %4 1 |
| 3074 | %15 = OpConstant %4 2 |
| 3075 | %16 = OpConstant %4 3 |
| 3076 | %17 = OpConstantComposite %13 %14 %15 %16 |
| 3077 | %18 = OpConstant %4 4 |
| 3078 | %19 = OpConstant %4 0 |
| 3079 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3080 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3081 | %9 = OpLoad %7 %5 |
| 3082 | %10 = OpLoad %3 %1 |
| 3083 | %12 = OpSampledImage %11 %10 %9 |
| 3084 | %8 = OpImageSampleDrefExplicitLod %4 %12 %17 %18 Lod %19 |
| 3085 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3086 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3087 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3088 | case ValidTextureOverload::kSampleCompareLevelDepthCubeArrayF32: |
| 3089 | return { |
| 3090 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3091 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 3092 | %3 = OpTypeImage %4 Cube 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3093 | %2 = OpTypePointer UniformConstant %3 |
| 3094 | %1 = OpVariable %2 UniformConstant |
| 3095 | %7 = OpTypeSampler |
| 3096 | %6 = OpTypePointer UniformConstant %7 |
| 3097 | %5 = OpVariable %6 UniformConstant |
| 3098 | %11 = OpTypeSampledImage %3 |
| 3099 | %13 = OpTypeVector %4 4 |
| 3100 | %14 = OpConstant %4 1 |
| 3101 | %15 = OpConstant %4 2 |
| 3102 | %16 = OpConstant %4 3 |
| 3103 | %18 = OpTypeInt 32 1 |
| 3104 | %19 = OpConstant %18 4 |
| 3105 | %21 = OpConstant %4 5 |
| 3106 | %22 = OpConstant %4 0 |
| 3107 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3108 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3109 | %9 = OpLoad %7 %5 |
| 3110 | %10 = OpLoad %3 %1 |
| 3111 | %12 = OpSampledImage %11 %10 %9 |
| 3112 | %17 = OpConvertSToF %4 %19 |
| 3113 | %20 = OpCompositeConstruct %13 %14 %15 %16 %17 |
| 3114 | %8 = OpImageSampleDrefExplicitLod %4 %12 %20 %21 Lod %22 |
| 3115 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3116 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3117 | OpCapability SampledCubeArray |
| 3118 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3119 | case ValidTextureOverload::kLoad1dLevelF32: |
| 3120 | return { |
| 3121 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3122 | %4 = OpTypeFloat 32 |
| 3123 | %3 = OpTypeImage %4 1D 0 0 0 1 Unknown |
| 3124 | %2 = OpTypePointer UniformConstant %3 |
| 3125 | %1 = OpVariable %2 UniformConstant |
| 3126 | %7 = OpTypeSampler |
| 3127 | %6 = OpTypePointer UniformConstant %7 |
| 3128 | %5 = OpVariable %6 UniformConstant |
| 3129 | %9 = OpTypeVector %4 4 |
| 3130 | %11 = OpTypeInt 32 1 |
| 3131 | %12 = OpConstant %11 1 |
| 3132 | %13 = OpConstant %11 3 |
| 3133 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3134 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3135 | %10 = OpLoad %3 %1 |
| 3136 | %8 = OpImageFetch %9 %10 %12 Lod %13 |
| 3137 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3138 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3139 | OpCapability Sampled1D |
| 3140 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3141 | case ValidTextureOverload::kLoad1dLevelU32: |
| 3142 | return { |
| 3143 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3144 | %4 = OpTypeInt 32 0 |
| 3145 | %3 = OpTypeImage %4 1D 0 0 0 1 Unknown |
| 3146 | %2 = OpTypePointer UniformConstant %3 |
| 3147 | %1 = OpVariable %2 UniformConstant |
| 3148 | %7 = OpTypeSampler |
| 3149 | %6 = OpTypePointer UniformConstant %7 |
| 3150 | %5 = OpVariable %6 UniformConstant |
| 3151 | %9 = OpTypeVector %4 4 |
| 3152 | %11 = OpTypeInt 32 1 |
| 3153 | %12 = OpConstant %11 1 |
| 3154 | %13 = OpConstant %11 3 |
| 3155 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3156 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3157 | %10 = OpLoad %3 %1 |
| 3158 | %8 = OpImageFetch %9 %10 %12 Lod %13 |
| 3159 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3160 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3161 | OpCapability Sampled1D |
| 3162 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3163 | case ValidTextureOverload::kLoad1dLevelI32: |
| 3164 | return { |
| 3165 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3166 | %4 = OpTypeInt 32 1 |
| 3167 | %3 = OpTypeImage %4 1D 0 0 0 1 Unknown |
| 3168 | %2 = OpTypePointer UniformConstant %3 |
| 3169 | %1 = OpVariable %2 UniformConstant |
| 3170 | %7 = OpTypeSampler |
| 3171 | %6 = OpTypePointer UniformConstant %7 |
| 3172 | %5 = OpVariable %6 UniformConstant |
| 3173 | %9 = OpTypeVector %4 4 |
| 3174 | %11 = OpConstant %4 1 |
| 3175 | %12 = OpConstant %4 3 |
| 3176 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3177 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3178 | %10 = OpLoad %3 %1 |
| 3179 | %8 = OpImageFetch %9 %10 %11 Lod %12 |
| 3180 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3181 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3182 | OpCapability Sampled1D |
| 3183 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3184 | case ValidTextureOverload::kLoad2dLevelF32: |
| 3185 | return { |
| 3186 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3187 | %4 = OpTypeFloat 32 |
| 3188 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
| 3189 | %2 = OpTypePointer UniformConstant %3 |
| 3190 | %1 = OpVariable %2 UniformConstant |
| 3191 | %7 = OpTypeSampler |
| 3192 | %6 = OpTypePointer UniformConstant %7 |
| 3193 | %5 = OpVariable %6 UniformConstant |
| 3194 | %9 = OpTypeVector %4 4 |
| 3195 | %12 = OpTypeInt 32 1 |
| 3196 | %11 = OpTypeVector %12 2 |
| 3197 | %13 = OpConstant %12 1 |
| 3198 | %14 = OpConstant %12 2 |
| 3199 | %15 = OpConstantComposite %11 %13 %14 |
| 3200 | %16 = OpConstant %12 3 |
| 3201 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3202 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3203 | %10 = OpLoad %3 %1 |
| 3204 | %8 = OpImageFetch %9 %10 %15 Lod %16 |
| 3205 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3206 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3207 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3208 | case ValidTextureOverload::kLoad2dLevelU32: |
| 3209 | return { |
| 3210 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3211 | %4 = OpTypeInt 32 0 |
| 3212 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
| 3213 | %2 = OpTypePointer UniformConstant %3 |
| 3214 | %1 = OpVariable %2 UniformConstant |
| 3215 | %7 = OpTypeSampler |
| 3216 | %6 = OpTypePointer UniformConstant %7 |
| 3217 | %5 = OpVariable %6 UniformConstant |
| 3218 | %9 = OpTypeVector %4 4 |
| 3219 | %12 = OpTypeInt 32 1 |
| 3220 | %11 = OpTypeVector %12 2 |
| 3221 | %13 = OpConstant %12 1 |
| 3222 | %14 = OpConstant %12 2 |
| 3223 | %15 = OpConstantComposite %11 %13 %14 |
| 3224 | %16 = OpConstant %12 3 |
| 3225 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3226 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3227 | %10 = OpLoad %3 %1 |
| 3228 | %8 = OpImageFetch %9 %10 %15 Lod %16 |
| 3229 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3230 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3231 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3232 | case ValidTextureOverload::kLoad2dLevelI32: |
| 3233 | return { |
| 3234 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3235 | %4 = OpTypeInt 32 1 |
| 3236 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
| 3237 | %2 = OpTypePointer UniformConstant %3 |
| 3238 | %1 = OpVariable %2 UniformConstant |
| 3239 | %7 = OpTypeSampler |
| 3240 | %6 = OpTypePointer UniformConstant %7 |
| 3241 | %5 = OpVariable %6 UniformConstant |
| 3242 | %9 = OpTypeVector %4 4 |
| 3243 | %11 = OpTypeVector %4 2 |
| 3244 | %12 = OpConstant %4 1 |
| 3245 | %13 = OpConstant %4 2 |
| 3246 | %14 = OpConstantComposite %11 %12 %13 |
| 3247 | %15 = OpConstant %4 3 |
| 3248 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3249 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3250 | %10 = OpLoad %3 %1 |
| 3251 | %8 = OpImageFetch %9 %10 %14 Lod %15 |
| 3252 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3253 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3254 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3255 | case ValidTextureOverload::kLoad2dArrayLevelF32: |
| 3256 | return { |
| 3257 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3258 | %4 = OpTypeFloat 32 |
| 3259 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
| 3260 | %2 = OpTypePointer UniformConstant %3 |
| 3261 | %1 = OpVariable %2 UniformConstant |
| 3262 | %7 = OpTypeSampler |
| 3263 | %6 = OpTypePointer UniformConstant %7 |
| 3264 | %5 = OpVariable %6 UniformConstant |
| 3265 | %9 = OpTypeVector %4 4 |
| 3266 | %12 = OpTypeInt 32 1 |
| 3267 | %11 = OpTypeVector %12 3 |
| 3268 | %13 = OpConstant %12 1 |
| 3269 | %14 = OpConstant %12 2 |
| 3270 | %15 = OpConstant %12 3 |
| 3271 | %16 = OpConstantComposite %11 %13 %14 %15 |
| 3272 | %17 = OpConstant %12 4 |
| 3273 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3274 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3275 | %10 = OpLoad %3 %1 |
| 3276 | %8 = OpImageFetch %9 %10 %16 Lod %17 |
| 3277 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3278 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3279 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3280 | case ValidTextureOverload::kLoad2dArrayLevelU32: |
| 3281 | return { |
| 3282 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3283 | %4 = OpTypeInt 32 0 |
| 3284 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
| 3285 | %2 = OpTypePointer UniformConstant %3 |
| 3286 | %1 = OpVariable %2 UniformConstant |
| 3287 | %7 = OpTypeSampler |
| 3288 | %6 = OpTypePointer UniformConstant %7 |
| 3289 | %5 = OpVariable %6 UniformConstant |
| 3290 | %9 = OpTypeVector %4 4 |
| 3291 | %12 = OpTypeInt 32 1 |
| 3292 | %11 = OpTypeVector %12 3 |
| 3293 | %13 = OpConstant %12 1 |
| 3294 | %14 = OpConstant %12 2 |
| 3295 | %15 = OpConstant %12 3 |
| 3296 | %16 = OpConstantComposite %11 %13 %14 %15 |
| 3297 | %17 = OpConstant %12 4 |
| 3298 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3299 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3300 | %10 = OpLoad %3 %1 |
| 3301 | %8 = OpImageFetch %9 %10 %16 Lod %17 |
| 3302 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3303 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3304 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3305 | case ValidTextureOverload::kLoad2dArrayLevelI32: |
| 3306 | return { |
| 3307 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3308 | %4 = OpTypeInt 32 1 |
| 3309 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
| 3310 | %2 = OpTypePointer UniformConstant %3 |
| 3311 | %1 = OpVariable %2 UniformConstant |
| 3312 | %7 = OpTypeSampler |
| 3313 | %6 = OpTypePointer UniformConstant %7 |
| 3314 | %5 = OpVariable %6 UniformConstant |
| 3315 | %9 = OpTypeVector %4 4 |
| 3316 | %11 = OpTypeVector %4 3 |
| 3317 | %12 = OpConstant %4 1 |
| 3318 | %13 = OpConstant %4 2 |
| 3319 | %14 = OpConstant %4 3 |
| 3320 | %15 = OpConstantComposite %11 %12 %13 %14 |
| 3321 | %16 = OpConstant %4 4 |
| 3322 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3323 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3324 | %10 = OpLoad %3 %1 |
| 3325 | %8 = OpImageFetch %9 %10 %15 Lod %16 |
| 3326 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3327 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3328 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3329 | case ValidTextureOverload::kLoad3dLevelF32: |
| 3330 | return { |
| 3331 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3332 | %4 = OpTypeFloat 32 |
| 3333 | %3 = OpTypeImage %4 3D 0 0 0 1 Unknown |
| 3334 | %2 = OpTypePointer UniformConstant %3 |
| 3335 | %1 = OpVariable %2 UniformConstant |
| 3336 | %7 = OpTypeSampler |
| 3337 | %6 = OpTypePointer UniformConstant %7 |
| 3338 | %5 = OpVariable %6 UniformConstant |
| 3339 | %9 = OpTypeVector %4 4 |
| 3340 | %12 = OpTypeInt 32 1 |
| 3341 | %11 = OpTypeVector %12 3 |
| 3342 | %13 = OpConstant %12 1 |
| 3343 | %14 = OpConstant %12 2 |
| 3344 | %15 = OpConstant %12 3 |
| 3345 | %16 = OpConstantComposite %11 %13 %14 %15 |
| 3346 | %17 = OpConstant %12 4 |
| 3347 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3348 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3349 | %10 = OpLoad %3 %1 |
| 3350 | %8 = OpImageFetch %9 %10 %16 Lod %17 |
| 3351 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3352 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3353 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3354 | case ValidTextureOverload::kLoad3dLevelU32: |
| 3355 | return { |
| 3356 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3357 | %4 = OpTypeInt 32 0 |
| 3358 | %3 = OpTypeImage %4 3D 0 0 0 1 Unknown |
| 3359 | %2 = OpTypePointer UniformConstant %3 |
| 3360 | %1 = OpVariable %2 UniformConstant |
| 3361 | %7 = OpTypeSampler |
| 3362 | %6 = OpTypePointer UniformConstant %7 |
| 3363 | %5 = OpVariable %6 UniformConstant |
| 3364 | %9 = OpTypeVector %4 4 |
| 3365 | %12 = OpTypeInt 32 1 |
| 3366 | %11 = OpTypeVector %12 3 |
| 3367 | %13 = OpConstant %12 1 |
| 3368 | %14 = OpConstant %12 2 |
| 3369 | %15 = OpConstant %12 3 |
| 3370 | %16 = OpConstantComposite %11 %13 %14 %15 |
| 3371 | %17 = OpConstant %12 4 |
| 3372 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3373 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3374 | %10 = OpLoad %3 %1 |
| 3375 | %8 = OpImageFetch %9 %10 %16 Lod %17 |
| 3376 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3377 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3378 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3379 | case ValidTextureOverload::kLoad3dLevelI32: |
| 3380 | return { |
| 3381 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3382 | %4 = OpTypeInt 32 1 |
| 3383 | %3 = OpTypeImage %4 3D 0 0 0 1 Unknown |
| 3384 | %2 = OpTypePointer UniformConstant %3 |
| 3385 | %1 = OpVariable %2 UniformConstant |
| 3386 | %7 = OpTypeSampler |
| 3387 | %6 = OpTypePointer UniformConstant %7 |
| 3388 | %5 = OpVariable %6 UniformConstant |
| 3389 | %9 = OpTypeVector %4 4 |
| 3390 | %11 = OpTypeVector %4 3 |
| 3391 | %12 = OpConstant %4 1 |
| 3392 | %13 = OpConstant %4 2 |
| 3393 | %14 = OpConstant %4 3 |
| 3394 | %15 = OpConstantComposite %11 %12 %13 %14 |
| 3395 | %16 = OpConstant %4 4 |
| 3396 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3397 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3398 | %10 = OpLoad %3 %1 |
| 3399 | %8 = OpImageFetch %9 %10 %15 Lod %16 |
| 3400 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3401 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3402 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3403 | case ValidTextureOverload::kLoadMultisampled2dF32: |
| 3404 | return { |
| 3405 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3406 | %4 = OpTypeFloat 32 |
| 3407 | %3 = OpTypeImage %4 2D 0 0 1 1 Unknown |
| 3408 | %2 = OpTypePointer UniformConstant %3 |
| 3409 | %1 = OpVariable %2 UniformConstant |
| 3410 | %7 = OpTypeSampler |
| 3411 | %6 = OpTypePointer UniformConstant %7 |
| 3412 | %5 = OpVariable %6 UniformConstant |
| 3413 | %9 = OpTypeVector %4 4 |
| 3414 | %12 = OpTypeInt 32 1 |
| 3415 | %11 = OpTypeVector %12 2 |
| 3416 | %13 = OpConstant %12 1 |
| 3417 | %14 = OpConstant %12 2 |
| 3418 | %15 = OpConstantComposite %11 %13 %14 |
| 3419 | %16 = OpConstant %12 3 |
| 3420 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3421 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3422 | %10 = OpLoad %3 %1 |
| 3423 | %8 = OpImageFetch %9 %10 %15 Sample %16 |
| 3424 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3425 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3426 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3427 | case ValidTextureOverload::kLoadMultisampled2dU32: |
| 3428 | return { |
| 3429 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3430 | %4 = OpTypeInt 32 0 |
| 3431 | %3 = OpTypeImage %4 2D 0 0 1 1 Unknown |
| 3432 | %2 = OpTypePointer UniformConstant %3 |
| 3433 | %1 = OpVariable %2 UniformConstant |
| 3434 | %7 = OpTypeSampler |
| 3435 | %6 = OpTypePointer UniformConstant %7 |
| 3436 | %5 = OpVariable %6 UniformConstant |
| 3437 | %9 = OpTypeVector %4 4 |
| 3438 | %12 = OpTypeInt 32 1 |
| 3439 | %11 = OpTypeVector %12 2 |
| 3440 | %13 = OpConstant %12 1 |
| 3441 | %14 = OpConstant %12 2 |
| 3442 | %15 = OpConstantComposite %11 %13 %14 |
| 3443 | %16 = OpConstant %12 3 |
| 3444 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3445 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3446 | %10 = OpLoad %3 %1 |
| 3447 | %8 = OpImageFetch %9 %10 %15 Sample %16 |
| 3448 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3449 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3450 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3451 | case ValidTextureOverload::kLoadMultisampled2dI32: |
| 3452 | return { |
| 3453 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3454 | %4 = OpTypeInt 32 1 |
| 3455 | %3 = OpTypeImage %4 2D 0 0 1 1 Unknown |
| 3456 | %2 = OpTypePointer UniformConstant %3 |
| 3457 | %1 = OpVariable %2 UniformConstant |
| 3458 | %7 = OpTypeSampler |
| 3459 | %6 = OpTypePointer UniformConstant %7 |
| 3460 | %5 = OpVariable %6 UniformConstant |
| 3461 | %9 = OpTypeVector %4 4 |
| 3462 | %11 = OpTypeVector %4 2 |
| 3463 | %12 = OpConstant %4 1 |
| 3464 | %13 = OpConstant %4 2 |
| 3465 | %14 = OpConstantComposite %11 %12 %13 |
| 3466 | %15 = OpConstant %4 3 |
| 3467 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3468 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3469 | %10 = OpLoad %3 %1 |
| 3470 | %8 = OpImageFetch %9 %10 %14 Sample %15 |
| 3471 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3472 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3473 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3474 | case ValidTextureOverload::kLoadDepth2dLevelF32: |
| 3475 | return { |
| 3476 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3477 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 3478 | %3 = OpTypeImage %4 2D 0 0 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3479 | %2 = OpTypePointer UniformConstant %3 |
| 3480 | %1 = OpVariable %2 UniformConstant |
| 3481 | %7 = OpTypeSampler |
| 3482 | %6 = OpTypePointer UniformConstant %7 |
| 3483 | %5 = OpVariable %6 UniformConstant |
| 3484 | %10 = OpTypeVector %4 4 |
| 3485 | %13 = OpTypeInt 32 1 |
| 3486 | %12 = OpTypeVector %13 2 |
| 3487 | %14 = OpConstant %13 1 |
| 3488 | %15 = OpConstant %13 2 |
| 3489 | %16 = OpConstantComposite %12 %14 %15 |
| 3490 | %17 = OpConstant %13 3 |
| 3491 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3492 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3493 | %11 = OpLoad %3 %1 |
| 3494 | %9 = OpImageFetch %10 %11 %16 Lod %17 |
| 3495 | %8 = OpCompositeExtract %4 %9 0 |
| 3496 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3497 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3498 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3499 | case ValidTextureOverload::kLoadDepth2dArrayLevelF32: |
| 3500 | return { |
| 3501 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3502 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 3503 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3504 | %2 = OpTypePointer UniformConstant %3 |
| 3505 | %1 = OpVariable %2 UniformConstant |
| 3506 | %7 = OpTypeSampler |
| 3507 | %6 = OpTypePointer UniformConstant %7 |
| 3508 | %5 = OpVariable %6 UniformConstant |
| 3509 | %10 = OpTypeVector %4 4 |
| 3510 | %13 = OpTypeInt 32 1 |
| 3511 | %12 = OpTypeVector %13 3 |
| 3512 | %14 = OpConstant %13 1 |
| 3513 | %15 = OpConstant %13 2 |
| 3514 | %16 = OpConstant %13 3 |
| 3515 | %17 = OpConstantComposite %12 %14 %15 %16 |
| 3516 | %18 = OpConstant %13 4 |
| 3517 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3518 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3519 | %11 = OpLoad %3 %1 |
| 3520 | %9 = OpImageFetch %10 %11 %17 Lod %18 |
| 3521 | %8 = OpCompositeExtract %4 %9 0 |
| 3522 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3523 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3524 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3525 | case ValidTextureOverload::kLoadDepthMultisampled2dF32: |
| 3526 | return { |
| 3527 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3528 | %4 = OpTypeFloat 32 |
Jiawei Shao | 9d27aaa | 2022-04-08 08:33:28 +0000 | [diff] [blame] | 3529 | %3 = OpTypeImage %4 2D 0 1 0 1 Unknown |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3530 | %2 = OpTypePointer UniformConstant %3 |
| 3531 | %1 = OpVariable %2 UniformConstant |
| 3532 | %7 = OpTypeSampler |
| 3533 | %6 = OpTypePointer UniformConstant %7 |
| 3534 | %5 = OpVariable %6 UniformConstant |
| 3535 | %10 = OpTypeVector %4 4 |
| 3536 | %13 = OpTypeInt 32 1 |
| 3537 | %12 = OpTypeVector %13 3 |
| 3538 | %14 = OpConstant %13 1 |
| 3539 | %15 = OpConstant %13 2 |
| 3540 | %16 = OpConstant %13 3 |
| 3541 | %17 = OpConstantComposite %12 %14 %15 %16 |
| 3542 | %18 = OpConstant %13 4 |
| 3543 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3544 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3545 | %11 = OpLoad %3 %1 |
| 3546 | %9 = OpImageFetch %10 %11 %17 Sample %18 |
| 3547 | %8 = OpCompositeExtract %4 %9 0 |
| 3548 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3549 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3550 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3551 | case ValidTextureOverload::kStoreWO1dRgba32float: |
| 3552 | return { |
| 3553 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3554 | %4 = OpTypeFloat 32 |
| 3555 | %3 = OpTypeImage %4 1D 0 0 0 2 Rgba32f |
| 3556 | %2 = OpTypePointer UniformConstant %3 |
| 3557 | %1 = OpVariable %2 UniformConstant |
| 3558 | %7 = OpTypeSampler |
| 3559 | %6 = OpTypePointer UniformConstant %7 |
| 3560 | %5 = OpVariable %6 UniformConstant |
| 3561 | %9 = OpTypeVoid |
| 3562 | %11 = OpTypeInt 32 1 |
| 3563 | %12 = OpConstant %11 1 |
| 3564 | %13 = OpTypeVector %4 4 |
| 3565 | %14 = OpConstant %4 2 |
| 3566 | %15 = OpConstant %4 3 |
| 3567 | %16 = OpConstant %4 4 |
| 3568 | %17 = OpConstant %4 5 |
| 3569 | %18 = OpConstantComposite %13 %14 %15 %16 %17 |
| 3570 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3571 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3572 | %10 = OpLoad %3 %1 |
| 3573 | OpImageWrite %10 %12 %18 |
| 3574 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3575 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3576 | OpCapability Image1D |
| 3577 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3578 | case ValidTextureOverload::kStoreWO2dRgba32float: |
| 3579 | return { |
| 3580 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3581 | %4 = OpTypeFloat 32 |
| 3582 | %3 = OpTypeImage %4 2D 0 0 0 2 Rgba32f |
| 3583 | %2 = OpTypePointer UniformConstant %3 |
| 3584 | %1 = OpVariable %2 UniformConstant |
| 3585 | %7 = OpTypeSampler |
| 3586 | %6 = OpTypePointer UniformConstant %7 |
| 3587 | %5 = OpVariable %6 UniformConstant |
| 3588 | %9 = OpTypeVoid |
| 3589 | %12 = OpTypeInt 32 1 |
| 3590 | %11 = OpTypeVector %12 2 |
| 3591 | %13 = OpConstant %12 1 |
| 3592 | %14 = OpConstant %12 2 |
| 3593 | %15 = OpConstantComposite %11 %13 %14 |
| 3594 | %16 = OpTypeVector %4 4 |
| 3595 | %17 = OpConstant %4 3 |
| 3596 | %18 = OpConstant %4 4 |
| 3597 | %19 = OpConstant %4 5 |
| 3598 | %20 = OpConstant %4 6 |
| 3599 | %21 = OpConstantComposite %16 %17 %18 %19 %20 |
| 3600 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3601 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3602 | %10 = OpLoad %3 %1 |
| 3603 | OpImageWrite %10 %15 %21 |
| 3604 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3605 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3606 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3607 | case ValidTextureOverload::kStoreWO2dArrayRgba32float: |
| 3608 | return { |
| 3609 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3610 | %4 = OpTypeFloat 32 |
| 3611 | %3 = OpTypeImage %4 2D 0 1 0 2 Rgba32f |
| 3612 | %2 = OpTypePointer UniformConstant %3 |
| 3613 | %1 = OpVariable %2 UniformConstant |
| 3614 | %7 = OpTypeSampler |
| 3615 | %6 = OpTypePointer UniformConstant %7 |
| 3616 | %5 = OpVariable %6 UniformConstant |
| 3617 | %9 = OpTypeVoid |
| 3618 | %12 = OpTypeInt 32 1 |
| 3619 | %11 = OpTypeVector %12 3 |
| 3620 | %13 = OpConstant %12 1 |
| 3621 | %14 = OpConstant %12 2 |
| 3622 | %15 = OpConstant %12 3 |
| 3623 | %16 = OpConstantComposite %11 %13 %14 %15 |
| 3624 | %17 = OpTypeVector %4 4 |
| 3625 | %18 = OpConstant %4 4 |
| 3626 | %19 = OpConstant %4 5 |
| 3627 | %20 = OpConstant %4 6 |
| 3628 | %21 = OpConstant %4 7 |
| 3629 | %22 = OpConstantComposite %17 %18 %19 %20 %21 |
| 3630 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3631 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3632 | %10 = OpLoad %3 %1 |
| 3633 | OpImageWrite %10 %16 %22 |
| 3634 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3635 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3636 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3637 | case ValidTextureOverload::kStoreWO3dRgba32float: |
| 3638 | return { |
| 3639 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3640 | %4 = OpTypeFloat 32 |
| 3641 | %3 = OpTypeImage %4 3D 0 0 0 2 Rgba32f |
| 3642 | %2 = OpTypePointer UniformConstant %3 |
| 3643 | %1 = OpVariable %2 UniformConstant |
| 3644 | %7 = OpTypeSampler |
| 3645 | %6 = OpTypePointer UniformConstant %7 |
| 3646 | %5 = OpVariable %6 UniformConstant |
| 3647 | %9 = OpTypeVoid |
| 3648 | %12 = OpTypeInt 32 1 |
| 3649 | %11 = OpTypeVector %12 3 |
| 3650 | %13 = OpConstant %12 1 |
| 3651 | %14 = OpConstant %12 2 |
| 3652 | %15 = OpConstant %12 3 |
| 3653 | %16 = OpConstantComposite %11 %13 %14 %15 |
| 3654 | %17 = OpTypeVector %4 4 |
| 3655 | %18 = OpConstant %4 4 |
| 3656 | %19 = OpConstant %4 5 |
| 3657 | %20 = OpConstant %4 6 |
| 3658 | %21 = OpConstant %4 7 |
| 3659 | %22 = OpConstantComposite %17 %18 %19 %20 %21 |
| 3660 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3661 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3662 | %10 = OpLoad %3 %1 |
| 3663 | OpImageWrite %10 %16 %22 |
| 3664 | )", |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3665 | R"( |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3666 | )"}; |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3667 | } |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3668 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3669 | return {"<unmatched texture overload>", "<unmatched texture overload>", |
| 3670 | "<unmatched texture overload>"}; |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3671 | } // NOLINT - Ignore the length of this function |
| 3672 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3673 | using BuiltinTextureTest = TestParamHelper<ast::builtin::test::TextureOverloadCase>; |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3674 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3675 | INSTANTIATE_TEST_SUITE_P(BuiltinTextureTest, |
| 3676 | BuiltinTextureTest, |
| 3677 | testing::ValuesIn(ast::builtin::test::TextureOverloadCase::ValidCases())); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3678 | |
| 3679 | TEST_P(BuiltinTextureTest, Call) { |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3680 | auto param = GetParam(); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3681 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3682 | auto* texture = param.BuildTextureVariable(this); |
| 3683 | auto* sampler = param.BuildSamplerVariable(this); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3684 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3685 | auto* call = Call(param.function, param.args(this)); |
| 3686 | auto* stmt = CallStmt(call); |
Ben Clayton | 783b169 | 2022-08-02 17:03:35 +0000 | [diff] [blame] | 3687 | Func("func", utils::Empty, ty.void_(), utils::Vector{stmt}, |
| 3688 | utils::Vector{ |
| 3689 | Stage(ast::PipelineStage::kFragment), |
| 3690 | }); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3691 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3692 | spirv::Builder& b = Build(); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3693 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3694 | b.push_function(Function{}); |
| 3695 | ASSERT_TRUE(b.GenerateGlobalVariable(texture)) << b.error(); |
| 3696 | ASSERT_TRUE(b.GenerateGlobalVariable(sampler)) << b.error(); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3697 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3698 | EXPECT_EQ(b.GenerateExpression(call), 8u) << b.error(); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3699 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3700 | auto expected = expected_texture_overload(param.overload); |
| 3701 | EXPECT_EQ(expected.types, "\n" + DumpInstructions(b.types())); |
| 3702 | EXPECT_EQ(expected.instructions, "\n" + DumpInstructions(b.functions()[0].instructions())); |
| 3703 | EXPECT_EQ(expected.capabilities, "\n" + DumpInstructions(b.capabilities())); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3704 | } |
| 3705 | |
| 3706 | // Check the SPIRV generated passes validation |
| 3707 | TEST_P(BuiltinTextureTest, ValidateSPIRV) { |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3708 | auto param = GetParam(); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3709 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3710 | param.BuildTextureVariable(this); |
| 3711 | param.BuildSamplerVariable(this); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3712 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3713 | auto* call = Call(param.function, param.args(this)); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3714 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3715 | auto* stmt = CallStmt(call); |
Ben Clayton | 783b169 | 2022-08-02 17:03:35 +0000 | [diff] [blame] | 3716 | Func("main", utils::Empty, ty.void_(), utils::Vector{stmt}, |
| 3717 | utils::Vector{ |
| 3718 | Stage(ast::PipelineStage::kFragment), |
| 3719 | }); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3720 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3721 | spirv::Builder& b = Build(); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3722 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3723 | ASSERT_TRUE(b.Build()) << b.error(); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3724 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3725 | Validate(b); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3726 | } |
| 3727 | |
| 3728 | TEST_P(BuiltinTextureTest, OutsideFunction_IsError) { |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3729 | auto param = GetParam(); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3730 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3731 | // The point of this test is to try to generate the texture |
| 3732 | // builtin call outside a function. |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3733 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3734 | auto* texture = param.BuildTextureVariable(this); |
| 3735 | auto* sampler = param.BuildSamplerVariable(this); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3736 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3737 | auto* call = Call(param.function, param.args(this)); |
| 3738 | auto* stmt = CallStmt(call); |
Ben Clayton | 783b169 | 2022-08-02 17:03:35 +0000 | [diff] [blame] | 3739 | Func("func", utils::Empty, ty.void_(), utils::Vector{stmt}, |
| 3740 | utils::Vector{ |
| 3741 | Stage(ast::PipelineStage::kFragment), |
| 3742 | }); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3743 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3744 | spirv::Builder& b = Build(); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3745 | |
dan sinclair | 41e4d9a | 2022-05-01 14:40:55 +0000 | [diff] [blame] | 3746 | ASSERT_TRUE(b.GenerateGlobalVariable(texture)) << b.error(); |
| 3747 | ASSERT_TRUE(b.GenerateGlobalVariable(sampler)) << b.error(); |
| 3748 | EXPECT_EQ(b.GenerateExpression(call), 0u); |
| 3749 | EXPECT_THAT(b.error(), |
| 3750 | ::testing::StartsWith("Internal error: trying to add SPIR-V instruction ")); |
| 3751 | EXPECT_THAT(b.error(), ::testing::EndsWith(" outside a function")); |
Ryan Harrison | dbc13af | 2022-02-21 15:19:07 +0000 | [diff] [blame] | 3752 | } |
| 3753 | |
| 3754 | } // namespace |
dan sinclair | 411d065 | 2022-04-07 14:16:34 +0000 | [diff] [blame] | 3755 | } // namespace tint::writer::spirv |