Test overlay rendering with separable shader programs

This commit is contained in:
baldurk
2022-06-17 12:46:28 +01:00
parent 623cd01919
commit fd2ae37a8b
@@ -82,7 +82,30 @@ class GL_Separable_Geometry_Shaders(rdtest.TestCase):
pipe: rd.PipeState = self.controller.GetPipelineState()
out = pipe.GetOutputTargets()[0].resourceId
self.check_pixel_value(out, 0.5, 0.1, [1.0, 0.0, 0.0, 1.0])
self.check_pixel_value(out, 0.75, 0.5, [0.0, 1.0, 0.0, 1.0])
self.check_pixel_value(out, 0.25, 0.5, [1.0, 0.0, 1.0, 0.0])
rt = pipe.GetOutputTargets()[0].resourceId
self.check_pixel_value(rt, 0.5, 0.1, [1.0, 0.0, 0.0, 1.0])
self.check_pixel_value(rt, 0.75, 0.5, [0.0, 1.0, 0.0, 1.0])
self.check_pixel_value(rt, 0.25, 0.5, [1.0, 0.0, 1.0, 0.0])
out: rd.ReplayOutput = self.controller.CreateOutput(rd.CreateHeadlessWindowingData(100, 100), rd.ReplayOutputType.Texture)
tex = rd.TextureDisplay()
tex.resourceId = rt
tex.overlay = rd.DebugOverlay.Drawcall
out.SetTextureDisplay(tex)
out.Display()
eps = 1.0 / 256.0
overlay_id: rd.ResourceId = out.GetDebugOverlayTexID()
self.check_pixel_value(overlay_id, 200, 100, [0.8, 0.1, 0.8, 1.0], eps=eps)
self.check_pixel_value(overlay_id, 50, 150, [0.8, 0.1, 0.8, 1.0], eps=eps)
self.check_pixel_value(overlay_id, 350, 150, [0.8, 0.1, 0.8, 1.0], eps=eps)
self.check_pixel_value(overlay_id, 200, 150, [0.0, 0.0, 0.0, 0.5], eps=eps)
self.check_pixel_value(overlay_id, 200, 225, [0.0, 0.0, 0.0, 0.5], eps=eps)
self.check_pixel_value(overlay_id, 75, 50, [0.0, 0.0, 0.0, 0.5], eps=eps)
self.check_pixel_value(overlay_id, 350, 50, [0.0, 0.0, 0.0, 0.5], eps=eps)
out.Shutdown()