mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-20 20:55:42 +00:00
* These come from long ago when using PyCharm with not as good type checking and with renderdoc module stubs that were incomplete so needed help identifying types.
35 lines
1.3 KiB
Python
35 lines
1.3 KiB
Python
import copy
|
|
import rdtest
|
|
import renderdoc as rd
|
|
from typing import Tuple
|
|
|
|
|
|
class GL_Depth_Bounds(rdtest.TestCase):
|
|
demos_test_name = 'GL_Depth_Bounds'
|
|
|
|
def check_capture(self):
|
|
eid = self.find_action("Test").nextAction.eventId
|
|
self.controller.SetFrameEvent(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("Bounds {} - {} aren't as expected"
|
|
.format(glpipe.depthState.nearBound, glpipe.depthState.farBound))
|
|
|
|
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")
|