From 40090fb779b09ee4e8b7419fe33439fe504eba23 Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Wed, 6 Sep 2023 11:39:00 +0100 Subject: [PATCH] Extend Overlay tests to handle more depth stencil formats : GL D32_S8, D24_S8, D32, D24, D16 --- util/test/demos/gl/gl_overlay_test.cpp | 252 +++--- util/test/rdtest/shared/Overlay_Test.py | 1094 ++++++++++++----------- 2 files changed, 716 insertions(+), 630 deletions(-) diff --git a/util/test/demos/gl/gl_overlay_test.cpp b/util/test/demos/gl/gl_overlay_test.cpp index 3e2e14103..daa34bf0e 100644 --- a/util/test/demos/gl/gl_overlay_test.cpp +++ b/util/test/demos/gl/gl_overlay_test.cpp @@ -177,35 +177,58 @@ void main() GLuint program = MakeProgram(common + vertex, common + pixel); GLuint whiteprogram = MakeProgram(common + vertex, whitepixel); - GLuint fbo = MakeFBO(); - glBindFramebuffer(GL_FRAMEBUFFER, fbo); + char *fmtNames[] = {"D24_S8", "D32F_S8", "D16_S0", "D24_S0", "D32F_S0"}; + GLenum fmts[] = {GL_DEPTH24_STENCIL8, GL_DEPTH32F_STENCIL8, GL_DEPTH_COMPONENT16, + GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT32F}; + const size_t countFmts = ARRAY_COUNT(fmts); - // Color render texture - GLuint attachments[] = {MakeTexture(), MakeTexture(), MakeTexture(), MakeTexture()}; + GLuint fbos[countFmts]; + GLuint msaafbos[countFmts]; + for(size_t f = 0; f < countFmts; f++) + { + GLenum fmt = fmts[f]; - glBindTexture(GL_TEXTURE_2D, attachments[0]); - glTexStorage2D(GL_TEXTURE_2D, 1, GL_SRGB8_ALPHA8, screenWidth, screenHeight); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, attachments[0], 0); + // Color render texture + GLuint attachments[] = {MakeTexture(), MakeTexture(), MakeTexture(), MakeTexture()}; + GLenum dsAttachment = GL_DEPTH_ATTACHMENT; + if(fmt == GL_DEPTH24_STENCIL8 || fmt == GL_DEPTH32F_STENCIL8) + dsAttachment = GL_DEPTH_STENCIL_ATTACHMENT; + if(fmt == GL_STENCIL_INDEX8) + dsAttachment = GL_STENCIL_ATTACHMENT; - glBindTexture(GL_TEXTURE_2D, attachments[1]); - glTexStorage2D(GL_TEXTURE_2D, 1, GL_DEPTH24_STENCIL8, screenWidth, screenHeight); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, - attachments[1], 0); + { + GLuint fbo = MakeFBO(); + fbos[f] = fbo; + glBindFramebuffer(GL_FRAMEBUFFER, fbo); - GLuint msaafbo = MakeFBO(); - glBindFramebuffer(GL_FRAMEBUFFER, msaafbo); + glBindTexture(GL_TEXTURE_2D, attachments[0]); + glTexStorage2D(GL_TEXTURE_2D, 1, GL_SRGB8_ALPHA8, screenWidth, screenHeight); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, attachments[0], + 0); - glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, attachments[2]); - glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 4, GL_SRGB8_ALPHA8, screenWidth, - screenHeight, GL_TRUE); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, - attachments[2], 0); + glBindTexture(GL_TEXTURE_2D, attachments[1]); + glTexStorage2D(GL_TEXTURE_2D, 1, fmt, screenWidth, screenHeight); + glFramebufferTexture2D(GL_FRAMEBUFFER, dsAttachment, GL_TEXTURE_2D, attachments[1], 0); + } - glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, attachments[3]); - glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 4, GL_DEPTH24_STENCIL8, screenWidth, - screenHeight, GL_TRUE); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D_MULTISAMPLE, - attachments[3], 0); + { + GLuint msaafbo = MakeFBO(); + msaafbos[f] = msaafbo; + glBindFramebuffer(GL_FRAMEBUFFER, msaafbo); + + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, attachments[2]); + glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 4, GL_SRGB8_ALPHA8, screenWidth, + screenHeight, GL_TRUE); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, + attachments[2], 0); + + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, attachments[3]); + glTexStorage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 4, fmt, screenWidth, screenHeight, + GL_TRUE); + glFramebufferTexture2D(GL_FRAMEBUFFER, dsAttachment, GL_TEXTURE_2D_MULTISAMPLE, + attachments[3], 0); + } + } GLuint subtex = MakeTexture(); glBindTexture(GL_TEXTURE_2D_ARRAY, subtex); @@ -242,104 +265,119 @@ void main() { glBindVertexArray(vao); - glUseProgram(program); - - for(GLuint fb : {fbo, msaafbo}) + for(size_t i = 0; i < countFmts; ++i) { - glEnable(GL_CULL_FACE); - glFrontFace(GL_CW); + GLenum fmt = fmts[i]; + std::string fmtName(fmtNames[i]); + for(bool is_msaa : {false, true}) + { + bool hasStencil = false; + if(fmt == GL_DEPTH24_STENCIL8 || fmt == GL_DEPTH32F_STENCIL8) + hasStencil = true; - glDepthMask(GL_TRUE); - glEnable(GL_DEPTH_TEST); - glEnable(GL_SCISSOR_TEST); - glDisable(GL_DEPTH_CLAMP); - glDisable(GL_STENCIL_TEST); - glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); - glStencilFunc(GL_ALWAYS, 0x55, 0xff); + GLuint fb = is_msaa ? msaafbos[i] : fbos[i]; - glViewport(10, 10, GLsizei(screenWidth) - 20, GLsizei(screenHeight) - 20); - glScissor(0, 0, screenWidth, screenHeight); + glEnable(GL_CULL_FACE); + glFrontFace(GL_CW); - glBindFramebuffer(GL_FRAMEBUFFER, fb); - float col[] = {0.2f, 0.2f, 0.2f, 1.0f}; - glClearBufferfv(GL_COLOR, 0, col); - glClearBufferfi(GL_DEPTH_STENCIL, 0, 1.0f, 0); + glDepthMask(GL_TRUE); + glEnable(GL_DEPTH_TEST); + glEnable(GL_SCISSOR_TEST); + glDisable(GL_DEPTH_CLAMP); + glDisable(GL_STENCIL_TEST); + glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); + glStencilFunc(GL_ALWAYS, 0x55, 0xff); + + glViewport(10, 10, GLsizei(screenWidth) - 20, GLsizei(screenHeight) - 20); + glScissor(0, 0, screenWidth, screenHeight); + + glBindFramebuffer(GL_FRAMEBUFFER, fb); + float col[] = {0.2f, 0.2f, 0.2f, 1.0f}; + glClearBufferfv(GL_COLOR, 0, col); + glClearBufferfi(GL_DEPTH_STENCIL, 0, 1.0f, 0); + glUseProgram(program); + + // 1: write depth + glDepthFunc(GL_ALWAYS); + glDrawArrays(GL_TRIANGLES, 0, 3); + + glDepthFunc(GL_LEQUAL); + if(hasStencil) + { + // 2: write stencil + glEnable(GL_STENCIL_TEST); + glDrawArrays(GL_TRIANGLES, 3, 3); + } + + // 3: write background + glDisable(GL_STENCIL_TEST); + glDrawArrays(GL_TRIANGLES, 6, 3); + + // add a marker so we can easily locate this draw + std::string markerName(is_msaa ? "MSAA Test " : "Normal Test "); + markerName += fmtName; + setMarker(markerName); + + glEnable(GL_STENCIL_TEST); + glStencilFunc(GL_GREATER, 0x55, 0xff); + glDrawArrays(GL_TRIANGLES, 9, 24); + + if(!is_msaa) + { + setMarker("Viewport Test " + fmtName); + glDisable(GL_STENCIL_TEST); + glViewport(10, screenHeight - 90, 80, 80); + glScissor(24, screenHeight - 76, 52, 52); + glDrawArrays(GL_TRIANGLES, 33, 3); + } + + if(is_msaa) + { + setMarker("Sample Mask Test " + fmtName); + glDisable(GL_STENCIL_TEST); + glEnable(GL_SAMPLE_MASK); + glSampleMaski(0, 0x2); + glViewport(0, screenHeight - 80, 80, 80); + glScissor(0, screenHeight - 80, 80, 80); + glDrawArrays(GL_TRIANGLES, 6, 3); + glSampleMaski(0, ~0U); + glDisable(GL_SAMPLE_MASK); + } + + glScissor(0, 0, screenWidth, screenHeight); + } + + glBindFramebuffer(GL_READ_FRAMEBUFFER, fbos[0]); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); + glBlitFramebuffer(0, 0, screenWidth, screenHeight, 0, 0, screenWidth, screenHeight, + GL_COLOR_BUFFER_BIT, GL_LINEAR); + + glBindFramebuffer(GL_FRAMEBUFFER, subfbo); + float col2[] = {0.0f, 0.0f, 0.0f, 1.0f}; + glClearBufferfv(GL_COLOR, 0, col2); - // 1: write depth glDepthFunc(GL_ALWAYS); - glDrawArrays(GL_TRIANGLES, 0, 3); - - // 2: write stencil - glDepthFunc(GL_LEQUAL); - glEnable(GL_STENCIL_TEST); - glDrawArrays(GL_TRIANGLES, 3, 3); - - // 3: write background glDisable(GL_STENCIL_TEST); - glDrawArrays(GL_TRIANGLES, 6, 3); - // add a marker so we can easily locate this draw - setMarker(fb == msaafbo ? "MSAA Test" : "Normal Test"); + glUseProgram(whiteprogram); - glEnable(GL_STENCIL_TEST); - glStencilFunc(GL_GREATER, 0x55, 0xff); + glViewport(5, 5, GLsizei(screenWidth) / 4 - 10, GLsizei(screenHeight) / 4 - 10); + glScissor(0, 0, screenWidth / 4, screenHeight / 4); + + setMarker("Subresources mip 2"); glDrawArrays(GL_TRIANGLES, 9, 24); - if(fb != msaafbo) - { - setMarker("Viewport Test"); - glDisable(GL_STENCIL_TEST); - glViewport(10, screenHeight - 90, 80, 80); - glScissor(24, screenHeight - 76, 52, 52); - glDrawArrays(GL_TRIANGLES, 33, 3); - } + glBindFramebuffer(GL_FRAMEBUFFER, subfbo2); + glClearBufferfv(GL_COLOR, 0, col2); - if(fb == msaafbo) - { - setMarker("Sample Mask Test"); - glDisable(GL_STENCIL_TEST); - glEnable(GL_SAMPLE_MASK); - glSampleMaski(0, 0x2); - glViewport(0, screenHeight - 80, 80, 80); - glScissor(0, screenHeight - 80, 80, 80); - glDrawArrays(GL_TRIANGLES, 6, 3); - glSampleMaski(0, ~0U); - glDisable(GL_SAMPLE_MASK); - } + glViewport(2, 2, GLsizei(screenWidth) / 8 - 4, GLsizei(screenHeight) / 8 - 4); + glScissor(0, 0, screenWidth / 8, screenHeight / 8); - glScissor(0, 0, screenWidth, screenHeight); + setMarker("Subresources mip 3"); + glDrawArrays(GL_TRIANGLES, 9, 24); + + Present(); } - - glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); - glBlitFramebuffer(0, 0, screenWidth, screenHeight, 0, 0, screenWidth, screenHeight, - GL_COLOR_BUFFER_BIT, GL_LINEAR); - - glBindFramebuffer(GL_FRAMEBUFFER, subfbo); - float col2[] = {0.0f, 0.0f, 0.0f, 1.0f}; - glClearBufferfv(GL_COLOR, 0, col2); - - glDepthFunc(GL_ALWAYS); - glDisable(GL_STENCIL_TEST); - - glUseProgram(whiteprogram); - - glViewport(5, 5, GLsizei(screenWidth) / 4 - 10, GLsizei(screenHeight) / 4 - 10); - glScissor(0, 0, screenWidth / 4, screenHeight / 4); - - setMarker("Subresources mip 2"); - glDrawArrays(GL_TRIANGLES, 9, 24); - - glBindFramebuffer(GL_FRAMEBUFFER, subfbo2); - glClearBufferfv(GL_COLOR, 0, col2); - - glViewport(2, 2, GLsizei(screenWidth) / 8 - 4, GLsizei(screenHeight) / 8 - 4); - glScissor(0, 0, screenWidth / 8, screenHeight / 8); - - setMarker("Subresources mip 3"); - glDrawArrays(GL_TRIANGLES, 9, 24); - - Present(); } return 0; diff --git a/util/test/rdtest/shared/Overlay_Test.py b/util/test/rdtest/shared/Overlay_Test.py index 6e3b32b18..31d29d817 100644 --- a/util/test/rdtest/shared/Overlay_Test.py +++ b/util/test/rdtest/shared/Overlay_Test.py @@ -13,50 +13,407 @@ class Overlay_Test(rdtest.TestCase): api: rd.GraphicsAPI = self.controller.GetAPIProperties().pipelineType + fmts = ["D24_S8", "D32F_S8", "D16_S0", "D24_S0", "D32F_S0"] + # Check the actual output is as expected first. + for fmt in fmts: + marker_name = "Normal Test " + fmt; + test_marker: rd.ActionDescription = self.find_action(marker_name, base_event) + if test_marker == None: + rdtest.log.print("Skipping format {} marker {} not found".format(fmt, marker_name)) + continue; + rdtest.log.print("Checking format {}".format(fmt)) + has_stencil = fmt.endswith("_S8") + for is_msaa in [False, True]: + if is_msaa: + marker_name = "MSAA Test "; + else: + marker_name = "Normal Test "; + marker_name += fmt; + test_marker: rd.ActionDescription = self.find_action(marker_name, base_event) - for is_msaa in [False, True]: - if is_msaa: - test_marker: rd.ActionDescription = self.find_action("MSAA Test", base_event) - else: - test_marker: rd.ActionDescription = self.find_action("Normal Test", base_event) + self.controller.SetFrameEvent(test_marker.next.eventId, True) - self.controller.SetFrameEvent(test_marker.next.eventId, True) + pipe: rd.PipeState = self.controller.GetPipelineState() + + col_tex: rd.ResourceId = pipe.GetOutputTargets()[0].resourceId + + tex = rd.TextureDisplay() + tex.resourceId = col_tex + tex.subresource.sample = 0 + + # Background around the outside + self.check_pixel_value(col_tex, 0.1, 0.1, [0.2, 0.2, 0.2, 1.0]) + self.check_pixel_value(col_tex, 0.8, 0.1, [0.2, 0.2, 0.2, 1.0]) + self.check_pixel_value(col_tex, 0.5, 0.95, [0.2, 0.2, 0.2, 1.0]) + + # Large dark grey triangle + self.check_pixel_value(col_tex, 0.5, 0.1, [0.1, 0.1, 0.1, 1.0]) + self.check_pixel_value(col_tex, 0.5, 0.9, [0.1, 0.1, 0.1, 1.0]) + self.check_pixel_value(col_tex, 0.2, 0.9, [0.1, 0.1, 0.1, 1.0]) + self.check_pixel_value(col_tex, 0.8, 0.9, [0.1, 0.1, 0.1, 1.0]) + + # Red upper half triangle + if has_stencil: + self.check_pixel_value(col_tex, 0.3, 0.4, [1.0, 0.0, 0.0, 1.0]) + else: + self.check_pixel_value(col_tex, 0.3, 0.4, [0.2, 0.2, 0.2, 1.0]) + # Blue lower half triangle + self.check_pixel_value(col_tex, 0.3, 0.6, [0.0, 0.0, 1.0, 1.0]) + + # Floating clipped triangle + self.check_pixel_value(col_tex, 335, 140, [0.0, 0.0, 0.0, 1.0]) + self.check_pixel_value(col_tex, 340, 140, [0.2, 0.2, 0.2, 1.0]) + + # Triangle size triangles + self.check_pixel_value(col_tex, 200, 51, [1.0, 0.5, 1.0, 1.0]) + self.check_pixel_value(col_tex, 200, 65, [1.0, 1.0, 0.0, 1.0]) + self.check_pixel_value(col_tex, 200, 79, [0.0, 1.0, 1.0, 1.0]) + self.check_pixel_value(col_tex, 200, 93, [0.0, 1.0, 0.0, 1.0]) + + 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 + + # We'll test the clear-before-X overlays seperately, for both colour and depth + if overlay == rd.DebugOverlay.ClearBeforeDraw or overlay == rd.DebugOverlay.ClearBeforePass: + continue + + # Ignore stencil tests for depth only formats + if overlay == rd.DebugOverlay.Stencil and not has_stencil: + continue + + rdtest.log.print("Checking overlay {} in {} main action Format {}".format(str(overlay), "MSAA" if is_msaa else "normal", fmt)) + + tex.overlay = overlay + out.SetTextureDisplay(tex) + + out.Display() + + eps = 1.0 / 256.0 + + overlay_id: rd.ResourceId = out.GetDebugOverlayTexID() + + # We test a few key spots: + # 4 points along the left side of the big triangle, above/in/below its intersection with the tri behind + # 4 points outside all triangles + # The overlap between the big tri and the bottom tri, and between it and the right backface culled tri + # The bottom tri's part that sticks out + # The two parts of the backface culled tri that stick out + # The depth clipped tri, in and out of clipping + # The 4 triangle size test triangles + + if overlay == rd.DebugOverlay.Drawcall: + self.check_pixel_value(overlay_id, 150, 90, [0.8, 0.1, 0.8, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 130, [0.8, 0.1, 0.8, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 160, [0.8, 0.1, 0.8, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 200, [0.8, 0.1, 0.8, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.5], eps=eps) + self.check_pixel_value(overlay_id, 125, 250, [0.0, 0.0, 0.0, 0.5], eps=eps) + self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.5], eps=eps) + self.check_pixel_value(overlay_id, 250, 250, [0.0, 0.0, 0.0, 0.5], eps=eps) + + self.check_pixel_value(overlay_id, 220, 175, [0.8, 0.1, 0.8, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 150, [0.8, 0.1, 0.8, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 220, 190, [0.8, 0.1, 0.8, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 285, 135, [0.8, 0.1, 0.8, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 285, 165, [0.8, 0.1, 0.8, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 330, 145, [0.8, 0.1, 0.8, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 340, 145, [0.8, 0.1, 0.8, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 200, 51, [0.8, 0.1, 0.8, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 65, [0.8, 0.1, 0.8, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 79, [0.8, 0.1, 0.8, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 93, [0.8, 0.1, 0.8, 1.0], eps=eps) + elif overlay == rd.DebugOverlay.Wireframe: + # Wireframe we only test a limited set to avoid hitting implementation variations of line raster + # We also have to fudge a little because the lines might land on adjacent pixels + # Also to be safe we don't run this test on MSAA + if not is_msaa: + x = 142 + picked: rd.PixelValue = self.controller.PickPixel(overlay_id, x, 150, rd.Subresource(), rd.CompType.Typeless) + if picked.floatValue[3] == 0.0: + x = 141 + picked: rd.PixelValue = self.controller.PickPixel(overlay_id, x, 150, rd.Subresource(), rd.CompType.Typeless) + + self.check_pixel_value(overlay_id, x, 90, [200.0/255.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, x, 130, [200.0/255.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, x, 160, [200.0/255.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, x, 200, [200.0/255.0, 1.0, 0.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 125, 60, [200.0/255.0, 1.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 125, 250, [200.0/255.0, 1.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 60, [200.0/255.0, 1.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 250, [200.0/255.0, 1.0, 0.0, 0.0], eps=eps) + + y = 149 + picked: rd.PixelValue = self.controller.PickPixel(overlay_id, 325, y, rd.Subresource(), rd.CompType.Typeless) + if picked.floatValue[3] == 0.0: + y = 150 + + self.check_pixel_value(overlay_id, 325, y, [200.0/255.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 340, y, [200.0/255.0, 1.0, 0.0, 1.0], eps=eps) + elif overlay == rd.DebugOverlay.Depth: + self.check_pixel_value(overlay_id, 150, 90, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 130, [0.0, 1.0, 0.0, 1.0], eps=eps) + # Intersection with lesser depth - depth fail + self.check_pixel_value(overlay_id, 150, 160, [1.0, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 200, [0.0, 1.0, 0.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 125, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) + + self.check_pixel_value(overlay_id, 220, 175, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 150, [0.0, 1.0, 0.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 220, 190, [0.0, 1.0, 0.0, 1.0], eps=eps) + + # Backface culled triangle + self.check_pixel_value(overlay_id, 285, 135, [1.0, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 285, 165, [1.0, 0.0, 0.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 330, 145, [0.0, 1.0, 0.0, 1.0], eps=eps) + # Depth clipped part of tri + self.check_pixel_value(overlay_id, 340, 145, [1.0, 0.0, 0.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 200, 51, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 65, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 79, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 93, [0.0, 1.0, 0.0, 1.0], eps=eps) + elif overlay == rd.DebugOverlay.Stencil: + self.check_pixel_value(overlay_id, 150, 90, [0.0, 1.0, 0.0, 1.0], eps=eps) + # Intersection with different stencil - stencil fail + self.check_pixel_value(overlay_id, 150, 130, [1.0, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 160, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 200, [0.0, 1.0, 0.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 125, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) + + self.check_pixel_value(overlay_id, 220, 175, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 150, [0.0, 1.0, 0.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 220, 190, [0.0, 1.0, 0.0, 1.0], eps=eps) + + # Backface culled triangle + self.check_pixel_value(overlay_id, 285, 135, [1.0, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 285, 165, [1.0, 0.0, 0.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 330, 145, [0.0, 1.0, 0.0, 1.0], eps=eps) + # Depth clipped part of tri + self.check_pixel_value(overlay_id, 340, 145, [1.0, 0.0, 0.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 200, 51, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 65, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 79, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 93, [0.0, 1.0, 0.0, 1.0], eps=eps) + elif overlay == rd.DebugOverlay.BackfaceCull: + self.check_pixel_value(overlay_id, 150, 90, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 130, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 160, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 200, [0.0, 1.0, 0.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 125, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) + + self.check_pixel_value(overlay_id, 220, 175, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 150, [0.0, 1.0, 0.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 220, 190, [0.0, 1.0, 0.0, 1.0], eps=eps) + + # Backface culled triangle + self.check_pixel_value(overlay_id, 285, 135, [1.0, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 285, 165, [1.0, 0.0, 0.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 330, 145, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 340, 145, [0.0, 1.0, 0.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 200, 51, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 65, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 79, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 93, [0.0, 1.0, 0.0, 1.0], eps=eps) + elif overlay == rd.DebugOverlay.ViewportScissor: + # Inside viewport + self.check_pixel_value(overlay_id, 50, 50, [0.2 * 0.4, 0.2 * 0.4, 0.9 * 0.4, 0.4 * 0.4], eps=eps) + self.check_pixel_value(overlay_id, 350, 50, [0.2 * 0.4, 0.2 * 0.4, 0.9 * 0.4, 0.4 * 0.4], eps=eps) + self.check_pixel_value(overlay_id, 50, 250, [0.2 * 0.4, 0.2 * 0.4, 0.9 * 0.4, 0.4 * 0.4], eps=eps) + self.check_pixel_value(overlay_id, 350, 250, [0.2 * 0.4, 0.2 * 0.4, 0.9 * 0.4, 0.4 * 0.4], eps=eps) + + # Passing triangle inside the viewport + self.check_pixel_value(overlay_id, 200, 150, + [0.2 * 0.4, 1.0 * 0.6 + 0.2 * 0.4, 0.9 * 0.4, 1.0 * 0.6 + 0.4 * 0.4], eps=eps) + + # Viewport border + self.check_pixel_value(overlay_id, 12, 12, [0.1, 0.1, 0.1, 1.0], eps=eps) + + # Outside viewport (not on scissor border) + self.check_pixel_value(overlay_id, 6, 6, [0.0, 0.0, 0.0, 0.0], eps=eps) + + # Scissor border + self.check_pixel_value(overlay_id, 0, 0, [1.0, 1.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 20, 0, [0.0, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 40, 0, [1.0, 1.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 60, 0, [0.0, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 60, 0, [0.0, 0.0, 0.0, 1.0], eps=eps) + elif overlay == rd.DebugOverlay.QuadOverdrawDraw: + # This would require extreme command buffer patching to de-MSAA the framebuffer and renderpass + if api == rd.GraphicsAPI.Vulkan and is_msaa: + rdtest.log.print("Quad overdraw not currently supported on MSAA on Vulkan") + continue + + self.check_pixel_value(overlay_id, 150, 90, [1.0, 1.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 140, 130, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 160, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 200, [1.0, 1.0, 1.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 125, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) + + self.check_pixel_value(overlay_id, 220, 175, [2.0, 2.0, 2.0, 2.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 150, [1.0, 1.0, 1.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 220, 190, [1.0, 1.0, 1.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 285, 135, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 285, 165, [0.0, 0.0, 0.0, 0.0], eps=eps) + + self.check_pixel_value(overlay_id, 330, 145, [1.0, 1.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 340, 145, [0.0, 0.0, 0.0, 0.0], eps=eps) + + self.check_pixel_value(overlay_id, 200, 51, [1.0, 1.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 65, [1.0, 1.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 79, [1.0, 1.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 93, [1.0, 1.0, 1.0, 1.0], eps=eps) + elif overlay == rd.DebugOverlay.QuadOverdrawPass: + # This would require extreme command buffer patching to de-MSAA the framebuffer and renderpass + if api == rd.GraphicsAPI.Vulkan and is_msaa: + rdtest.log.print("Quad overdraw not currently supported on MSAA on Vulkan") + continue + + self.check_pixel_value(overlay_id, 150, 90, [1.0, 1.0, 1.0, 1.0], eps=eps) + + # Do an extra tap here where we overlap with the extreme-background largest triangle, to show that + # overdraw + self.check_pixel_value(overlay_id, 150, 100, [2.0, 2.0, 2.0, 2.0], eps=eps) + + self.check_pixel_value(overlay_id, 140, 130, [1.0, 1.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 160, [1.0, 1.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 200, [2.0, 2.0, 2.0, 2.0], eps=eps) + + # Two of these have overdraw from the pass due to the large background triangle + self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 125, 250, [1.0, 1.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 250, [1.0, 1.0, 1.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 220, 175, [3.0, 3.0, 3.0, 3.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 150, [2.0, 2.0, 2.0, 2.0], eps=eps) + + self.check_pixel_value(overlay_id, 220, 190, [2.0, 2.0, 2.0, 2.0], eps=eps) + + self.check_pixel_value(overlay_id, 285, 135, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 285, 165, [1.0, 1.0, 1.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 330, 145, [1.0, 1.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 340, 145, [0.0, 0.0, 0.0, 0.0], eps=eps) + + self.check_pixel_value(overlay_id, 200, 51, [2.0, 2.0, 2.0, 2.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 65, [2.0, 2.0, 2.0, 2.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 79, [2.0, 2.0, 2.0, 2.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 93, [2.0, 2.0, 2.0, 2.0], eps=eps) + elif overlay == rd.DebugOverlay.TriangleSizeDraw: + eps = 1.0 + + self.check_pixel_value(overlay_id, 150, 90, [10632.0, 10632.0, 10632.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 130, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 160, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 200, [10632.0, 10632.0, 10632.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 125, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) + + self.check_pixel_value(overlay_id, 220, 175, [2128.0, 2128.0, 2128.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 150, [10632.0, 10632.0, 10632.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 220, 190, [2128.0, 2128.0, 2128.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 285, 135, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 285, 165, [0.0, 0.0, 0.0, 0.0], eps=eps) + + self.check_pixel_value(overlay_id, 330, 145, [531.0, 531.0, 531.0, 531.0], eps=eps) + self.check_pixel_value(overlay_id, 340, 145, [0.0, 0.0, 0.0, 0.0], eps=eps) + + eps = 0.01 + + self.check_pixel_value(overlay_id, 200, 51, [8.305, 8.305, 8.305, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 65, [5.316, 5.316, 5.316, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 79, [3.0, 3.0, 3.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 93, [1.33, 1.33, 1.33, 1.0], eps=eps) + elif overlay == rd.DebugOverlay.TriangleSizePass: + eps = 1.0 + + self.check_pixel_value(overlay_id, 150, 90, [10632.0, 10632.0, 10632.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 130, [3324.0, 3324.0, 3324.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 160, [3324.0, 3324.0, 3324.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 150, 200, [10632.0, 10632.0, 10632.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 125, 250, [43072.0, 43072.0, 43072.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 250, [43072.0, 43072.0, 43072.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 220, 175, [2128.0, 2128.0, 2128.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 250, 150, [10632.0, 10632.0, 10632.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 220, 190, [2128.0, 2128.0, 2128.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 285, 135, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 285, 165, [43072.0, 43072.0, 43072.0, 1.0], eps=eps) + + self.check_pixel_value(overlay_id, 330, 145, [531.0, 531.0, 531.0, 531.0], eps=eps) + self.check_pixel_value(overlay_id, 340, 145, [0.0, 0.0, 0.0, 0.0], eps=eps) + + eps = 0.01 + + self.check_pixel_value(overlay_id, 200, 51, [8.305, 8.305, 8.305, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 65, [5.316, 5.316, 5.316, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 79, [3.0, 3.0, 3.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 93, [1.33, 1.33, 1.33, 1.0], eps=eps) + + rdtest.log.success("Picked pixels are as expected for {}".format(str(overlay))) + + if is_msaa: + rdtest.log.success("All MSAA overlays are as expected") + else: + rdtest.log.success("All normal overlays are as expected") + + # Check the viewport overlay especially + view_marker: rd.ActionDescription = self.find_action("Viewport Test " + fmt, base_event) + + self.controller.SetFrameEvent(view_marker.next.eventId, True) pipe: rd.PipeState = self.controller.GetPipelineState() col_tex: rd.ResourceId = pipe.GetOutputTargets()[0].resourceId - tex = rd.TextureDisplay() - tex.resourceId = col_tex - tex.subresource.sample = 0 - - # Background around the outside - self.check_pixel_value(col_tex, 0.1, 0.1, [0.2, 0.2, 0.2, 1.0]) - self.check_pixel_value(col_tex, 0.8, 0.1, [0.2, 0.2, 0.2, 1.0]) - self.check_pixel_value(col_tex, 0.5, 0.95, [0.2, 0.2, 0.2, 1.0]) - - # Large dark grey triangle - self.check_pixel_value(col_tex, 0.5, 0.1, [0.1, 0.1, 0.1, 1.0]) - self.check_pixel_value(col_tex, 0.5, 0.9, [0.1, 0.1, 0.1, 1.0]) - self.check_pixel_value(col_tex, 0.2, 0.9, [0.1, 0.1, 0.1, 1.0]) - self.check_pixel_value(col_tex, 0.8, 0.9, [0.1, 0.1, 0.1, 1.0]) - - # Red upper half triangle - self.check_pixel_value(col_tex, 0.3, 0.4, [1.0, 0.0, 0.0, 1.0]) - # Blue lower half triangle - self.check_pixel_value(col_tex, 0.3, 0.6, [0.0, 0.0, 1.0, 1.0]) - - # Floating clipped triangle - self.check_pixel_value(col_tex, 335, 140, [0.0, 0.0, 0.0, 1.0]) - self.check_pixel_value(col_tex, 340, 140, [0.2, 0.2, 0.2, 1.0]) - - # Triangle size triangles - self.check_pixel_value(col_tex, 200, 51, [1.0, 0.5, 1.0, 1.0]) - self.check_pixel_value(col_tex, 200, 65, [1.0, 1.0, 0.0, 1.0]) - self.check_pixel_value(col_tex, 200, 79, [0.0, 1.0, 1.0, 1.0]) - self.check_pixel_value(col_tex, 200, 93, [0.0, 1.0, 0.0, 1.0]) - for overlay in rd.DebugOverlay: if overlay == rd.DebugOverlay.NoOverlay: continue @@ -69,8 +426,9 @@ class Overlay_Test(rdtest.TestCase): if overlay == rd.DebugOverlay.ClearBeforeDraw or overlay == rd.DebugOverlay.ClearBeforePass: continue - rdtest.log.print("Checking overlay {} in {} main action".format("MSAA" if is_msaa else "normal", str(overlay))) + rdtest.log.print("Checking overlay {} in viewport action Format {}".format(str(overlay), fmt)) + tex.resourceId = col_tex tex.overlay = overlay out.SetTextureDisplay(tex) @@ -80,344 +438,105 @@ class Overlay_Test(rdtest.TestCase): overlay_id: rd.ResourceId = out.GetDebugOverlayTexID() - # We test a few key spots: - # 4 points along the left side of the big triangle, above/in/below its intersection with the tri behind - # 4 points outside all triangles - # The overlap between the big tri and the bottom tri, and between it and the right backface culled tri - # The bottom tri's part that sticks out - # The two parts of the backface culled tri that stick out - # The depth clipped tri, in and out of clipping - # The 4 triangle size test triangles + save_data = rd.TextureSave() + save_data.resourceId = overlay_id + save_data.destType = rd.FileType.PNG + + self.controller.SaveTexture(save_data, rdtest.get_tmp_path('overlay.png')) if overlay == rd.DebugOverlay.Drawcall: - self.check_pixel_value(overlay_id, 150, 90, [0.8, 0.1, 0.8, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 130, [0.8, 0.1, 0.8, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 160, [0.8, 0.1, 0.8, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 200, [0.8, 0.1, 0.8, 1.0], eps=eps) + # The action overlay will show up outside the scissor region + self.check_pixel_value(overlay_id, 50, 85, [0.8, 0.1, 0.8, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 50, 50, [0.8, 0.1, 0.8, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 50, 10, [0.8, 0.1, 0.8, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 85, 85, [0.8, 0.1, 0.8, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.5], eps=eps) - self.check_pixel_value(overlay_id, 125, 250, [0.0, 0.0, 0.0, 0.5], eps=eps) - self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.5], eps=eps) - self.check_pixel_value(overlay_id, 250, 250, [0.0, 0.0, 0.0, 0.5], eps=eps) - - self.check_pixel_value(overlay_id, 220, 175, [0.8, 0.1, 0.8, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 150, [0.8, 0.1, 0.8, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 220, 190, [0.8, 0.1, 0.8, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 285, 135, [0.8, 0.1, 0.8, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 285, 165, [0.8, 0.1, 0.8, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 330, 145, [0.8, 0.1, 0.8, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 340, 145, [0.8, 0.1, 0.8, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 200, 51, [0.8, 0.1, 0.8, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 65, [0.8, 0.1, 0.8, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 79, [0.8, 0.1, 0.8, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 93, [0.8, 0.1, 0.8, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 50, 5, [0.0, 0.0, 0.0, 0.5], eps=eps) + self.check_pixel_value(overlay_id, 95, 85, [0.0, 0.0, 0.0, 0.5], eps=eps) + self.check_pixel_value(overlay_id, 80, 30, [0.0, 0.0, 0.0, 0.5], eps=eps) elif overlay == rd.DebugOverlay.Wireframe: # Wireframe we only test a limited set to avoid hitting implementation variations of line raster # We also have to fudge a little because the lines might land on adjacent pixels - # Also to be safe we don't run this test on MSAA - if not is_msaa: - x = 142 - picked: rd.PixelValue = self.controller.PickPixel(overlay_id, x, 150, rd.Subresource(), rd.CompType.Typeless) - if picked.floatValue[3] == 0.0: - x = 141 - picked: rd.PixelValue = self.controller.PickPixel(overlay_id, x, 150, rd.Subresource(), rd.CompType.Typeless) - self.check_pixel_value(overlay_id, x, 90, [200.0/255.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, x, 130, [200.0/255.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, x, 160, [200.0/255.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, x, 200, [200.0/255.0, 1.0, 0.0, 1.0], eps=eps) + found = False - self.check_pixel_value(overlay_id, 125, 60, [200.0/255.0, 1.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 125, 250, [200.0/255.0, 1.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 60, [200.0/255.0, 1.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 250, [200.0/255.0, 1.0, 0.0, 0.0], eps=eps) + for delta in range(0, 5): + try: + self.check_pixel_value(overlay_id, 30 + delta, 32, [200.0 / 255.0, 1.0, 0.0, 1.0], eps=eps) + found = True + break + except rdtest.TestFailureException: + pass - y = 149 - picked: rd.PixelValue = self.controller.PickPixel(overlay_id, 325, y, rd.Subresource(), rd.CompType.Typeless) - if picked.floatValue[3] == 0.0: - y = 150 + if not found: + raise rdtest.TestFailureException("Couldn't find wireframe within scissor") - self.check_pixel_value(overlay_id, 325, y, [200.0/255.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 340, y, [200.0/255.0, 1.0, 0.0, 1.0], eps=eps) - elif overlay == rd.DebugOverlay.Depth: - self.check_pixel_value(overlay_id, 150, 90, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 130, [0.0, 1.0, 0.0, 1.0], eps=eps) - # Intersection with lesser depth - depth fail - self.check_pixel_value(overlay_id, 150, 160, [1.0, 0.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 200, [0.0, 1.0, 0.0, 1.0], eps=eps) + found = False - self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 125, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) + for delta in range(0, 5): + try: + self.check_pixel_value(overlay_id, 34 + delta, 22, [200.0 / 255.0, 1.0, 0.0, 1.0], eps=eps) + found = True + break + except rdtest.TestFailureException: + pass - self.check_pixel_value(overlay_id, 220, 175, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 150, [0.0, 1.0, 0.0, 1.0], eps=eps) + if found: + raise rdtest.TestFailureException("Found wireframe outside of scissor") + elif overlay == rd.DebugOverlay.Depth or overlay == rd.DebugOverlay.Stencil or overlay == rd.DebugOverlay.BackfaceCull: + self.check_pixel_value(overlay_id, 50, 25, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 50, 75, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 220, 190, [0.0, 1.0, 0.0, 1.0], eps=eps) - - # Backface culled triangle - self.check_pixel_value(overlay_id, 285, 135, [1.0, 0.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 285, 165, [1.0, 0.0, 0.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 330, 145, [0.0, 1.0, 0.0, 1.0], eps=eps) - # Depth clipped part of tri - self.check_pixel_value(overlay_id, 340, 145, [1.0, 0.0, 0.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 200, 51, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 65, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 79, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 93, [0.0, 1.0, 0.0, 1.0], eps=eps) - elif overlay == rd.DebugOverlay.Stencil: - self.check_pixel_value(overlay_id, 150, 90, [0.0, 1.0, 0.0, 1.0], eps=eps) - # Intersection with different stencil - stencil fail - self.check_pixel_value(overlay_id, 150, 130, [1.0, 0.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 160, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 200, [0.0, 1.0, 0.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 125, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) - - self.check_pixel_value(overlay_id, 220, 175, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 150, [0.0, 1.0, 0.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 220, 190, [0.0, 1.0, 0.0, 1.0], eps=eps) - - # Backface culled triangle - self.check_pixel_value(overlay_id, 285, 135, [1.0, 0.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 285, 165, [1.0, 0.0, 0.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 330, 145, [0.0, 1.0, 0.0, 1.0], eps=eps) - # Depth clipped part of tri - self.check_pixel_value(overlay_id, 340, 145, [1.0, 0.0, 0.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 200, 51, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 65, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 79, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 93, [0.0, 1.0, 0.0, 1.0], eps=eps) - elif overlay == rd.DebugOverlay.BackfaceCull: - self.check_pixel_value(overlay_id, 150, 90, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 130, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 160, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 200, [0.0, 1.0, 0.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 125, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) - - self.check_pixel_value(overlay_id, 220, 175, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 150, [0.0, 1.0, 0.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 220, 190, [0.0, 1.0, 0.0, 1.0], eps=eps) - - # Backface culled triangle - self.check_pixel_value(overlay_id, 285, 135, [1.0, 0.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 285, 165, [1.0, 0.0, 0.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 330, 145, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 340, 145, [0.0, 1.0, 0.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 200, 51, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 65, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 79, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 93, [0.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 50, 20, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(overlay_id, 50, 80, [0.0, 0.0, 0.0, 0.0], eps=eps) elif overlay == rd.DebugOverlay.ViewportScissor: - # Inside viewport - self.check_pixel_value(overlay_id, 50, 50, [0.2 * 0.4, 0.2 * 0.4, 0.9 * 0.4, 0.4 * 0.4], eps=eps) - self.check_pixel_value(overlay_id, 350, 50, [0.2 * 0.4, 0.2 * 0.4, 0.9 * 0.4, 0.4 * 0.4], eps=eps) - self.check_pixel_value(overlay_id, 50, 250, [0.2 * 0.4, 0.2 * 0.4, 0.9 * 0.4, 0.4 * 0.4], eps=eps) - self.check_pixel_value(overlay_id, 350, 250, [0.2 * 0.4, 0.2 * 0.4, 0.9 * 0.4, 0.4 * 0.4], eps=eps) - - # Passing triangle inside the viewport - self.check_pixel_value(overlay_id, 200, 150, + # Inside viewport and scissor, passing triangle + self.check_pixel_value(overlay_id, 50, 50, [0.2 * 0.4, 1.0 * 0.6 + 0.2 * 0.4, 0.9 * 0.4, 1.0 * 0.6 + 0.4 * 0.4], eps=eps) - # Viewport border - self.check_pixel_value(overlay_id, 12, 12, [0.1, 0.1, 0.1, 1.0], eps=eps) - - # Outside viewport (not on scissor border) - self.check_pixel_value(overlay_id, 6, 6, [0.0, 0.0, 0.0, 0.0], eps=eps) - - # Scissor border - self.check_pixel_value(overlay_id, 0, 0, [1.0, 1.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 20, 0, [0.0, 0.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 40, 0, [1.0, 1.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 60, 0, [0.0, 0.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 60, 0, [0.0, 0.0, 0.0, 1.0], eps=eps) + # Inside viewport and outside scissor + self.check_pixel_value(overlay_id, 50, 80, + [1.0 * 0.6 + 0.2 * 0.4, 0.2 * 0.4, 0.9 * 0.4, 1.0 * 0.6 + 0.4 * 0.4], eps=eps) elif overlay == rd.DebugOverlay.QuadOverdrawDraw: - # This would require extreme command buffer patching to de-MSAA the framebuffer and renderpass - if api == rd.GraphicsAPI.Vulkan and is_msaa: - rdtest.log.print("Quad overdrawnot currently supported on MSAA on Vulkan") - continue - - self.check_pixel_value(overlay_id, 150, 90, [1.0, 1.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 130, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 160, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 200, [1.0, 1.0, 1.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 125, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) - - self.check_pixel_value(overlay_id, 220, 175, [2.0, 2.0, 2.0, 2.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 150, [1.0, 1.0, 1.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 220, 190, [1.0, 1.0, 1.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 285, 135, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 285, 165, [0.0, 0.0, 0.0, 0.0], eps=eps) - - self.check_pixel_value(overlay_id, 330, 145, [1.0, 1.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 340, 145, [0.0, 0.0, 0.0, 0.0], eps=eps) - - self.check_pixel_value(overlay_id, 200, 51, [1.0, 1.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 65, [1.0, 1.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 79, [1.0, 1.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 93, [1.0, 1.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 50, 50, [1.0, 1.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 50, 15, [0.0, 0.0, 0.0, 0.0], eps=eps) elif overlay == rd.DebugOverlay.QuadOverdrawPass: - # This would require extreme command buffer patching to de-MSAA the framebuffer and renderpass - if api == rd.GraphicsAPI.Vulkan and is_msaa: - rdtest.log.print("Quad overdraw not currently supported on MSAA on Vulkan") - continue + self.check_pixel_value(overlay_id, 50, 50, [1.0, 1.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 50, 15, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 90, [1.0, 1.0, 1.0, 1.0], eps=eps) - - # Do an extra tap here where we overlap with the extreme-background largest triangle, to show that - # overdraw - self.check_pixel_value(overlay_id, 150, 100, [2.0, 2.0, 2.0, 2.0], eps=eps) - - self.check_pixel_value(overlay_id, 150, 130, [1.0, 1.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 160, [1.0, 1.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 200, [2.0, 2.0, 2.0, 2.0], eps=eps) - - # Two of these have overdraw from the pass due to the large background triangle - self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 125, 250, [1.0, 1.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 250, [1.0, 1.0, 1.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 220, 175, [3.0, 3.0, 3.0, 3.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 150, [2.0, 2.0, 2.0, 2.0], eps=eps) - - self.check_pixel_value(overlay_id, 220, 190, [2.0, 2.0, 2.0, 2.0], eps=eps) - - self.check_pixel_value(overlay_id, 285, 135, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 285, 165, [1.0, 1.0, 1.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 330, 145, [1.0, 1.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 340, 145, [0.0, 0.0, 0.0, 0.0], eps=eps) - - self.check_pixel_value(overlay_id, 200, 51, [2.0, 2.0, 2.0, 2.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 65, [2.0, 2.0, 2.0, 2.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 79, [2.0, 2.0, 2.0, 2.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 93, [2.0, 2.0, 2.0, 2.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 270, [1.0, 1.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 280, [0.0, 0.0, 0.0, 0.0], eps=eps) elif overlay == rd.DebugOverlay.TriangleSizeDraw: eps = 1.0 - self.check_pixel_value(overlay_id, 150, 90, [10632.0, 10632.0, 10632.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 130, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 160, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 200, [10632.0, 10632.0, 10632.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 125, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) - - self.check_pixel_value(overlay_id, 220, 175, [2128.0, 2128.0, 2128.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 150, [10632.0, 10632.0, 10632.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 220, 190, [2128.0, 2128.0, 2128.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 285, 135, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 285, 165, [0.0, 0.0, 0.0, 0.0], eps=eps) - - self.check_pixel_value(overlay_id, 330, 145, [531.0, 531.0, 531.0, 531.0], eps=eps) - self.check_pixel_value(overlay_id, 340, 145, [0.0, 0.0, 0.0, 0.0], eps=eps) - - eps = 0.01 - - self.check_pixel_value(overlay_id, 200, 51, [8.305, 8.305, 8.305, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 65, [5.316, 5.316, 5.316, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 79, [3.0, 3.0, 3.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 93, [1.33, 1.33, 1.33, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 50, 50, [5408.0, 5408.0, 5408.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 50, 15, [0.0, 0.0, 0.0, 0.0], eps=eps) elif overlay == rd.DebugOverlay.TriangleSizePass: eps = 1.0 - self.check_pixel_value(overlay_id, 150, 90, [10632.0, 10632.0, 10632.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 130, [3324.0, 3324.0, 3324.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 160, [3324.0, 3324.0, 3324.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 150, 200, [10632.0, 10632.0, 10632.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 50, 50, [5408.0, 5408.0, 5408.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 50, 15, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 125, 250, [43072.0, 43072.0, 43072.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 250, [43072.0, 43072.0, 43072.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 220, 175, [2128.0, 2128.0, 2128.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 250, 150, [10632.0, 10632.0, 10632.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 220, 190, [2128.0, 2128.0, 2128.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 285, 135, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 285, 165, [43072.0, 43072.0, 43072.0, 1.0], eps=eps) - - self.check_pixel_value(overlay_id, 330, 145, [531.0, 531.0, 531.0, 531.0], eps=eps) - self.check_pixel_value(overlay_id, 340, 145, [0.0, 0.0, 0.0, 0.0], eps=eps) - - eps = 0.01 - - self.check_pixel_value(overlay_id, 200, 51, [8.305, 8.305, 8.305, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 65, [5.316, 5.316, 5.316, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 79, [3.0, 3.0, 3.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 93, [1.33, 1.33, 1.33, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 270, [43072.0, 43072.0, 43072.0, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 200, 280, [0.0, 0.0, 0.0, 0.0], eps=eps) rdtest.log.success("Picked pixels are as expected for {}".format(str(overlay))) - if is_msaa: - rdtest.log.success("All MSAA overlays are as expected") - else: - rdtest.log.success("All normal overlays are as expected") + rdtest.log.success("Overlays are as expected around viewport/scissor behaviour") - # Check the viewport overlay especially - view_marker: rd.ActionDescription = self.find_action("Viewport Test", base_event) + # Check the sample mask test + mask_marker: rd.ActionDescription = self.find_action("Sample Mask Test " + fmt, base_event) - self.controller.SetFrameEvent(view_marker.next.eventId, True) + self.controller.SetFrameEvent(mask_marker.next.eventId, True) - pipe: rd.PipeState = self.controller.GetPipelineState() - - col_tex: rd.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 - - # We'll test the clear-before-X overlays seperately, for both colour and depth - if overlay == rd.DebugOverlay.ClearBeforeDraw or overlay == rd.DebugOverlay.ClearBeforePass: - continue - - rdtest.log.print("Checking overlay {} in viewport action".format(str(overlay))) + col_tex: rd.ResourceId = pipe.GetOutputTargets()[0].resourceId + # Check just highlight drawcall to make sure it renders on sample 0 tex.resourceId = col_tex - tex.overlay = overlay + tex.overlay = rd.DebugOverlay.Drawcall out.SetTextureDisplay(tex) - out.Display() - eps = 1.0 / 256.0 - overlay_id: rd.ResourceId = out.GetDebugOverlayTexID() save_data = rd.TextureSave() @@ -426,219 +545,148 @@ class Overlay_Test(rdtest.TestCase): self.controller.SaveTexture(save_data, rdtest.get_tmp_path('overlay.png')) - if overlay == rd.DebugOverlay.Drawcall: - # The action overlay will show up outside the scissor region - self.check_pixel_value(overlay_id, 50, 85, [0.8, 0.1, 0.8, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 50, 50, [0.8, 0.1, 0.8, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 50, 10, [0.8, 0.1, 0.8, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 85, 85, [0.8, 0.1, 0.8, 1.0], eps=eps) + eps = 1.0/256.0 - self.check_pixel_value(overlay_id, 50, 5, [0.0, 0.0, 0.0, 0.5], eps=eps) - self.check_pixel_value(overlay_id, 95, 85, [0.0, 0.0, 0.0, 0.5], eps=eps) - self.check_pixel_value(overlay_id, 80, 30, [0.0, 0.0, 0.0, 0.5], eps=eps) - elif overlay == rd.DebugOverlay.Wireframe: - # Wireframe we only test a limited set to avoid hitting implementation variations of line raster - # We also have to fudge a little because the lines might land on adjacent pixels + self.check_pixel_value(overlay_id, 40, 15, [0.8, 0.1, 0.8, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 40, 70, [0.8, 0.1, 0.8, 1.0], eps=eps) + self.check_pixel_value(overlay_id, 40, 1, [0.0, 0.0, 0.0, 0.5], eps=eps) + self.check_pixel_value(overlay_id, 40, 90, [0.0, 0.0, 0.0, 0.5], eps=eps) - found = False + rdtest.log.success("Overlays are as expected around sample mask behaviour Format {}".format(fmt)) - for delta in range(0, 5): - try: - self.check_pixel_value(overlay_id, 30 + delta, 32, [200.0 / 255.0, 1.0, 0.0, 1.0], eps=eps) - found = True - break - except rdtest.TestFailureException: - pass + test_marker: rd.ActionDescription = self.find_action("Normal Test " + fmt, base_event) - if not found: - raise rdtest.TestFailureException("Couldn't find wireframe within scissor") + # Now check clear-before-X by hand, for colour and for depth + self.controller.SetFrameEvent(test_marker.next.eventId, True) - found = False + col_tex: rd.ResourceId = pipe.GetOutputTargets()[0].resourceId - for delta in range(0, 5): - try: - self.check_pixel_value(overlay_id, 34 + delta, 22, [200.0 / 255.0, 1.0, 0.0, 1.0], eps=eps) - found = True - break - except rdtest.TestFailureException: - pass + depth_tex: rd.ResourceId = pipe.GetDepthTarget().resourceId - if found: - raise rdtest.TestFailureException("Found wireframe outside of scissor") - elif overlay == rd.DebugOverlay.Depth or overlay == rd.DebugOverlay.Stencil or overlay == rd.DebugOverlay.BackfaceCull: - self.check_pixel_value(overlay_id, 50, 25, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 50, 75, [0.0, 1.0, 0.0, 1.0], eps=eps) + eps = 1.0/256.0 - self.check_pixel_value(overlay_id, 50, 20, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(overlay_id, 50, 80, [0.0, 0.0, 0.0, 0.0], eps=eps) - elif overlay == rd.DebugOverlay.ViewportScissor: - # Inside viewport and scissor, passing triangle - self.check_pixel_value(overlay_id, 50, 50, - [0.2 * 0.4, 1.0 * 0.6 + 0.2 * 0.4, 0.9 * 0.4, 1.0 * 0.6 + 0.4 * 0.4], eps=eps) + # Check colour and depth before-hand + self.check_pixel_value(col_tex, 250, 250, [0.1, 0.1, 0.1, 1.0], eps=eps) + if has_stencil: + self.check_pixel_value(col_tex, 125, 125, [1.0, 0.0, 0.0, 1.0], eps=eps) + else: + self.check_pixel_value(col_tex, 125, 125, [0.2, 0.2, 0.2, 1.0], eps=eps) + self.check_pixel_value(col_tex, 125, 175, [0.0, 0.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(col_tex, 50, 50, [0.2, 0.2, 0.2, 1.0], eps=eps) + self.check_pixel_value(col_tex, 291, 150, [0.977, 0.977, 0.977, 1.0], eps=0.075) + self.check_pixel_value(col_tex, 200, 51, [1.0, 0.5, 1.0, 1.0], eps=eps) + self.check_pixel_value(col_tex, 200, 65, [1.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(col_tex, 200, 79, [0.0, 1.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(col_tex, 200, 93, [0.0, 1.0, 0.0, 1.0], eps=eps) - # Inside viewport and outside scissor - self.check_pixel_value(overlay_id, 50, 80, - [1.0 * 0.6 + 0.2 * 0.4, 0.2 * 0.4, 0.9 * 0.4, 1.0 * 0.6 + 0.4 * 0.4], eps=eps) - elif overlay == rd.DebugOverlay.QuadOverdrawDraw: - self.check_pixel_value(overlay_id, 50, 50, [1.0, 1.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 50, 15, [0.0, 0.0, 0.0, 0.0], eps=eps) - elif overlay == rd.DebugOverlay.QuadOverdrawPass: - self.check_pixel_value(overlay_id, 50, 50, [1.0, 1.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 50, 15, [0.0, 0.0, 0.0, 0.0], eps=eps) + eps = 0.001 - self.check_pixel_value(overlay_id, 200, 270, [1.0, 1.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 280, [0.0, 0.0, 0.0, 0.0], eps=eps) - elif overlay == rd.DebugOverlay.TriangleSizeDraw: - eps = 1.0 + if has_stencil: + self.check_pixel_value(depth_tex, 180, 160, [0.0, 0.0/255.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 160, 135, [0.9, 85.0/255.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 160, 165, [0.0, 0.0/255.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 250, 150, [0.5, 85.0/255.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 250, 250, [0.95, 0.0/255.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 50, 50, [1.0, 0.0/255.0, 0.0, 1.0], eps=eps) + else: + self.check_pixel_value(depth_tex, 180, 160, [0.0, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 160, 135, [0.49999, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 160, 165, [0.0, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 250, 150, [0.5, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 250, 250, [0.95, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 50, 50, [1.0, 0.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 50, 50, [5408.0, 5408.0, 5408.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 50, 15, [0.0, 0.0, 0.0, 0.0], eps=eps) - elif overlay == rd.DebugOverlay.TriangleSizePass: - eps = 1.0 + rdtest.log.success("Colour and depth at end are correct") - self.check_pixel_value(overlay_id, 50, 50, [5408.0, 5408.0, 5408.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 50, 15, [0.0, 0.0, 0.0, 0.0], eps=eps) + # Check clear before pass + tex.resourceId = col_tex + tex.overlay = rd.DebugOverlay.ClearBeforePass + out.SetTextureDisplay(tex) + out.Display() - self.check_pixel_value(overlay_id, 200, 270, [43072.0, 43072.0, 43072.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 200, 280, [0.0, 0.0, 0.0, 0.0], eps=eps) + eps = 1.0/256.0 - rdtest.log.success("Picked pixels are as expected for {}".format(str(overlay))) + self.check_pixel_value(col_tex, 250, 250, [0.1, 0.1, 0.1, 1.0], eps=eps) + if has_stencil: + self.check_pixel_value(col_tex, 125, 125, [1.0, 0.0, 0.0, 1.0], eps=eps) + else: + self.check_pixel_value(col_tex, 125, 125, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(col_tex, 125, 175, [0.0, 0.0, 1.0, 1.0], eps=eps) - rdtest.log.success("Overlays are as expected around viewport/scissor behaviour") + self.check_pixel_value(col_tex, 50, 50, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(col_tex, 291, 150, [0.977, 0.977, 0.977, 1.0], eps=0.075) + self.check_pixel_value(col_tex, 200, 51, [1.0, 0.5, 1.0, 1.0], eps=eps) + self.check_pixel_value(col_tex, 200, 65, [1.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(col_tex, 200, 79, [0.0, 1.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(col_tex, 200, 93, [0.0, 1.0, 0.0, 1.0], eps=eps) - # Check the sample mask test - mask_marker: rd.ActionDescription = self.find_action("Sample Mask Test", base_event) + tex.resourceId = depth_tex + tex.overlay = rd.DebugOverlay.ClearBeforePass + out.SetTextureDisplay(tex) + out.Display() - self.controller.SetFrameEvent(mask_marker.next.eventId, True) + eps = 0.001 - col_tex: rd.ResourceId = pipe.GetOutputTargets()[0].resourceId + if has_stencil: + self.check_pixel_value(depth_tex, 160, 135, [0.9, 85.0/255.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 160, 165, [0.0, 0.0/255.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 250, 150, [0.5, 85.0/255.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 250, 250, [0.95, 0.0/255.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 50, 50, [1.0, 0.0/255.0, 0.0, 1.0], eps=eps) + else: + self.check_pixel_value(depth_tex, 160, 135, [0.49999, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 160, 165, [0.0, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 250, 150, [0.5, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 250, 250, [0.95, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 50, 50, [1.0, 0.0, 0.0, 1.0], eps=eps) - # Check just highlight drawcall to make sure it renders on sample 0 - tex.resourceId = col_tex - tex.overlay = rd.DebugOverlay.Drawcall - out.SetTextureDisplay(tex) - out.Display() + rdtest.log.success("Clear before pass colour and depth values as expected") - overlay_id: rd.ResourceId = out.GetDebugOverlayTexID() + # Check clear before action + tex.resourceId = col_tex + tex.overlay = rd.DebugOverlay.ClearBeforeDraw + out.SetTextureDisplay(tex) + out.Display() - save_data = rd.TextureSave() - save_data.resourceId = overlay_id - save_data.destType = rd.FileType.PNG + eps = 1.0/256.0 - self.controller.SaveTexture(save_data, rdtest.get_tmp_path('overlay.png')) + # These are all pass triangles, should be cleared + self.check_pixel_value(col_tex, 250, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(col_tex, 125, 125, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(col_tex, 125, 175, [0.0, 0.0, 0.0, 0.0], eps=eps) + self.check_pixel_value(col_tex, 50, 50, [0.0, 0.0, 0.0, 0.0], eps=eps) - eps = 1.0/256.0 + # These should be identical + self.check_pixel_value(col_tex, 291, 150, [0.977, 0.977, 0.977, 1.0], eps=0.075) + self.check_pixel_value(col_tex, 200, 51, [1.0, 0.5, 1.0, 1.0], eps=eps) + self.check_pixel_value(col_tex, 200, 65, [1.0, 1.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(col_tex, 200, 79, [0.0, 1.0, 1.0, 1.0], eps=eps) + self.check_pixel_value(col_tex, 200, 93, [0.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 40, 15, [0.8, 0.1, 0.8, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 40, 70, [0.8, 0.1, 0.8, 1.0], eps=eps) - self.check_pixel_value(overlay_id, 40, 1, [0.0, 0.0, 0.0, 0.5], eps=eps) - self.check_pixel_value(overlay_id, 40, 90, [0.0, 0.0, 0.0, 0.5], eps=eps) + tex.resourceId = depth_tex + tex.overlay = rd.DebugOverlay.ClearBeforeDraw + out.SetTextureDisplay(tex) + out.Display() - rdtest.log.success("Overlays are as expected around sample mask behaviour") + eps = 0.001 - test_marker: rd.ActionDescription = self.find_action("Normal Test", base_event) + # Without the pass, depth/stencil results are different + if has_stencil: + self.check_pixel_value(depth_tex, 160, 135, [0.5, 85.0/255.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 160, 165, [0.5, 85.0/255.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 250, 150, [0.5, 85.0/255.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 250, 250, [1.0, 0.0/255.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 50, 50, [1.0, 0.0/255.0, 0.0, 1.0], eps=eps) + else: + self.check_pixel_value(depth_tex, 160, 135, [0.49999, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 160, 165, [0.5, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 250, 150, [0.5, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 250, 250, [1.0, 0.0, 0.0, 1.0], eps=eps) + self.check_pixel_value(depth_tex, 50, 50, [1.0, 0.0, 0.0, 1.0], eps=eps) - # Now check clear-before-X by hand, for colour and for depth - self.controller.SetFrameEvent(test_marker.next.eventId, True) + rdtest.log.success("Clear before action colour and depth values as expected") - col_tex: rd.ResourceId = pipe.GetOutputTargets()[0].resourceId - - depth_tex: rd.ResourceId = pipe.GetDepthTarget().resourceId - - eps = 1.0/256.0 - - # Check colour and depth before-hand - self.check_pixel_value(col_tex, 250, 250, [0.1, 0.1, 0.1, 1.0], eps=eps) - self.check_pixel_value(col_tex, 125, 125, [1.0, 0.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(col_tex, 125, 175, [0.0, 0.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(col_tex, 50, 50, [0.2, 0.2, 0.2, 1.0], eps=eps) - self.check_pixel_value(col_tex, 291, 150, [0.977, 0.977, 0.977, 1.0], eps=0.075) - self.check_pixel_value(col_tex, 200, 51, [1.0, 0.5, 1.0, 1.0], eps=eps) - self.check_pixel_value(col_tex, 200, 65, [1.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(col_tex, 200, 79, [0.0, 1.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(col_tex, 200, 93, [0.0, 1.0, 0.0, 1.0], eps=eps) - - eps = 0.001 - - self.check_pixel_value(depth_tex, 160, 135, [0.9, 85.0/255.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(depth_tex, 160, 165, [0.0, 0.0/255.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(depth_tex, 250, 150, [0.5, 85.0/255.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(depth_tex, 250, 250, [0.95, 0.0/255.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(depth_tex, 50, 50, [1.0, 0.0/255.0, 0.0, 1.0], eps=eps) - - rdtest.log.success("Colour and depth at end are correct") - - # Check clear before pass - tex.resourceId = col_tex - tex.overlay = rd.DebugOverlay.ClearBeforePass - out.SetTextureDisplay(tex) - out.Display() - - eps = 1.0/256.0 - - self.check_pixel_value(col_tex, 250, 250, [0.1, 0.1, 0.1, 1.0], eps=eps) - self.check_pixel_value(col_tex, 125, 125, [1.0, 0.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(col_tex, 125, 175, [0.0, 0.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(col_tex, 50, 50, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(col_tex, 291, 150, [0.977, 0.977, 0.977, 1.0], eps=0.075) - self.check_pixel_value(col_tex, 200, 51, [1.0, 0.5, 1.0, 1.0], eps=eps) - self.check_pixel_value(col_tex, 200, 65, [1.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(col_tex, 200, 79, [0.0, 1.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(col_tex, 200, 93, [0.0, 1.0, 0.0, 1.0], eps=eps) - - tex.resourceId = depth_tex - tex.overlay = rd.DebugOverlay.ClearBeforePass - out.SetTextureDisplay(tex) - out.Display() - - eps = 0.001 - - self.check_pixel_value(depth_tex, 160, 135, [0.9, 85.0/255.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(depth_tex, 160, 165, [0.0, 0.0/255.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(depth_tex, 250, 150, [0.5, 85.0/255.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(depth_tex, 250, 250, [0.95, 0.0/255.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(depth_tex, 50, 50, [1.0, 0.0/255.0, 0.0, 1.0], eps=eps) - - rdtest.log.success("Clear before pass colour and depth values as expected") - - # Check clear before action - tex.resourceId = col_tex - tex.overlay = rd.DebugOverlay.ClearBeforeDraw - out.SetTextureDisplay(tex) - out.Display() - - eps = 1.0/256.0 - - # These are all pass triangles, should be cleared - self.check_pixel_value(col_tex, 250, 250, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(col_tex, 125, 125, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(col_tex, 125, 175, [0.0, 0.0, 0.0, 0.0], eps=eps) - self.check_pixel_value(col_tex, 50, 50, [0.0, 0.0, 0.0, 0.0], eps=eps) - - # These should be identical - self.check_pixel_value(col_tex, 291, 150, [0.977, 0.977, 0.977, 1.0], eps=0.075) - self.check_pixel_value(col_tex, 200, 51, [1.0, 0.5, 1.0, 1.0], eps=eps) - self.check_pixel_value(col_tex, 200, 65, [1.0, 1.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(col_tex, 200, 79, [0.0, 1.0, 1.0, 1.0], eps=eps) - self.check_pixel_value(col_tex, 200, 93, [0.0, 1.0, 0.0, 1.0], eps=eps) - - tex.resourceId = depth_tex - tex.overlay = rd.DebugOverlay.ClearBeforeDraw - out.SetTextureDisplay(tex) - out.Display() - - eps = 0.001 - - # Without the pass, depth/stencil results are different - self.check_pixel_value(depth_tex, 160, 135, [0.5, 85.0/255.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(depth_tex, 160, 165, [0.5, 85.0/255.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(depth_tex, 250, 150, [0.5, 85.0/255.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(depth_tex, 250, 250, [1.0, 0.0/255.0, 0.0, 1.0], eps=eps) - self.check_pixel_value(depth_tex, 50, 50, [1.0, 0.0/255.0, 0.0, 1.0], eps=eps) - - rdtest.log.success("Clear before action colour and depth values as expected") - - rdtest.log.success("All overlays as expected for main action") + rdtest.log.success("All overlays as expected for main action Format {}".format(fmt)) # Now test overlays on a render-to-slice/mip case for mip in [2, 3]: