Skip to content

Commit

Permalink
WIP - Implementing separate pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
kanerogers committed May 19, 2024
1 parent 33f50fb commit 6fbe138
Show file tree
Hide file tree
Showing 3 changed files with 203 additions and 212 deletions.
16 changes: 8 additions & 8 deletions crates/yakui-vulkan/shaders/main.frag
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@
#define WORKFLOW_MAIN 0
#define WORKFLOW_TEXT 1

layout (location = 0) in vec4 in_color;
layout (location = 1) in vec2 in_uv;
layout (location = 0) out vec4 out_color;
layout(location = 0) in vec4 in_color;
layout(location = 1) in vec2 in_uv;
layout(location = 0) out vec4 out_color;
layout(constant_id = 0) const int WORKFLOW = 0;

layout(set = 0, binding = 0) uniform sampler2D textures[1000];
layout(push_constant) uniform push_constants {
uint texture_id;
uint workflow;
};

void main() {
if (texture_id == NO_TEXTURE) {
out_color = in_color;
return;
}
if (workflow == WORKFLOW_TEXT) {
}

if (WORKFLOW == WORKFLOW_TEXT) {
float coverage = texture(textures[texture_id], in_uv).r;
out_color = in_color * coverage;
} else {
vec4 user_texture = texture(textures[texture_id], in_uv);
out_color = in_color * user_texture;
}
}
}
Binary file modified crates/yakui-vulkan/shaders/main.frag.spv
Binary file not shown.
Loading

0 comments on commit 6fbe138

Please sign in to comment.