vulkan: fix incorrect textures in shader uniforms

This commit is contained in:
niki
2022-12-24 22:37:58 +01:00
parent 28c69597e4
commit 8694c44207
4 changed files with 42 additions and 44 deletions
+6 -16
View File
@@ -358,7 +358,7 @@ void Graphics::submitGpuCommands(bool present, void *screenshotCallbackData)
}
}
endRecordingGraphicsCommands(present);
endRecordingGraphicsCommands();
if (imagesInFlight[imageIndex] != VK_NULL_HANDLE)
vkWaitForFences(device, 1, &imagesInFlight.at(imageIndex), VK_TRUE, UINT64_MAX);
@@ -410,7 +410,7 @@ void Graphics::submitGpuCommands(bool present, void *screenshotCallbackData)
callbacks.clear();
}
startRecordingGraphicsCommands(false);
startRecordingGraphicsCommands();
}
}
@@ -1103,7 +1103,7 @@ void Graphics::beginFrame()
cleanUpFn();
cleanUpFunctions.at(currentFrame).clear();
startRecordingGraphicsCommands(true);
startRecordingGraphicsCommands();
Vulkan::cmdTransitionImageLayout(
commandBuffers.at(currentFrame),
@@ -1134,7 +1134,7 @@ void Graphics::beginFrame()
usedShadersInFrame.clear();
}
void Graphics::startRecordingGraphicsCommands(bool newFrame)
void Graphics::startRecordingGraphicsCommands()
{
VkCommandBufferBeginInfo beginInfo{};
beginInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
@@ -1149,7 +1149,7 @@ void Graphics::startRecordingGraphicsCommands(bool newFrame)
setDefaultRenderPass();
}
void Graphics::endRecordingGraphicsCommands(bool present) {
void Graphics::endRecordingGraphicsCommands() {
if (renderPassState.active)
endRenderPass();
@@ -1157,16 +1157,6 @@ void Graphics::endRecordingGraphicsCommands(bool present) {
throw love::Exception("failed to record command buffer");
}
uint32_t Graphics::getNumImagesInFlight() const
{
return MAX_FRAMES_IN_FLIGHT;
}
uint32_t Graphics::getFrameIndex() const
{
return static_cast<uint32_t>(currentFrame);
}
const VkDeviceSize Graphics::getMinUniformBufferOffsetAlignment() const
{
return minUniformBufferOffsetAlignment;
@@ -2263,7 +2253,7 @@ void Graphics::prepareDraw(const VertexAttributes &attributes, const BufferBindi
}
}
if (usesConstantVertexColor(attributes))
if (!usesConstantVertexColor(attributes))
{
bufferVector.push_back((VkBuffer)defaultConstantColor->getHandle());
offsets.push_back((VkDeviceSize)0);