Fixed shader to header endianness
Signed-off-by: Fabian Sauter <sauter.fabian@mailbox.org>
This commit is contained in:
parent
34f9d58722
commit
a53d2b9a4e
5 changed files with 88 additions and 33 deletions
|
|
@ -6,6 +6,33 @@
|
|||
|
||||
#include "shaders/Utils.hpp"
|
||||
#include "test_op_custom_shader.hpp"
|
||||
#include "test_shader.hpp"
|
||||
|
||||
TEST(TestShaderEndianness, ShaderRawDataFromConstructor)
|
||||
{
|
||||
std::string shader(R"(
|
||||
#version 450
|
||||
|
||||
layout (local_size_x = 1) in;
|
||||
|
||||
layout(set = 0, binding = 0) buffer a { float pa[]; };
|
||||
layout(set = 0, binding = 1) buffer b { float pb[]; };
|
||||
|
||||
void main() {
|
||||
uint index = gl_GlobalInvocationID.x;
|
||||
pb[index] = pa[index];
|
||||
pa[index] = index;
|
||||
}
|
||||
)");
|
||||
|
||||
std::vector<uint32_t> spirv = compileSource(shader);
|
||||
std::vector<uint32_t> spirv2(kp::TEST_SHADER_COMP_SPV.begin(),
|
||||
kp::TEST_SHADER_COMP_SPV.end());
|
||||
EXPECT_EQ(spirv.size(), spirv2.size());
|
||||
for (size_t i = 0; i < spirv.size(); i++) {
|
||||
EXPECT_EQ(spirv[i], spirv2[i]);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(TestOpAlgoCreate, ShaderRawDataFromConstructor)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue