vulkan: fix validation warnings

Sometimes no buffer for tex coords are given, however the shader
still expects some. We can fix this by using a default buffer, which
contains the constant tex coords (0, 0), which is then bound instead.
This commit is contained in:
niki
2023-07-18 14:56:42 +02:00
parent ba15a2ab05
commit 3b9476b5dd
2 changed files with 42 additions and 10 deletions
+1 -1
View File
@@ -366,7 +366,6 @@ private:
void startRecordingGraphicsCommands();
void endRecordingGraphicsCommands();
void ensureGraphicsPipelineConfiguration(GraphicsPipelineConfiguration &configuration);
bool usesConstantVertexColor(const VertexAttributes &attribs);
void createVulkanVertexFormat(
VertexAttributes vertexAttributes,
std::vector<VkVertexInputBindingDescription> &bindingDescriptions,
@@ -435,6 +434,7 @@ private:
VmaAllocator vmaAllocator = VK_NULL_HANDLE;
StrongRef<love::graphics::Texture> defaultTexture;
StrongRef<love::graphics::Buffer> defaultConstantColor;
StrongRef<love::graphics::Buffer> defaultConstantTexCoord;
// functions that need to be called to cleanup objects that were needed for rendering a frame.
// We need a vector for each frame in flight.
std::vector<std::vector<std::function<void()>>> cleanUpFunctions;