mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-13 09:20:13 +00:00
* This lets the testcase track the current EID and print it when a failure happens
84 lines
3.0 KiB
Python
84 lines
3.0 KiB
Python
import rdtest
|
|
|
|
|
|
class D3D12_RenderTarget_Binds(rdtest.TestCase):
|
|
demos_test_name = 'D3D12_RenderTarget_Binds'
|
|
|
|
def check_capture(self):
|
|
# find the clear
|
|
action = self.find_action("ClearRenderTargetView")
|
|
|
|
self.set_event(action.eventId, False)
|
|
|
|
pipe = self.controller.GetPipelineState()
|
|
|
|
self.check_pixel_value(action.copyDestination, 0.5, 0.5, [1.0, 0.0, 1.0, 1.0])
|
|
|
|
assert 'Swapchain' in self.get_resource(action.copyDestination).name
|
|
|
|
rdtest.log.success("Picked value for clear is as expected")
|
|
|
|
action = action.nextAction
|
|
|
|
self.set_event(action.eventId, False)
|
|
|
|
pipe = self.controller.GetPipelineState()
|
|
|
|
rtvs = pipe.GetOutputTargets()
|
|
assert len(rtvs) == 2
|
|
|
|
self.check_triangle(out=rtvs[0].resource, back=[0.0, 1.0, 0.0, 1.0], fore=[1.0, 0.0, 0.0, 1.0])
|
|
self.check_triangle(out=rtvs[1].resource, back=[0.0, 1.0, 0.0, 1.0], fore=[0.0, 0.0, 1.0, 1.0])
|
|
assert self.get_resource(rtvs[0].resource).name == 'TextureA'
|
|
assert self.get_resource(rtvs[1].resource).name == 'TextureB'
|
|
|
|
rdtest.log.success("RTVs at first action are as expected")
|
|
|
|
action = action.nextAction
|
|
|
|
self.set_event(action.eventId, False)
|
|
|
|
pipe = self.controller.GetPipelineState()
|
|
|
|
rtvs = pipe.GetOutputTargets()
|
|
assert len(rtvs) == 2
|
|
|
|
self.check_triangle(out=rtvs[0].resource, back=[0.0, 1.0, 0.0, 1.0], fore=[1.0, 1.0, 0.0, 1.0])
|
|
self.check_triangle(out=rtvs[1].resource, back=[0.0, 1.0, 0.0, 1.0], fore=[0.0, 1.0, 1.0, 1.0])
|
|
assert self.get_resource(rtvs[0].resource).name == 'TextureC'
|
|
assert self.get_resource(rtvs[1].resource).name == 'TextureD'
|
|
|
|
rdtest.log.success("RTVs at second action are as expected")
|
|
|
|
action = action.nextAction
|
|
|
|
self.set_event(action.eventId, False)
|
|
|
|
pipe = self.controller.GetPipelineState()
|
|
|
|
rtvs = pipe.GetOutputTargets()
|
|
assert len(rtvs) == 2
|
|
|
|
self.check_triangle(out=rtvs[0].resource, back=[0.0, 1.0, 0.0, 1.0], fore=[1.0, 0.0, 0.0, 1.0])
|
|
self.check_triangle(out=rtvs[1].resource, back=[0.0, 1.0, 0.0, 1.0], fore=[0.0, 0.0, 1.0, 1.0])
|
|
assert self.get_resource(rtvs[0].resource).name == 'TextureE'
|
|
assert self.get_resource(rtvs[1].resource).name == 'TextureF'
|
|
|
|
rdtest.log.success("RTVs at third action are as expected")
|
|
|
|
action = action.nextAction
|
|
|
|
self.set_event(action.eventId, False)
|
|
|
|
pipe = self.controller.GetPipelineState()
|
|
|
|
rtvs = pipe.GetOutputTargets()
|
|
assert len(rtvs) == 2
|
|
|
|
self.check_triangle(out=rtvs[0].resource, back=[0.0, 1.0, 0.0, 1.0], fore=[1.0, 1.0, 0.0, 1.0])
|
|
self.check_triangle(out=rtvs[1].resource, back=[0.0, 1.0, 0.0, 1.0], fore=[0.0, 1.0, 1.0, 1.0])
|
|
assert self.get_resource(rtvs[0].resource).name == 'TextureG'
|
|
assert self.get_resource(rtvs[1].resource).name == 'TextureH'
|
|
|
|
rdtest.log.success("RTVs at fourth action are as expected")
|