IT WORKS
This commit is contained in:
+2
-1
@@ -21,7 +21,8 @@
|
|||||||
"buildCommandArgs": "",
|
"buildCommandArgs": "",
|
||||||
"ctestCommandArgs": "",
|
"ctestCommandArgs": "",
|
||||||
"inheritEnvironments": [ "msvc_x64" ],
|
"inheritEnvironments": [ "msvc_x64" ],
|
||||||
"intelliSenseMode": "windows-msvc-x64"
|
"intelliSenseMode": "windows-msvc-x64",
|
||||||
|
"installRoot": "C:/Program Files/Seele"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
rm -rf bin/Debug/x64
|
|
||||||
mkdir bin/Debug/x64
|
|
||||||
cd bin/Debug/x64
|
|
||||||
cmake ../../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PLATFORM=x64
|
|
||||||
make
|
|
||||||
@@ -24,7 +24,7 @@ struct GraphicsInitializer
|
|||||||
: applicationName("SeeleEngine")
|
: applicationName("SeeleEngine")
|
||||||
, engineName("SeeleEngine")
|
, engineName("SeeleEngine")
|
||||||
, windowLayoutFile(nullptr)
|
, windowLayoutFile(nullptr)
|
||||||
, layers{"VK_LAYER_KHRONOS_validation", "VK_LAYER_LUNARG_monitor"}
|
, layers{"VK_LAYER_LUNARG_monitor"}
|
||||||
, instanceExtensions{}
|
, instanceExtensions{}
|
||||||
, deviceExtensions{"VK_KHR_swapchain"}
|
, deviceExtensions{"VK_KHR_swapchain"}
|
||||||
, windowHandle(nullptr)
|
, windowHandle(nullptr)
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ constexpr static uint64 NUM_DEFAULT_ELEMENTS = 1024 * 1024;
|
|||||||
|
|
||||||
void VertexData::resetMeshData()
|
void VertexData::resetMeshData()
|
||||||
{
|
{
|
||||||
|
for (auto& [_, mat] : materialData)
|
||||||
|
{
|
||||||
|
mat.material->getDescriptorLayout()->reset();
|
||||||
|
}
|
||||||
materialData.clear();
|
materialData.clear();
|
||||||
if (dirty)
|
if (dirty)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -391,6 +391,7 @@ Gfx::PDescriptorSet DescriptorPool::allocateDescriptorSet()
|
|||||||
{
|
{
|
||||||
//If it hasnt been initialized, allocate it
|
//If it hasnt been initialized, allocate it
|
||||||
VK_CHECK(vkAllocateDescriptorSets(graphics->getDevice(), &allocInfo, &cachedHandles[setIndex]->setHandle));
|
VK_CHECK(vkAllocateDescriptorSets(graphics->getDevice(), &allocInfo, &cachedHandles[setIndex]->setHandle));
|
||||||
|
std::cout << "New descriptor " << cachedHandles[setIndex]->setHandle << std::endl;
|
||||||
}
|
}
|
||||||
cachedHandles[setIndex]->allocate();
|
cachedHandles[setIndex]->allocate();
|
||||||
|
|
||||||
@@ -406,6 +407,7 @@ Gfx::PDescriptorSet DescriptorPool::allocateDescriptorSet()
|
|||||||
{
|
{
|
||||||
nextAlloc = new DescriptorPool(graphics, layout);
|
nextAlloc = new DescriptorPool(graphics, layout);
|
||||||
}
|
}
|
||||||
|
std::cout << "Out of descriptors, forwarding" << std::endl;
|
||||||
return nextAlloc->allocateDescriptorSet();
|
return nextAlloc->allocateDescriptorSet();
|
||||||
//throw std::logic_error("Out of descriptor sets");
|
//throw std::logic_error("Out of descriptor sets");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -332,11 +332,10 @@ void Graphics::initInstance(GraphicsInitializer initInfo)
|
|||||||
info.enabledExtensionCount = (uint32)extensions.size();
|
info.enabledExtensionCount = (uint32)extensions.size();
|
||||||
info.ppEnabledExtensionNames = extensions.data();
|
info.ppEnabledExtensionNames = extensions.data();
|
||||||
#if ENABLE_VALIDATION
|
#if ENABLE_VALIDATION
|
||||||
|
initInfo.layers.add("VK_LAYER_KHRONOS_validation");
|
||||||
|
#endif
|
||||||
info.enabledLayerCount = (uint32)initInfo.layers.size();
|
info.enabledLayerCount = (uint32)initInfo.layers.size();
|
||||||
info.ppEnabledLayerNames = initInfo.layers.data();
|
info.ppEnabledLayerNames = initInfo.layers.data();
|
||||||
#else
|
|
||||||
info.enabledLayerCount = 0;
|
|
||||||
#endif
|
|
||||||
VK_CHECK(vkCreateInstance(&info, nullptr, &instance));
|
VK_CHECK(vkCreateInstance(&info, nullptr, &instance));
|
||||||
}
|
}
|
||||||
void Graphics::setupDebugCallback()
|
void Graphics::setupDebugCallback()
|
||||||
|
|||||||
@@ -248,11 +248,9 @@ void Window::createSwapChain()
|
|||||||
};
|
};
|
||||||
VK_CHECK(vkCreateSwapchainKHR(graphics->getDevice(), &createInfo, nullptr, &swapchain));
|
VK_CHECK(vkCreateSwapchainKHR(graphics->getDevice(), &createInfo, nullptr, &swapchain));
|
||||||
|
|
||||||
uint32 numImages;
|
VK_CHECK(vkGetSwapchainImagesKHR(graphics->getDevice(), swapchain, &imageCount, swapChainImages.data()));
|
||||||
vkGetSwapchainImagesKHR(graphics->getDevice(), swapchain, &numImages, swapChainImages.data());
|
|
||||||
|
|
||||||
assert(numImages == Gfx::numFramesBuffered);
|
for (uint32 i = 0; i < imageCount; ++i)
|
||||||
for (uint32 i = 0; i < numImages; ++i)
|
|
||||||
{
|
{
|
||||||
swapChainTextures[i] = new Texture2D(graphics, TextureCreateInfo{
|
swapChainTextures[i] = new Texture2D(graphics, TextureCreateInfo{
|
||||||
.format = cast(format.format),
|
.format = cast(format.format),
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ public:
|
|||||||
MaterialNode brdf);
|
MaterialNode brdf);
|
||||||
~Material();
|
~Material();
|
||||||
const Gfx::PDescriptorLayout getDescriptorLayout() const { return layout; }
|
const Gfx::PDescriptorLayout getDescriptorLayout() const { return layout; }
|
||||||
|
Gfx::PDescriptorLayout getDescriptorLayout() { return layout; }
|
||||||
OMaterialInstance instantiate();
|
OMaterialInstance instantiate();
|
||||||
const std::string& getName() const { return materialName; }
|
const std::string& getName() const { return materialName; }
|
||||||
|
|
||||||
|
|||||||
-5682
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user