mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Test vulkan overalys with rasterizer discard and otherwise invalid state
* E.g. no viewport/scissors bound.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -4,4 +4,44 @@ import renderdoc as rd
|
||||
|
||||
class VK_Overlay_Test(rdtest.Overlay_Test):
|
||||
demos_test_name = 'VK_Overlay_Test'
|
||||
internal = False
|
||||
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()
|
||||
Reference in New Issue
Block a user