Files
renderdoc/util/test/tests/GL/GL_Depth_Bounds.py
T
baldurk 2a0989ba9a Use local helper function for setting current EID
* This lets the testcase track the current EID and print it when a failure
  happens
2026-09-11 19:19:27 +01:00

31 lines
1.2 KiB
Python

import rdtest
class GL_Depth_Bounds(rdtest.TestCase):
demos_test_name = 'GL_Depth_Bounds'
def check_capture(self):
eid = self.find_action("Test").nextAction.eventId
self.set_event(eid, False)
glpipe = self.controller.GetGLPipelineState()
assert glpipe.depthState.depthBounds
if (not rdtest.value_compare(glpipe.depthState.nearBound, 0.2) or
not rdtest.value_compare(glpipe.depthState.farBound, 0.8)):
raise rdtest.TestFailureException(f"Bounds {glpipe.depthState.nearBound} - {glpipe.depthState.farBound} aren't as expected")
pipe = self.controller.GetPipelineState()
tex = pipe.GetOutputTargets()[0].resource
self.check_pixel_value(tex, 200, 200, [0.0, 1.0, 0.0, 1.0])
self.check_pixel_value(tex, 200, 100, [0.0, 1.0, 0.0, 1.0])
self.check_pixel_value(tex, 125, 100, [1.0, 0.0, 1.0, 1.0])
self.check_pixel_value(tex, 125, 200, [1.0, 0.0, 1.0, 1.0])
self.check_pixel_value(tex, 275, 100, [1.0, 0.0, 1.0, 1.0])
self.check_pixel_value(tex, 275, 200, [1.0, 0.0, 1.0, 1.0])
rdtest.log.success("Triangle is clipped as expected")