This commit is contained in:
parent
de9865b583
commit
d7a9c85ea6
11 changed files with 183 additions and 43 deletions
16
tests/ShaderDep/inner/consumer.glsl
Normal file
16
tests/ShaderDep/inner/consumer.glsl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#version 450
|
||||
#extension GL_GOOGLE_include_directive : require
|
||||
|
||||
#include "ui-shared.glsl"
|
||||
|
||||
layout(location = 0) out vec3 color;
|
||||
|
||||
void main() {
|
||||
vec2 positions[3] = vec2[](
|
||||
vec2( 0.0, -0.5),
|
||||
vec2( 0.5, 0.5),
|
||||
vec2(-0.5, 0.5)
|
||||
);
|
||||
gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
|
||||
color = ui_color();
|
||||
}
|
||||
1
tests/ShaderDep/inner/lib/asset.txt
Normal file
1
tests/ShaderDep/inner/lib/asset.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
crafter-build asset
|
||||
1
tests/ShaderDep/inner/lib/data/nested.txt
Normal file
1
tests/ShaderDep/inner/lib/data/nested.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
nested asset
|
||||
8
tests/ShaderDep/inner/lib/ui-shared.glsl
Normal file
8
tests/ShaderDep/inner/lib/ui-shared.glsl
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef UI_SHARED_GLSL
|
||||
#define UI_SHARED_GLSL
|
||||
|
||||
vec3 ui_color() {
|
||||
return vec3(0.25, 0.5, 1.0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -16,6 +16,9 @@ extern "C" Configuration CrafterBuildProject(std::span<const std::string_view>)
|
|||
ShaderLib->GetInterfacesAndImplementations(ifaces, impls);
|
||||
}
|
||||
ShaderLib->shaders.emplace_back("./lib/triangle.glsl", "main", ShaderType::Vertex);
|
||||
ShaderLib->files.emplace_back("./lib/asset.txt");
|
||||
ShaderLib->files.emplace_back("./lib/data");
|
||||
ShaderLib->buildFiles.emplace_back("./lib/ui-shared.glsl");
|
||||
|
||||
Configuration app;
|
||||
app.path = "./";
|
||||
|
|
@ -29,5 +32,6 @@ extern "C" Configuration CrafterBuildProject(std::span<const std::string_view>)
|
|||
std::array<fs::path, 1> impls = { "main" };
|
||||
app.GetInterfacesAndImplementations(ifaces, impls);
|
||||
}
|
||||
app.shaders.emplace_back("./consumer.glsl", "main", ShaderType::Vertex);
|
||||
return app;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue