| 378 | using SmallStorageConstants = spvtest::ValidateBase<std::string>; |
| 379 | |
| 380 | CodeGenerator GetSmallStorageCodeGenerator() { |
| 381 | CodeGenerator generator; |
| 382 | generator.capabilities_ = R"( |
| 383 | OpCapability Shader |
| 384 | OpCapability Linkage |
| 385 | OpCapability UniformAndStorageBuffer16BitAccess |
| 386 | OpCapability StoragePushConstant16 |
| 387 | OpCapability StorageInputOutput16 |
| 388 | OpCapability UniformAndStorageBuffer8BitAccess |
| 389 | OpCapability StoragePushConstant8 |
| 390 | )"; |
| 391 | generator.extensions_ = R"( |
| 392 | OpExtension "SPV_KHR_16bit_storage" |
| 393 | OpExtension "SPV_KHR_8bit_storage" |
| 394 | )"; |
| 395 | generator.memory_model_ = "OpMemoryModel Logical GLSL450\n"; |
| 396 | generator.types_ = R"( |
| 397 | %short = OpTypeInt 16 0 |
| 398 | %short2 = OpTypeVector %short 2 |
| 399 | %char = OpTypeInt 8 0 |
| 400 | %char2 = OpTypeVector %char 2 |
| 401 | %half = OpTypeFloat 16 |
| 402 | %half2 = OpTypeVector %half 2 |
| 403 | %int = OpTypeInt 32 0 |
| 404 | %int_0 = OpConstant %int 0 |
| 405 | %float = OpTypeFloat 32 |
| 406 | %float_0 = OpConstant %float 0 |
| 407 | )"; |
| 408 | return generator; |
| 409 | } |
| 410 | |
| 411 | TEST_P(SmallStorageConstants, SmallConstant) { |
| 412 | std::string constant = GetParam(); |