Fixing warnings
This commit is contained in:
@@ -82,7 +82,11 @@ if(WIN32)
|
|||||||
${SLANG_ROOT}/lib/slang.lib
|
${SLANG_ROOT}/lib/slang.lib
|
||||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
|
set(SLANG_ROOT ${EXTERNAL_ROOT}/vcpkg/packages/shader-slang_arm64-osx/)
|
||||||
|
set_target_properties(shader-slang PROPERTIES IMPORTED_LOCATION ${SLANG_ROOT}/bin/libslang.dylib)
|
||||||
|
install(FILES
|
||||||
|
${SLANG_ROOT}/bin/libslang.dylib
|
||||||
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||||
endif()
|
endif()
|
||||||
target_include_directories(shader-slang INTERFACE
|
target_include_directories(shader-slang INTERFACE
|
||||||
$<BUILD_INTERFACE:${SLANG_ROOT}/include/>
|
$<BUILD_INTERFACE:${SLANG_ROOT}/include/>
|
||||||
|
|||||||
@@ -16,8 +16,6 @@ DepthPrepass::DepthPrepass(Gfx::PGraphics graphics, PScene scene)
|
|||||||
: RenderPass(graphics, scene)
|
: RenderPass(graphics, scene)
|
||||||
, descriptorSets(3)
|
, descriptorSets(3)
|
||||||
{
|
{
|
||||||
UniformBufferCreateInfo uniformInitializer;
|
|
||||||
|
|
||||||
depthPrepassLayout = graphics->createPipelineLayout();
|
depthPrepassLayout = graphics->createPipelineLayout();
|
||||||
depthPrepassLayout->addDescriptorLayout(INDEX_VIEW_PARAMS, viewParamsLayout);
|
depthPrepassLayout->addDescriptorLayout(INDEX_VIEW_PARAMS, viewParamsLayout);
|
||||||
if (graphics->supportMeshShading())
|
if (graphics->supportMeshShading())
|
||||||
@@ -174,6 +172,6 @@ void DepthPrepass::createRenderPass()
|
|||||||
renderPass = graphics->createRenderPass(std::move(layout), viewport);
|
renderPass = graphics->createRenderPass(std::move(layout), viewport);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DepthPrepass::modifyRenderPassMacros(Map<const char*, const char*>& defines)
|
void DepthPrepass::modifyRenderPassMacros(Map<const char*, const char*>&)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -365,7 +365,7 @@ OStagingBuffer StagingManager::create(uint64 size, Gfx::QueueType owner)
|
|||||||
return stagingBuffer;
|
return stagingBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StagingManager::release(OStagingBuffer buffer)
|
void StagingManager::release(OStagingBuffer)
|
||||||
{
|
{
|
||||||
//freeBuffers.add(std::move(buffer));
|
//freeBuffers.add(std::move(buffer));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,10 @@ public:
|
|||||||
{
|
{
|
||||||
return allocatedMemory;
|
return allocatedMemory;
|
||||||
}
|
}
|
||||||
|
constexpr VkMemoryPropertyFlags getProperties() const
|
||||||
|
{
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
constexpr void* map()
|
constexpr void* map()
|
||||||
{
|
{
|
||||||
if (!canMap)
|
if (!canMap)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
using namespace Seele::Vulkan;
|
using namespace Seele::Vulkan;
|
||||||
|
|
||||||
VkBool32 Seele::Vulkan::debugCallback(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT, uint64_t, size_t, int32_t, const char *layerPrefix, const char *msg, void *)
|
VkBool32 Seele::Vulkan::debugCallback(VkDebugReportFlagsEXT, VkDebugReportObjectTypeEXT, uint64_t, size_t, int32_t, const char *layerPrefix, const char *msg, void *)
|
||||||
{
|
{
|
||||||
std::cerr << layerPrefix << ": " << msg << std::endl;
|
std::cerr << layerPrefix << ": " << msg << std::endl;
|
||||||
return VK_FALSE;
|
return VK_FALSE;
|
||||||
|
|||||||
@@ -135,8 +135,8 @@ PGraphicsPipeline PipelineCache::createPipeline(Gfx::LegacyPipelineCreateInfo gf
|
|||||||
.depthWriteEnable = gfxInfo.depthStencilState.depthWriteEnable,
|
.depthWriteEnable = gfxInfo.depthStencilState.depthWriteEnable,
|
||||||
.depthCompareOp = cast(gfxInfo.depthStencilState.depthCompareOp),
|
.depthCompareOp = cast(gfxInfo.depthStencilState.depthCompareOp),
|
||||||
.depthBoundsTestEnable = gfxInfo.depthStencilState.depthBoundsTestEnable,
|
.depthBoundsTestEnable = gfxInfo.depthStencilState.depthBoundsTestEnable,
|
||||||
.front = (VkStencilOp)gfxInfo.depthStencilState.front,
|
.front = {(VkStencilOp)gfxInfo.depthStencilState.front},
|
||||||
.back = (VkStencilOp)gfxInfo.depthStencilState.back,
|
.back = {(VkStencilOp)gfxInfo.depthStencilState.back},
|
||||||
.minDepthBounds = gfxInfo.depthStencilState.minDepthBounds,
|
.minDepthBounds = gfxInfo.depthStencilState.minDepthBounds,
|
||||||
.maxDepthBounds = gfxInfo.depthStencilState.maxDepthBounds,
|
.maxDepthBounds = gfxInfo.depthStencilState.maxDepthBounds,
|
||||||
};
|
};
|
||||||
@@ -307,8 +307,8 @@ PGraphicsPipeline PipelineCache::createPipeline(Gfx::MeshPipelineCreateInfo gfxI
|
|||||||
.depthWriteEnable = gfxInfo.depthStencilState.depthWriteEnable,
|
.depthWriteEnable = gfxInfo.depthStencilState.depthWriteEnable,
|
||||||
.depthCompareOp = cast(gfxInfo.depthStencilState.depthCompareOp),
|
.depthCompareOp = cast(gfxInfo.depthStencilState.depthCompareOp),
|
||||||
.depthBoundsTestEnable = gfxInfo.depthStencilState.depthBoundsTestEnable,
|
.depthBoundsTestEnable = gfxInfo.depthStencilState.depthBoundsTestEnable,
|
||||||
.front = (VkStencilOp)gfxInfo.depthStencilState.front,
|
.front = {(VkStencilOp)gfxInfo.depthStencilState.front},
|
||||||
.back = (VkStencilOp)gfxInfo.depthStencilState.back,
|
.back = {(VkStencilOp)gfxInfo.depthStencilState.back},
|
||||||
.minDepthBounds = gfxInfo.depthStencilState.minDepthBounds,
|
.minDepthBounds = gfxInfo.depthStencilState.minDepthBounds,
|
||||||
.maxDepthBounds = gfxInfo.depthStencilState.maxDepthBounds,
|
.maxDepthBounds = gfxInfo.depthStencilState.maxDepthBounds,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ public:
|
|||||||
return subpassContents;
|
return subpassContents;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
uint32 framebufferHash;
|
|
||||||
PGraphics graphics;
|
PGraphics graphics;
|
||||||
VkRenderPass renderPass;
|
VkRenderPass renderPass;
|
||||||
Array<VkClearValue> clearValues;
|
Array<VkClearValue> clearValues;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include "slang.h"
|
#include "slang.h"
|
||||||
#include "slang-com-ptr.h"
|
#include "slang-com-ptr.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include <format>
|
#include <fmt/core.h>
|
||||||
|
|
||||||
using namespace Seele;
|
using namespace Seele;
|
||||||
using namespace Seele::Vulkan;
|
using namespace Seele::Vulkan;
|
||||||
@@ -28,7 +28,7 @@ uint32 Seele::Vulkan::Shader::getShaderHash() const
|
|||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CHECK_RESULT(x) {SlangResult r = x; if(r != 0) {throw std::runtime_error(std::format("Error: {0}", r));}}
|
#define CHECK_RESULT(x) {SlangResult r = x; if(r != 0) {throw std::runtime_error(fmt::format("Error: {0}", r));}}
|
||||||
#define CHECK_DIAGNOSTICS() {if(diagnostics) {std::cout << (const char*)diagnostics->getBufferPointer() << std::endl; assert(false);}}
|
#define CHECK_DIAGNOSTICS() {if(diagnostics) {std::cout << (const char*)diagnostics->getBufferPointer() << std::endl; assert(false);}}
|
||||||
|
|
||||||
void Shader::create(const ShaderCreateInfo& createInfo)
|
void Shader::create(const ShaderCreateInfo& createInfo)
|
||||||
@@ -115,11 +115,6 @@ void Shader::create(const ShaderCreateInfo& createInfo)
|
|||||||
);
|
);
|
||||||
CHECK_DIAGNOSTICS();
|
CHECK_DIAGNOSTICS();
|
||||||
|
|
||||||
for (uint32 i = 0; i < reflection->getParameterCount(); ++i)
|
|
||||||
{
|
|
||||||
slang::VariableLayoutReflection* varLayout = reflection->getParameterByIndex(i);
|
|
||||||
//std::cout << varLayout->getName() << " in space " << varLayout->getBindingSpace() << " index " << varLayout->getBindingIndex() << std::endl;
|
|
||||||
}
|
|
||||||
VkShaderModuleCreateInfo moduleInfo =
|
VkShaderModuleCreateInfo moduleInfo =
|
||||||
{
|
{
|
||||||
.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO,
|
.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO,
|
||||||
|
|||||||
@@ -17,15 +17,23 @@ public:
|
|||||||
|
|
||||||
void create(const ShaderCreateInfo& createInfo);
|
void create(const ShaderCreateInfo& createInfo);
|
||||||
|
|
||||||
VkShaderModule getModuleHandle() const
|
constexpr VkShaderModule getModuleHandle() const
|
||||||
{
|
{
|
||||||
return module;
|
return module;
|
||||||
}
|
}
|
||||||
const char* getEntryPointName() const
|
constexpr const char* getEntryPointName() const
|
||||||
{
|
{
|
||||||
//SLang renames all entry points to main, so we dont need that
|
//SLang renames all entry points to main, so we dont need that
|
||||||
return "main";//entryPointName.c_str();
|
return "main";//entryPointName.c_str();
|
||||||
}
|
}
|
||||||
|
constexpr ShaderType getShaderType() const
|
||||||
|
{
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
constexpr VkShaderStageFlags getStage() const
|
||||||
|
{
|
||||||
|
return stage;
|
||||||
|
}
|
||||||
//Map<uint32, PDescriptorLayout> getDescriptorLayouts();
|
//Map<uint32, PDescriptorLayout> getDescriptorLayouts();
|
||||||
uint32 getShaderHash() const;
|
uint32 getShaderHash() const;
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ void KeyboardInput::update(Component::KeyboardInput& input)
|
|||||||
lastMouseY = mouseY;
|
lastMouseY = mouseY;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyboardInput::keyCallback(KeyCode code, InputAction action, KeyModifier modifier)
|
void KeyboardInput::keyCallback(KeyCode code, InputAction action, KeyModifier)
|
||||||
{
|
{
|
||||||
keys[code] = action != InputAction::RELEASE;
|
keys[code] = action != InputAction::RELEASE;
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,7 @@ void KeyboardInput::mouseCallback(double x, double y)
|
|||||||
mouseY = y;
|
mouseY = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyboardInput::mouseButtonCallback(MouseButton button, InputAction action, KeyModifier modifier)
|
void KeyboardInput::mouseButtonCallback(MouseButton button, InputAction action, KeyModifier)
|
||||||
{
|
{
|
||||||
if (button == MouseButton::MOUSE_BUTTON_1)
|
if (button == MouseButton::MOUSE_BUTTON_1)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ void GameView::render()
|
|||||||
renderGraph.render(cam);
|
renderGraph.render(cam);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameView::applyArea(URect rect)
|
void GameView::applyArea(URect)
|
||||||
{
|
{
|
||||||
renderGraph.updateViewport(viewport);
|
renderGraph.updateViewport(viewport);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user