Compare commits

7 Commits

Author SHA1 Message Date
mo7sen a6dff30bc7 Updated .gitignore
Test Compilation / Build evk (push) Successful in 25s
2026-05-08 14:40:27 +03:00
mo7sen 9b68f070cf Ensured usage of bundled shaderc instead of the VulkanSDK one
Test Compilation / Build evk (push) Successful in 25s
2026-05-08 14:30:42 +03:00
mo7sen 9d1e0ead4b Added .editorconfig
Test Compilation / Build evk (push) Failing after 16s
2026-05-08 14:23:55 +03:00
mo7sen 95f122e93c Updated + Formatted meson.build 2026-05-08 14:23:31 +03:00
mo7sen 3a2cc0d312 Enforced usage of volk subproject
Test Compilation / Build evk (push) Successful in 31s
2026-05-08 12:45:53 +03:00
mo7sen 5f362970c1 Added missing dependency name in vma.wrap
Test Compilation / Build evk (push) Failing after 1m20s
2026-05-08 12:39:32 +03:00
mo7sen 3f4792c7f1 WIP Samples
Test Compilation / Build evk (push) Failing after 22s
2026-05-08 01:53:34 +03:00
12 changed files with 97 additions and 34 deletions
+17
View File
@@ -0,0 +1,17 @@
root = true
# All (Defaults)
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = false
trim_trailing_whitespace = true
max_line_length = 80
indent_style = space
indent_size = 2
# C
# [*.{c,h}]
# indent_style = space
# indent_size = 2
+3
View File
@@ -59,3 +59,6 @@ compile_commands.json
/subprojects/*
!/subprojects/*.wrap
!/subprojects/packagefiles
# Internal wrap that is moved here during the configure step
/subprojects/shaderc_cmake.wrap
+6 -1
View File
@@ -37,7 +37,7 @@ void evkDestroyPipelineLayout(evkDevice device, evkPipelineLayout layout)
evkPipeline evkCreateComputePipeline(evkDevice device, evkPipelineCreateInfo createInfo)
{
// return EV_INVALID(evkPipeline);
}
evkPipeline evkCreateGraphicsPipeline(evkDevice device, evkPipelineCreateInfo createInfo)
@@ -239,3 +239,8 @@ void evkCmdBindPipeline(evkCommandBuffer* cmdbuf, evkPipeline* pipeline)
cmdbuf->boundPipeline = pipeline;
vkCmdBindPipeline(cmdbuf->vk, (VkPipelineBindPoint)pipeline->type, pipeline->vk);
}
void evkCmdImageBarrier(evkCommandBuffer* cmdbuf, VkImageMemoryBarrier barrier)
{
vkCmdPipelineBarrier(cmdbuf->vk, 0, 0, 0, 0, NULL, 0, NULL, 1, &barrier);
}
+2
View File
@@ -10,3 +10,5 @@ evkPipeline evkCreatePipeline(evkDevice device, evkPipelineCreateInfo createInfo
void evkDestroyPipeline(evkPipeline pipeline);
void evkCmdBindPipeline(evkCommandBuffer* cmdbuf, evkPipeline* pipeline);
void evkCmdImageBarrier(evkCommandBuffer* cmdbuf, VkImageMemoryBarrier barrier);
+36 -18
View File
@@ -1,11 +1,15 @@
project('evk', ['c','cpp'],
project(
'evk',
['c', 'cpp'],
version: '0.1',
default_options : [
'c_std=c23',
'default_library=static',
'c_args=-fcolor-diagnostics -fansi-escape-codes',
'cpp_args=-fcolor-diagnostics -fansi-escape-codes',
])
default_options: {
'c_std': 'c23',
'default_library': 'static',
'c_args': '-fcolor-diagnostics -fansi-escape-codes',
'cpp_args': '-fcolor-diagnostics -fansi-escape-codes',
},
meson_version: '>=1.2',
)
build_config = configuration_data()
@@ -26,7 +30,9 @@ disabled_warnings = {
],
}
subproject('evol-headers')
subproject('evol-headers', default_options: {'build_tests': false})
subproject('volk')
subproject('shaderc')
evk_c_args = []
@@ -42,13 +48,13 @@ foreach w : disabled_warnings[cc.get_id()]
evk_c_args += '-Wno-' + w
endforeach
evk_incdir = [
evk_incdir = include_directories(
[
'.',
]
],
)
evk_src = [
'main.c',
'evk/evkInstance.c',
'evk/evkDevice.c',
'evk/evkAllocator.c',
@@ -65,20 +71,32 @@ evk_src = [
'evk/evkMemory.c',
]
executable(
evk_lib = library(
'evk',
evk_src,
include_directories: include_directories(evk_incdir),
include_directories: evk_incdir,
dependencies: [
dependency('evol-headers'),
dependency('vma'),
dependency('volk'),
dependency('glfw3'),
dependency('shaderc'),
dependency('spvref'),
],
c_args: evk_c_args,
)
evk_dep = declare_dependency(
link_with: evk_lib,
include_directories: evk_incdir,
dependencies: [
dependency('volk').partial_dependency(includes: true, compile_args: true),
dependency('vma').partial_dependency(includes: true),
dependency('evol-headers').partial_dependency(includes: true),
],
)
meson.override_dependency('evk', evk_dep)
if get_option('build_samples')
subdir('samples')
endif
+1 -1
View File
@@ -1 +1 @@
option('build_evh_tests', type: 'boolean', value: false, description: 'Build the evol-headers tests')
option('build_samples', type: 'boolean', value: true, description: 'Build the evk samples')
@@ -6,12 +6,12 @@
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
evstring PROJECT_NAME = evstr("evk");
evstring PROJECT_NAME = evstr("basic_triangle");
int main(void)
{
u32 width = 1024;
u32 height = 1024;
u32 width = 1280;
u32 height = 800;
evkInstance instance = evkCreateInstance((evkInstanceCreateInfo){
.applicationInfo = EV_DEFAULT(evkApplicationInfo),
@@ -74,7 +74,7 @@ int main(void)
}
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
GLFWwindow* window = glfwCreateWindow(1024,1024, "evk", NULL, NULL);
GLFWwindow* window = glfwCreateWindow(width, height, "evk", NULL, NULL);
if(!window)
{
ev_log_error("Window Creation Failed.");
@@ -109,8 +109,8 @@ int main(void)
evkShaderCompiler compiler = evkCreateShaderCompiler();
evkShader vertShader = evkInitShaderFromFile(device, compiler, "shaders/tri.vert");
evkShader fragShader = evkInitShaderFromFile(device, compiler, "shaders/tri.frag");
evkShader vertShader = evkInitShaderFromFile(device, compiler, "shaders/basic_triangle.vert");
evkShader fragShader = evkInitShaderFromFile(device, compiler, "shaders/basic_triangle.frag");
evkDestroyShaderCompiler(compiler);
@@ -246,6 +246,12 @@ int main(void)
evkBeginPrimaryCommandBuffer(&cmdbuf);
{
evkCmdImageBarrier(&cmdbuf, EV_DEFAULT(VkImageMemoryBarrier,
image = swapChain.images[swapChainImageIdx].vk,
newLayout = VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR,
subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT
));
VkDeviceSize offset = 0;
vkCmdBindVertexBuffers(cmdbuf.vk, 0, 1, &vertBuf.vk, &offset);
@@ -261,13 +267,11 @@ int main(void)
vkCmdEndRenderingKHR(cmdbuf.vk);
VkImageMemoryBarrier imageMemoryBarrier = EV_DEFAULT(VkImageMemoryBarrier,
evkCmdImageBarrier(&cmdbuf, EV_DEFAULT(VkImageMemoryBarrier,
image = swapChain.images[swapChainImageIdx].vk,
newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT
);
vkCmdPipelineBarrier(cmdbuf.vk, 0, 0, 0, 0, NULL, 0, NULL, 1, &imageMemoryBarrier);
));
}
evkEndCommandBuffer(&cmdbuf);
+10
View File
@@ -0,0 +1,10 @@
executable(
'basic_triangle',
'basic_triangle.c',
dependencies: [
dependency('evk'),
dependency('glfw3'),
],
c_args: evk_c_args,
)
+1
View File
@@ -0,0 +1 @@
subdir('basic_triangle')
+3
View File
@@ -5,3 +5,6 @@ revision = v3.3.0
depth = 1
patch_directory = vma
[provide]
dependency_names = vma