mirror of
https://github.com/PancakeTAS/lsfg-vk.git
synced 2025-10-30 07:01:10 +00:00
initial round of code cleanup
This commit is contained in:
parent
071980abec
commit
92ca8827db
4 changed files with 6 additions and 4 deletions
|
|
@ -53,7 +53,7 @@ namespace {
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
int on_resource(void* data, const peparse::resource& res) { // NOLINT
|
int on_resource(void*, const peparse::resource& res) { // NOLINT
|
||||||
if (res.type != peparse::RT_RCDATA || res.buf == nullptr || res.buf->bufLen <= 0)
|
if (res.type != peparse::RT_RCDATA || res.buf == nullptr || res.buf->bufLen <= 0)
|
||||||
return 0;
|
return 0;
|
||||||
std::vector<uint8_t> resource_data(res.buf->bufLen);
|
std::vector<uint8_t> resource_data(res.buf->bufLen);
|
||||||
|
|
@ -66,7 +66,7 @@ namespace {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Extract::extractShaders() {
|
void Extract::extractShaders() {
|
||||||
if (shaderData.size() > 0)
|
if (!shaderData.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// find path to dll (absolutely beautiful code)
|
// find path to dll (absolutely beautiful code)
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ namespace {
|
||||||
return VK_ERROR_INITIALIZATION_FAILED;
|
return VK_ERROR_INITIALIZATION_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
next_vkGetDeviceProcAddr = layerDesc->u.pLayerInfo->pfnNextGetDeviceProcAddr;;
|
next_vkGetDeviceProcAddr = layerDesc->u.pLayerInfo->pfnNextGetDeviceProcAddr;
|
||||||
Log::debug("layer", "Next device proc addr: {:x}",
|
Log::debug("layer", "Next device proc addr: {:x}",
|
||||||
reinterpret_cast<uintptr_t>(next_vkGetDeviceProcAddr));
|
reinterpret_cast<uintptr_t>(next_vkGetDeviceProcAddr));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@ CommandBuffer::CommandBuffer(VkDevice device, const CommandPool& pool) {
|
||||||
if (res != VK_SUCCESS || commandBufferHandle == VK_NULL_HANDLE)
|
if (res != VK_SUCCESS || commandBufferHandle == VK_NULL_HANDLE)
|
||||||
throw LSFG::vulkan_error(res, "Unable to allocate command buffer");
|
throw LSFG::vulkan_error(res, "Unable to allocate command buffer");
|
||||||
res = Layer::ovkSetDeviceLoaderData(device, commandBufferHandle);
|
res = Layer::ovkSetDeviceLoaderData(device, commandBufferHandle);
|
||||||
|
if (res != VK_SUCCESS)
|
||||||
|
throw LSFG::vulkan_error(res, "Unable to set device loader data for command buffer");
|
||||||
|
|
||||||
// store command buffer in shared ptr
|
// store command buffer in shared ptr
|
||||||
this->state = std::make_shared<CommandBufferState>(CommandBufferState::Empty);
|
this->state = std::make_shared<CommandBufferState>(CommandBufferState::Empty);
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ std::vector<const char*> Utils::addExtensions(const char* const* extensions, siz
|
||||||
for (const auto& e : requiredExtensions) {
|
for (const auto& e : requiredExtensions) {
|
||||||
auto it = std::ranges::find_if(ext,
|
auto it = std::ranges::find_if(ext,
|
||||||
[e](const char* extName) {
|
[e](const char* extName) {
|
||||||
return std::strcmp(extName, e) == 0;
|
return std::string(extName) == std::string(e);
|
||||||
});
|
});
|
||||||
if (it == ext.end()) {
|
if (it == ext.end()) {
|
||||||
Log::debug("hooks-init", "Adding extension: {}", e);
|
Log::debug("hooks-init", "Adding extension: {}", e);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue