Table of Contents

NervLuna: Continuing with VulkanApp restoring

Still restoring stuff that was already “sort of” working at some point (a long time ago) lol: so I continue with this VulkanApp I built in Lua with my binding system. And it seems there is still a lot to do on that path…

Fixing the enum bindings

TypeAliasDecl handling

Proper handling of class declarations

Improvements on vectors handling

Adding full custom lua functions on classes

Adding support for custom constructors for lua

Restoring luna log function connections

What's next ?

Creating our first shader

⇒ The TBuiltInResource structure is different between glslang 11.11.0 and the version provided with vulkan-sdk 1.3.224 so that would explain the shader compilation error.

Creating Shader modules

Creating the command buffers

Using lua alias and default namespace

Discovering and setting up the Lua-Language-Server for vscode

⇒ I just discovered https://github.com/sumneko/lua-language-server 🤣 My god, this will save me so much time and effort…
The actual enum values that I'm providing as just dummy values to ensure the keys will be sorted in the same order as in the actual bindings: that's definitely something I need to keep in mind to avoid mixing those integer values at some point.

Extending LLS support with constructor overloads

Adding support for specification of number of threads during build

Adding support for debug build mode

Filling the command buffers

Our first vulkan display ever

Drawing our first triangle

Changing the color of the triangle

Checking default value retriaval in NervBind

static auto _bind_addAttachment_sig2(lua_State* L) -> int {
	int luatop = lua_gettop(L);
	nvk::VulkanPipelineColorBlendStateCreateInfo* self = Luna< nvk::VulkanPipelineColorBlendStateCreateInfo >::get(L,1);
	LUNA_ASSERT(self!=nullptr);

	auto blendEnable = (uint32_t)lua_tointeger(L,2);
	auto srcColorBlendFactor = (VkBlendFactor)lua_tointeger(L,3);
	auto dstColorBlendFactor = (VkBlendFactor)lua_tointeger(L,4);
	auto colorBlendOp = (VkBlendOp)lua_tointeger(L,5);
	auto srcAlphaBlendFactor = (VkBlendFactor)lua_tointeger(L,6);
	auto dstAlphaBlendFactor = (VkBlendFactor)lua_tointeger(L,7);
	auto alphaBlendOp = (VkBlendOp)lua_tointeger(L,8);
	uint32_t colorWriteMask = luatop>=9? (uint32_t)lua_tointeger(L,9) : (uint32_t)VK_COLOR_COMPONENT_R_BIT;

	nvk::VulkanPipelineColorBlendStateCreateInfo& res = self->addAttachment(blendEnable, srcColorBlendFactor, dstColorBlendFactor, colorBlendOp, srcAlphaBlendFactor, dstAlphaBlendFactor, alphaBlendOp, colorWriteMask);
	Luna< nvk::VulkanPipelineColorBlendStateCreateInfo >::push(L, &res, false);

	return 1;
}

Actually this also fixed a lot of additional incorrectly specified default values, so this was definitely worth investigating and fixing!