MCPcopy Create free account
hub / github.com/KomputeProject/kompute / TEST

Function TEST

test/TestOpShadersFromStringAndFile.cpp:12–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10#include "test_shader.hpp"
11
12TEST(TestShaderEndianness, ShaderRawDataFromConstructor)
13{
14 std::string shader(R"(
15 #version 450
16
17 layout (local_size_x = 1) in;
18
19 layout(set = 0, binding = 0) buffer a { float pa[]; };
20 layout(set = 0, binding = 1) buffer b { float pb[]; };
21
22 void main() {
23 uint index = gl_GlobalInvocationID.x;
24 pb[index] = pa[index];
25 pa[index] = index;
26 }
27 )");
28
29 std::vector<uint32_t> spirv = compileSource(shader);
30 std::vector<uint32_t> spirv2(kp::TEST_SHADER_COMP_SPV.begin(),
31 kp::TEST_SHADER_COMP_SPV.end());
32 EXPECT_EQ(spirv.size(), spirv2.size());
33 for (size_t i = 0; i < spirv.size(); i++) {
34 EXPECT_EQ(spirv[i], spirv2[i]);
35 }
36}
37
38TEST(TestOpAlgoCreate, ShaderRawDataFromConstructor)
39{

Callers

nothing calls this directly

Calls 8

beginMethod · 0.80
endMethod · 0.80
sizeMethod · 0.80
tensorMethod · 0.80
sequenceMethod · 0.80
algorithmMethod · 0.80
compileSourceFunction · 0.50
vectorMethod · 0.45

Tested by

no test coverage detected