still flickering? :(
This commit is contained in:
1 parent
19f2acc2ec
commit
268d417373
13 files changed
+412
-369
No files matched your search
@@ -5,7 +5,8 @@ layout(set = 0, binding = 0) uniform sampler2D texSamplers[];
|
||||
|
||||
layout(location = 0) in vec2 uv;
|
||||
layout(location = 1) in vec4 color;
|
||||
layout(location = 2) in flat uint tex_id;
|
||||
layout(location = 2) in float alpha;
|
||||
layout(location = 3) in flat uint tex_id;
|
||||
|
||||
layout(location = 0) out vec4 out_color;
|
||||
|
||||
|
||||
Binary file not shown.
+27
-11
@@ -1,5 +1,5 @@
|
||||
#version 460
|
||||
#extension GL_EXT_nonuniform_qualifier : require
|
||||
#extension GL_EXT_buffer_reference : require
|
||||
|
||||
struct Vertex {
|
||||
vec2 pos;
|
||||
@@ -9,20 +9,36 @@ struct Vertex {
|
||||
uint textureID;
|
||||
};
|
||||
|
||||
layout(std430, set = 0, binding = 1) readonly buffer VertexBuffer {
|
||||
Vertex vertices[];
|
||||
} vBuf;
|
||||
layout(location = 0) in vec2 inPos; // Matches VK_FORMAT_R32G32_SFLOAT
|
||||
layout(location = 1) in vec2 inTexCoord; // Matches VK_FORMAT_R32G32_SFLOAT
|
||||
layout(location = 2) in vec4 inColor; // Matches VK_FORMAT_R32G32B32A32_SFLOAT
|
||||
layout(location = 3) in float inAlpha; // Matches VK_FORMAT_R32_SFLOAT
|
||||
layout(location = 4) in uint inTextureID; // Matches VK_FORMAT_R32_UINT
|
||||
|
||||
//layout(std430, set = 0, binding = 1) readonly buffer VertexBuffer {
|
||||
// Vertex vertices[];
|
||||
//} vBuf;
|
||||
|
||||
//layout(buffer_reference, std430) readonly buffer VertexBuffer{
|
||||
// Vertex vertices[];
|
||||
//};
|
||||
|
||||
//push constants block
|
||||
//layout(push_constant) uniform constants {
|
||||
// mat4 render_matrix;
|
||||
// VertexBuffer vertexBuffer;
|
||||
//} PushConstants;
|
||||
|
||||
layout(location = 0) out vec2 uv;
|
||||
layout(location = 1) out vec4 color;
|
||||
layout(location = 2) out flat uint tex_id;
|
||||
layout(location = 2) out float alpha;
|
||||
layout(location = 3) out flat uint tex_id;
|
||||
|
||||
void main() {
|
||||
|
||||
Vertex v = vBuf.vertices[gl_VertexIndex];
|
||||
|
||||
uv = v.uv;
|
||||
color = v.color;
|
||||
tex_id = v.textureID;
|
||||
gl_Position = vec4(v.pos, 0.0, 1.0);
|
||||
uv = inTexCoord;
|
||||
color = inColor;
|
||||
alpha = inAlpha;
|
||||
tex_id = inTextureID;
|
||||
gl_Position = vec4(inPos, 0.0, 1.0);
|
||||
}
|
||||
Binary file not shown.
Reference in new issue
Block a user