diff --git a/util/test/demos/vk/vk_overlay_test.cpp b/util/test/demos/vk/vk_overlay_test.cpp index 20c2d84c7..eed9b261b 100644 --- a/util/test/demos/vk/vk_overlay_test.cpp +++ b/util/test/demos/vk/vk_overlay_test.cpp @@ -300,6 +300,11 @@ void main() pipeCreateInfo.depthStencilState.depthCompareOp = VK_COMPARE_OP_ALWAYS; VkPipeline whitepipe = createGraphicsPipeline(pipeCreateInfo); + pipeCreateInfo.rasterizationState.rasterizerDiscardEnable = VK_TRUE; + pipeCreateInfo.multisampleState.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT; + pipeCreateInfo.renderPass = renderPass; + VkPipeline discardPipe = createGraphicsPipeline(pipeCreateInfo); + AllocatedImage subimg( this, vkh::ImageCreateInfo(mainWindow->scissor.extent.width, mainWindow->scissor.extent.height, 0, @@ -357,6 +362,19 @@ void main() StartUsingBackbuffer(cmd, VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_GENERAL); + vkCmdBeginRenderPass(cmd, + vkh::RenderPassBeginInfo( + renderPass, fbs[mainWindow->imgIndex], mainWindow->scissor, + {vkh::ClearValue(0.2f, 0.2f, 0.2f, 1.0f), vkh::ClearValue(1.0f, 0)}), + VK_SUBPASS_CONTENTS_INLINE); + + vkh::cmdBindVertexBuffers(cmd, 0, {vb.buffer}, {0}); + setMarker(cmd, "Discard Test"); + vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, discardPipe); + vkCmdDraw(cmd, 3, 1, 0, 0); + + vkCmdEndRenderPass(cmd); + VkViewport v; VkRect2D s; diff --git a/util/test/tests/Vulkan/VK_Overlay_Test.py b/util/test/tests/Vulkan/VK_Overlay_Test.py index 95dca7bac..d8d522c35 100644 --- a/util/test/tests/Vulkan/VK_Overlay_Test.py +++ b/util/test/tests/Vulkan/VK_Overlay_Test.py @@ -4,4 +4,44 @@ import renderdoc as rd class VK_Overlay_Test(rdtest.Overlay_Test): demos_test_name = 'VK_Overlay_Test' - internal = False \ No newline at end of file + internal = False + + def check_capture(self): + super(VK_Overlay_Test, self).check_capture() + + out: rd.ReplayOutput = self.controller.CreateOutput(rd.CreateHeadlessWindowingData(100, 100), + rd.ReplayOutputType.Texture) + + # Don't check any pixel values, but ensure all overlays at least work with rasterizer discard and no + # viewport/scissor bound + sub_marker: rd.DrawcallDescription = self.find_draw("Discard Test") + self.controller.SetFrameEvent(sub_marker.next.eventId, True) + + pipe: rd.PipeState = self.controller.GetPipelineState() + + tex = rd.TextureDisplay() + tex.resourceId = pipe.GetOutputTargets()[0].resourceId + + for overlay in rd.DebugOverlay: + if overlay == rd.DebugOverlay.NoOverlay: + continue + + # These overlays are just displaymodes really, not actually separate overlays + if overlay == rd.DebugOverlay.NaN or overlay == rd.DebugOverlay.Clipping: + continue + + if overlay == rd.DebugOverlay.ClearBeforeDraw or overlay == rd.DebugOverlay.ClearBeforePass: + continue + + rdtest.log.success("Checking overlay {} with rasterizer discard".format(str(overlay))) + + tex.overlay = overlay + out.SetTextureDisplay(tex) + + out.Display() + + overlay_id: rd.ResourceId = out.GetDebugOverlayTexID() + + rdtest.log.success("Overlay {} rendered with rasterizer discard".format(str(overlay))) + + out.Shutdown() \ No newline at end of file