-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 16b7940
Showing
1,294 changed files
with
587,126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
imgui.ini | ||
/nbproject | ||
/.settings | ||
core | ||
*~ | ||
*.bak | ||
*.log | ||
*.orig | ||
*.rej | ||
|
||
# Object files | ||
*.o | ||
*.ko | ||
*.obj | ||
*.elf | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Libraries | ||
*.lib | ||
*.a | ||
*.la | ||
*.lo | ||
|
||
# Shared objects (inc. Windows DLLs) | ||
*.dll | ||
*.so | ||
*.so.* | ||
*.dylib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
*.i*86 | ||
*.x86_64 | ||
*.hex | ||
|
||
# Debug files | ||
*.dSYM/ | ||
|
||
# Eclipse | ||
/.project | ||
/.cproject | ||
|
||
# VSCode | ||
/.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "lib/imguicolortextedit"] | ||
path = lib/imguicolortextedit | ||
url = https://github.com/cheako/ImGuiColorTextEdit.git | ||
[submodule "lib/whereami"] | ||
path = lib/whereami | ||
url = https://github.com/gpakosz/whereami |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/data_dynamic.o | ||
/data_dynamic.c | ||
/*_frag.spv | ||
/libdata.so | ||
/*_vert.spv | ||
/vulkan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#version 400 | ||
|
||
#extension GL_ARB_separate_shader_objects : enable | ||
#extension GL_ARB_shading_language_420pack : enable | ||
|
||
layout (location = 0) out vec4 outFragColor; | ||
|
||
void main() | ||
{ | ||
outFragColor = vec4(0.0, 0.0, 0.059, 1.0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#version 400 | ||
|
||
#extension GL_ARB_separate_shader_objects : enable | ||
#extension GL_ARB_shading_language_420pack : enable | ||
|
||
layout (location = 0) in vec3 inPos; | ||
|
||
out gl_PerVertex | ||
{ | ||
vec4 gl_Position; | ||
}; | ||
|
||
void main() { | ||
gl_Position = vec4(inPos, 1.0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Makefile for vulkan | ||
|
||
# Our single executable | ||
OBJS = vulkan | ||
|
||
all: $(OBJS) | ||
|
||
include ../misc-targets.mk | ||
|
||
DEPENDS = libdata.so | ||
vulkan: $(MYLDLIBS) $(DEPENDS) | ||
LIBDEPENDS_DYNAMIC = 0_vert.spv 0_frag.spv | ||
data_dynamic.o: $(LIBDEPENDS_DYNAMIC) data.h | ||
LIBDEPENDS = data_bulk.o data_dynamic.o | ||
libdata.so: libdata.c $(LIBDEPENDS) | ||
$(LINK.c) -shared -fPIC $(OUTPUT_OPTION) $^ | ||
|
||
clean: | ||
rm -f $(OBJS) $(DEPENDS) $(LIBDEPENDS) $(LIBDEPENDS_DYNAMIC) | ||
|
||
|
||
# valgrind discovers bugs, google it. | ||
test: clean all | ||
valgrind ./vulkan | ||
|
||
.PHONY: all clean test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#ifndef HAND_DATA_H__ | ||
#define HAND_DATA_H__ | ||
|
||
#define GLFW_INCLUDE_VULKAN | ||
#include <GLFW/glfw3.h> | ||
|
||
extern GLFWwindow *data_window; | ||
|
||
#ifdef NEWER_CGLM | ||
#define GLM_DEPTH_ZERO_TO_ONE | ||
#define GLM_FORCE_LEFT_HANDED | ||
#endif | ||
#include <cglm/cglm.h> | ||
|
||
extern const void *data_model_vertex; | ||
extern const size_t data_model_vertex_count; | ||
extern const VkDeviceSize data_model_vertex_size; | ||
|
||
extern const VkVertexInputBindingDescription data_binding_description; | ||
extern const VkVertexInputAttributeDescription data_attribute_descriptions[]; | ||
extern const uint32_t data_attribute_descriptions_count; | ||
|
||
typedef struct | ||
{ | ||
struct | ||
{ | ||
const void *spv; | ||
const size_t *size; | ||
} vert, frag; | ||
} data_material_shader_t; | ||
extern const data_material_shader_t data_material_shaders[]; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include "data.h" | ||
|
||
typedef struct | ||
{ | ||
vec3 position; | ||
} vertex_t; | ||
const vertex_t model_vertex[] = { | ||
{{0.0f, -0.5f, 0.5f}}, | ||
{{0.5f, 0.5f, 0.5f}}, | ||
{{-0.5f, 0.5f, 0.5f}}, | ||
}; | ||
const void *data_model_vertex = model_vertex; | ||
const size_t data_model_vertex_count = | ||
sizeof(model_vertex) / sizeof(vertex_t); | ||
const VkDeviceSize data_model_vertex_size = sizeof(model_vertex); | ||
const VkVertexInputBindingDescription data_binding_description = { | ||
.binding = 0, | ||
.stride = sizeof(vertex_t), | ||
.inputRate = VK_VERTEX_INPUT_RATE_VERTEX}; | ||
const VkVertexInputAttributeDescription data_attribute_descriptions[] = { | ||
{.location = 0, | ||
.binding = 0, | ||
.format = VK_FORMAT_R32G32B32_SFLOAT, | ||
.offset = offsetof(vertex_t, position)}, | ||
}; | ||
const uint32_t data_attribute_descriptions_count = | ||
sizeof(data_attribute_descriptions) / | ||
sizeof(data_attribute_descriptions[0]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include "data.h" | ||
|
||
const uint8_t material_shader_0_vert_spv[] = { | ||
syscmd(`xxd -i < 0_vert.spv')dnl | ||
}; | ||
const size_t material_shader_0_vert_size = sizeof(material_shader_0_vert_spv); | ||
const uint8_t material_shader_0_frag_spv[] = { | ||
syscmd(`xxd -i < 0_frag.spv')dnl | ||
}; | ||
const size_t material_shader_0_frag_size = sizeof(material_shader_0_frag_spv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "data.h" | ||
|
||
GLFWwindow *data_window = NULL; | ||
|
||
const uint8_t material_shader_0_vert_spv[1]; | ||
const size_t material_shader_0_vert_size; | ||
const uint8_t material_shader_0_frag_spv[1]; | ||
const size_t material_shader_0_frag_size; | ||
const data_material_shader_t data_material_shaders[] = { | ||
{{ | ||
material_shader_0_vert_spv, | ||
&material_shader_0_vert_size, | ||
}, | ||
{ | ||
material_shader_0_frag_spv, | ||
&material_shader_0_frag_size, | ||
}}, | ||
}; |
Oops, something went wrong.