validation errors

This commit is contained in:
Denis Pauk 2024-08-25 17:57:49 +03:00
parent d0c98f5bab
commit 04ab522baf
9 changed files with 31 additions and 1 deletions

View file

@ -124,6 +124,8 @@ Goals:
* [x] RGB particles support instead palette based one, * [x] RGB particles support instead palette based one,
* [x] Get rid of VID_PaletteColor client internal api use, * [x] Get rid of VID_PaletteColor client internal api use,
* [x] Broken maps groups from base2 to next, * [x] Broken maps groups from base2 to next,
* [ ] Group images in vulkan render,
* [ ] Rearange surfaces in vulkan render before render,
* [ ] Single player ReRelease support, * [ ] Single player ReRelease support,
* [ ] Support effects and additional flags for ReRelease when possible. * [ ] Support effects and additional flags for ReRelease when possible.
* [ ] Use shared model cache in client code insted reimplemnet in each render, * [ ] Use shared model cache in client code insted reimplemnet in each render,

View file

@ -340,6 +340,7 @@ qboolean Vkimp_CreateSurface(SDL_Window *window);
extern mvtx_t *verts_buffer; extern mvtx_t *verts_buffer;
extern uint16_t *vertIdxData; extern uint16_t *vertIdxData;
extern int drawCalls;
void Mesh_Init (void); void Mesh_Init (void);
void Mesh_Free (void); void Mesh_Free (void);

View file

@ -2199,6 +2199,7 @@ VkResult QVk_BeginFrame(const VkViewport* viewport, const VkRect2D* scissor)
ReleaseSwapBuffers(); ReleaseSwapBuffers();
// VK_ERROR: Validation Error: [ VUID-vkAcquireNextImageKHR-semaphore-01779 ] Object 0: handle = 0x620000000062, name = Semaphore: image available #30, type = VK_OBJECT_TYPE_SEMAPHORE; | MessageID = 0x5717e75b | vkAcquireNextImageKHR(): Semaphore must not have any pending operations. The Vulkan spec states: If semaphore is not VK_NULL_HANDLE it must not have any uncompleted signal or wait operations pending (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-01779) (validation)
VkResult result = vkAcquireNextImageKHR(vk_device.logical, vk_swapchain.sc, 500000000 /* 0.5 sec */, VkResult result = vkAcquireNextImageKHR(vk_device.logical, vk_swapchain.sc, 500000000 /* 0.5 sec */,
vk_imageAvailableSemaphores[vk_imageSemaphoreIdx], VK_NULL_HANDLE, &vk_imageIndex); vk_imageAvailableSemaphores[vk_imageSemaphoreIdx], VK_NULL_HANDLE, &vk_imageIndex);
if (result == VK_ERROR_OUT_OF_DATE_KHR || result == VK_SUBOPTIMAL_KHR || result == VK_ERROR_SURFACE_LOST_KHR || result == VK_TIMEOUT) if (result == VK_ERROR_OUT_OF_DATE_KHR || result == VK_SUBOPTIMAL_KHR || result == VK_ERROR_SURFACE_LOST_KHR || result == VK_TIMEOUT)
@ -2718,6 +2719,7 @@ QVk_Draw2DCallsRender(void)
vkCmdBindIndexBuffer(vk_activeCmdbuffer, vkCmdBindIndexBuffer(vk_activeCmdbuffer,
vk_rectIbo.resource.buffer, vk_rectIboffet, VK_INDEX_TYPE_UINT16); vk_rectIbo.resource.buffer, vk_rectIboffet, VK_INDEX_TYPE_UINT16);
vkCmdDrawIndexed(vk_activeCmdbuffer, 6 * draw2dcolor_num, 1, 0, 0, 0); vkCmdDrawIndexed(vk_activeCmdbuffer, 6 * draw2dcolor_num, 1, 0, 0, 0);
printf("%d: %s Color\n", drawCalls++, __func__);
} }
else if (draw2dcolor_calltype == CALL_TEX) else if (draw2dcolor_calltype == CALL_TEX)
{ {
@ -2759,6 +2761,7 @@ QVk_Draw2DCallsRender(void)
vkCmdBindIndexBuffer(vk_activeCmdbuffer, vkCmdBindIndexBuffer(vk_activeCmdbuffer,
vk_rectIbo.resource.buffer, vk_rectIboffet, VK_INDEX_TYPE_UINT16); vk_rectIbo.resource.buffer, vk_rectIboffet, VK_INDEX_TYPE_UINT16);
vkCmdDrawIndexed(vk_activeCmdbuffer, 6 * draw2dcolor_num, 1, 0, 0, 0); vkCmdDrawIndexed(vk_activeCmdbuffer, 6 * draw2dcolor_num, 1, 0, 0, 0);
printf("%d: %s Tex\n", drawCalls++, __func__);
} }
draw2dcolor_num = 0; draw2dcolor_num = 0;

View file

@ -390,8 +390,12 @@ static void ChangeColorBufferLayout(VkImage image, VkImageLayout fromLayout, VkI
.image = image, .image = image,
.subresourceRange = subresourceRange, .subresourceRange = subresourceRange,
}; };
/*
* VK_WARNING: Validation Warning: [ BestPractices-TransitionUndefinedToReadOnly ] Object 0: handle = 0x1a000000001a, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0xe10fe22f | vkCmdPipelineBarrier(): pImageMemoryBarriers[0] VkImageMemoryBarrier is being submitted with oldLayout VK_IMAGE_LAYOUT_UNDEFINED and the contents may be discarded, but the newLayout is VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, which is read only. (validation)
*/
vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0u, 0u, NULL, 0u, NULL, 1u, &imageBarrier); vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0u, 0u, NULL, 0u, NULL, 1u, &imageBarrier);
QVk_SubmitCommand(&commandBuffer, &vk_device.transferQueue); QVk_SubmitCommand(&commandBuffer, &vk_device.transferQueue);
vkFreeCommandBuffers(vk_device.logical, vk_transferCommandPool, 1, &commandBuffer); vkFreeCommandBuffers(vk_device.logical, vk_transferCommandPool, 1, &commandBuffer);

View file

@ -85,6 +85,7 @@ R_RenderDlight(dlight_t *light)
vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_drawDLightPipeline.layout, 0, 1, &uboDescriptorSet, 1, &uboOffset); vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_drawDLightPipeline.layout, 0, 1, &uboDescriptorSet, 1, &uboOffset);
vkCmdBindIndexBuffer(vk_activeCmdbuffer, *buffer, dstOffset, VK_INDEX_TYPE_UINT16); vkCmdBindIndexBuffer(vk_activeCmdbuffer, *buffer, dstOffset, VK_INDEX_TYPE_UINT16);
vkCmdDrawIndexed(vk_activeCmdbuffer, 48, 1, 0, 0, 0); vkCmdDrawIndexed(vk_activeCmdbuffer, 48, 1, 0, 0, 0);
printf("%d: %s\n", drawCalls++, __func__);
} }
void void

View file

