MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / GetSmallStorageCodeGenerator

Function GetSmallStorageCodeGenerator

test/val/val_constants_test.cpp:380–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378using SmallStorageConstants = spvtest::ValidateBase<std::string>;
379
380CodeGenerator GetSmallStorageCodeGenerator() {
381 CodeGenerator generator;
382 generator.capabilities_ = R"(
383OpCapability Shader
384OpCapability Linkage
385OpCapability UniformAndStorageBuffer16BitAccess
386OpCapability StoragePushConstant16
387OpCapability StorageInputOutput16
388OpCapability UniformAndStorageBuffer8BitAccess
389OpCapability StoragePushConstant8
390)";
391 generator.extensions_ = R"(
392OpExtension "SPV_KHR_16bit_storage"
393OpExtension "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
411TEST_P(SmallStorageConstants, SmallConstant) {
412 std::string constant = GetParam();

Callers 1

TEST_PFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected