initial commit
This commit is contained in:
commit
34789e806b
31 files changed
+2244
No files matched your search
@@ -0,0 +1,15 @@
|
||||
#version 460
|
||||
#extension GL_EXT_nonuniform_qualifier : require
|
||||
|
||||
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 = 0) out vec4 out_color;
|
||||
|
||||
void main() {
|
||||
// outColor = texture(texSamplers[nonuniformEXT(tex_id)], uv) * color;
|
||||
out_color = color;
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,40 @@
|
||||
#version 460
|
||||
#extension GL_EXT_nonuniform_qualifier : require
|
||||
|
||||
struct Vertex {
|
||||
vec2 pos;
|
||||
vec2 uv;
|
||||
vec4 color;
|
||||
float alpha;
|
||||
uint textureID;
|
||||
};
|
||||
|
||||
layout(set = 0, binding = 0) uniform sampler2D globalTextures[];
|
||||
|
||||
layout(std430, set = 0, binding = 1) readonly buffer VertexBuffer {
|
||||
Vertex vertices[];
|
||||
} vBuf;
|
||||
|
||||
layout(location = 0) out vec2 uv;
|
||||
layout(location = 1) out vec4 color;
|
||||
layout(location = 2) out flat uint tex_id;
|
||||
|
||||
void main() {
|
||||
|
||||
Vertex testVertices[6] = Vertex[](
|
||||
Vertex(vec2(-0.5, -0.5), vec2(0.0, 0.0), vec4(1.0, 0.0, 0.0, 1.0), 1.0, 0),
|
||||
Vertex(vec2( 0.5, -0.5), vec2(1.0, 0.0), vec4(0.0, 1.0, 0.0, 1.0), 1.0, 0),
|
||||
Vertex(vec2(-0.5, 0.5), vec2(0.0, 1.0), vec4(0.0, 0.0, 1.0, 1.0), 1.0, 0),
|
||||
|
||||
Vertex(vec2( 0.5, 0.5), vec2(1.0, 1.0), vec4(1.0, 1.0, 1.0, 1.0), 1.0, 0),
|
||||
Vertex(vec2(-0.5, 0.5), vec2(0.0, 1.0), vec4(0.0, 0.0, 1.0, 1.0), 1.0, 0),
|
||||
Vertex(vec2( 0.5, -0.5), vec2(1.0, 1.0), vec4(0.0, 1.0, 0.0, 1.0), 1.0, 0)
|
||||
);
|
||||
|
||||
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);
|
||||
}
|
||||
Binary file not shown.
Reference in new issue
Block a user