@ -233,6 +233,7 @@ R_DrawSpriteModel(entity_t *currententity, const model_t *currentmodel)
vk_drawSpritePipeline.layout, 0, 1, vk_drawSpritePipeline.layout, 0, 1,
&skin->vk_texture.descriptorSet, 0, NULL); &skin->vk_texture.descriptorSet, 0, NULL);
vkCmdDraw(vk_activeCmdbuffer, 6, 1, 0, 0); vkCmdDraw(vk_activeCmdbuffer, 6, 1, 0, 0);
printf("%d: %s\n", drawCalls++, __func__);
} }
static void static void
@ -311,6 +312,7 @@ R_DrawNullModel(entity_t *currententity)
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset); vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
vkCmdBindIndexBuffer(vk_activeCmdbuffer, *buffer, dstOffset, VK_INDEX_TYPE_UINT16); vkCmdBindIndexBuffer(vk_activeCmdbuffer, *buffer, dstOffset, VK_INDEX_TYPE_UINT16);
vkCmdDrawIndexed(vk_activeCmdbuffer, 24, 1, 0, 0, 0); vkCmdDrawIndexed(vk_activeCmdbuffer, 24, 1, 0, 0, 0);
printf("%d: %s\n", drawCalls++, __func__);
} }
static void static void
@ -527,6 +529,7 @@ Vk_DrawParticles(int num_particles, const particle_t particles[])
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset); vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
vkCmdDraw(vk_activeCmdbuffer, (currentvertex - visibleParticles), 1, 0, 0); vkCmdDraw(vk_activeCmdbuffer, (currentvertex - visibleParticles), 1, 0, 0);
printf("%d: %s\n", drawCalls++, __func__);
} }
static void static void
@ -597,6 +600,7 @@ R_DrawParticles(void)
vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_drawPointParticlesPipeline.layout, 0, 1, &uboDescriptorSet, 1, &uboOffset); vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_drawPointParticlesPipeline.layout, 0, 1, &uboDescriptorSet, 1, &uboOffset);
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset); vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
vkCmdDraw(vk_activeCmdbuffer, r_newrefdef.num_particles, 1, 0, 0); vkCmdDraw(vk_activeCmdbuffer, r_newrefdef.num_particles, 1, 0, 0);
printf("%d: %s\n", drawCalls++, __func__);
} }
else else
{ {
@ -1050,6 +1054,7 @@ qboolean RE_EndWorldRenderpass(void)
vkCmdSetViewport(vk_activeCmdbuffer, 0u, 1u, &vk_viewport); vkCmdSetViewport(vk_activeCmdbuffer, 0u, 1u, &vk_viewport);
vkCmdSetScissor(vk_activeCmdbuffer, 0u, 1u, &vk_scissor); vkCmdSetScissor(vk_activeCmdbuffer, 0u, 1u, &vk_scissor);
vkCmdDraw(vk_activeCmdbuffer, 3, 1, 0, 0); vkCmdDraw(vk_activeCmdbuffer, 3, 1, 0, 0);
printf("%d: %s\n", drawCalls++, __func__);
vkCmdEndRenderPass(vk_activeCmdbuffer); vkCmdEndRenderPass(vk_activeCmdbuffer);
// start drawing UI // start drawing UI
@ -1080,6 +1085,7 @@ R_SetVulkan2D(const VkViewport* viewport, const VkRect2D* scissor)
vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_postprocessPipeline.layout, 0, 1, &vk_colorbufferWarp.descriptorSet, 0, NULL); vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_postprocessPipeline.layout, 0, 1, &vk_colorbufferWarp.descriptorSet, 0, NULL);
QVk_BindPipeline(&vk_postprocessPipeline); QVk_BindPipeline(&vk_postprocessPipeline);
vkCmdDraw(vk_activeCmdbuffer, 3, 1, 0, 0); vkCmdDraw(vk_activeCmdbuffer, 3, 1, 0, 0);
printf("%d: %s\n", drawCalls++, __func__);
} }
} }
@ -1433,6 +1439,8 @@ RE_BeginFrame(float camera_separation)
QVk_BeginRenderpass(RP_WORLD); QVk_BeginRenderpass(RP_WORLD);
} }
int drawCalls = 0;
/* /*
===================== =====================
RE_EndFrame RE_EndFrame
@ -1445,6 +1453,9 @@ RE_EndFrame(void)
// world has not rendered yet // world has not rendered yet
world_rendered = false; world_rendered = false;
printf("%s: Calls count %d\n", __func__, drawCalls);
drawCalls = 0;
} }
unsigned r_rawpalette[256]; unsigned r_rawpalette[256];
@ -1566,6 +1577,7 @@ R_DrawBeam(entity_t *currententity )
vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_drawBeamPipeline.layout, 0, 1, &uboDescriptorSet, 1, &uboOffset); vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_drawBeamPipeline.layout, 0, 1, &uboDescriptorSet, 1, &uboOffset);
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset); vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
vkCmdDraw(vk_activeCmdbuffer, NUM_BEAM_SEGS * 4, 1, 0, 0); vkCmdDraw(vk_activeCmdbuffer, NUM_BEAM_SEGS * 4, 1, 0, 0);
printf("%d: %s\n", drawCalls++, __func__);
} }
//=================================================================== //===================================================================

View file

@ -406,6 +406,7 @@ Vk_DrawAliasFrameLerp(entity_t *currententity, dmdx_t *paliashdr, float backlerp
vkCmdBindIndexBuffer(vk_activeCmdbuffer, **buffer, *dstOffset, VK_INDEX_TYPE_UINT16); vkCmdBindIndexBuffer(vk_activeCmdbuffer, **buffer, *dstOffset, VK_INDEX_TYPE_UINT16);
vkCmdDrawIndexed(vk_activeCmdbuffer, *index_pos, 1, 0, 0, 0); vkCmdDrawIndexed(vk_activeCmdbuffer, *index_pos, 1, 0, 0, 0);
printf("%d: %s\n", drawCalls++, __func__);
} }
static void static void
@ -836,5 +837,6 @@ R_DrawAliasModel(entity_t *currententity, const model_t *currentmodel)
vkCmdBindIndexBuffer(vk_activeCmdbuffer, *buffer, dstOffset, VK_INDEX_TYPE_UINT16); vkCmdBindIndexBuffer(vk_activeCmdbuffer, *buffer, dstOffset, VK_INDEX_TYPE_UINT16);
vkCmdDrawIndexed(vk_activeCmdbuffer, index_pos, 1, 0, 0, 0); vkCmdDrawIndexed(vk_activeCmdbuffer, index_pos, 1, 0, 0, 0);
printf("%d: %s\n", drawCalls++, __func__);
} }
} }

View file

@ -89,6 +89,7 @@ DrawVkPoly(msurface_t *fa, image_t *texture, const float *color)
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset); vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
vkCmdBindIndexBuffer(vk_activeCmdbuffer, *buffer, dstOffset, VK_INDEX_TYPE_UINT16); vkCmdBindIndexBuffer(vk_activeCmdbuffer, *buffer, dstOffset, VK_INDEX_TYPE_UINT16);
vkCmdDrawIndexed(vk_activeCmdbuffer, (p->numverts - 2) * 3, 1, 0, 0, 0); vkCmdDrawIndexed(vk_activeCmdbuffer, (p->numverts - 2) * 3, 1, 0, 0, 0);
printf("%d: %s\n", drawCalls++, __func__);
} }
static void static void
@ -145,6 +146,7 @@ R_DrawTriangleOutlines(void)
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset); vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
vkCmdDraw(vk_activeCmdbuffer, 4, 1, 0, 0); vkCmdDraw(vk_activeCmdbuffer, 4, 1, 0, 0);
printf("%d: %s\n", drawCalls++, __func__);
} }
} }
} }
@ -466,6 +468,7 @@ Vk_RenderLightmappedPoly(msurface_t *surf, float alpha,
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset); vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
vkCmdBindIndexBuffer(vk_activeCmdbuffer, *buffer, dstOffset, VK_INDEX_TYPE_UINT16); vkCmdBindIndexBuffer(vk_activeCmdbuffer, *buffer, dstOffset, VK_INDEX_TYPE_UINT16);
vkCmdDrawIndexed(vk_activeCmdbuffer, index_pos, 1, 0, 0, 0); vkCmdDrawIndexed(vk_activeCmdbuffer, index_pos, 1, 0, 0, 0);
printf("%d: %s\n", drawCalls++, __func__);
//PGM //PGM
//========== //==========
} }

View file

@ -156,6 +156,7 @@ EmitWaterPolys(msurface_t *fa, image_t *texture, const float *modelMatrix,
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset); vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
vkCmdBindIndexBuffer(vk_activeCmdbuffer, *buffer, dstOffset, VK_INDEX_TYPE_UINT16); vkCmdBindIndexBuffer(vk_activeCmdbuffer, *buffer, dstOffset, VK_INDEX_TYPE_UINT16);
vkCmdDrawIndexed(vk_activeCmdbuffer, index_pos, 1, 0, 0, 0); vkCmdDrawIndexed(vk_activeCmdbuffer, index_pos, 1, 0, 0, 0);
printf("%d: %s\n", drawCalls++, __func__);
} }
void void
@ -261,6 +262,7 @@ R_DrawSkyBox(void)
vkCmdBindIndexBuffer(vk_activeCmdbuffer, *buffer, dstOffset, VK_INDEX_TYPE_UINT16); vkCmdBindIndexBuffer(vk_activeCmdbuffer, *buffer, dstOffset, VK_INDEX_TYPE_UINT16);
vkCmdDrawIndexed(vk_activeCmdbuffer, 6, 1, 0, 0, 0); vkCmdDrawIndexed(vk_activeCmdbuffer, 6, 1, 0, 0, 0);
printf("%d: %s\n", drawCalls++, __func__);
} }
} }