Files
renderdoc/util/test/tests/GL/GL_Multithread_Rendering.py
T
baldurk 7149302680 Rename 'draw' or 'drawcall' to action
* There's not a good accepted terminology for this kind of event, and for
  historical reasons 'drawcall' has been the accepted term, even though
  that can be quite confusing when a dispatch or a copy is a 'drawcall'.
* This is particularly highlighted by the event browser filters where
  $draw() includes draws and dispatches, but $dispatch() only includes
  dispatches, it's hard to intuitively understand why $draw() matches all
  of these calls.
* As a result we've defined the term 'action' to cover these types of
  events in the same way that we defined 'event' in the first place to
  mean a single atomic API call.
2021-07-01 15:15:05 +01:00

33 lines
1.6 KiB
Python

import renderdoc as rd
import rdtest
class GL_Multithread_Rendering(rdtest.TestCase):
demos_test_name = 'GL_Multithread_Rendering'
def check_capture(self):
action = self.get_last_action()
self.controller.SetFrameEvent(action.eventId, False)
pipe: rd.PipeState = self.controller.GetPipelineState()
self.check_pixel_value(pipe.GetOutputTargets()[0].resourceId, 0.25, 0.0, [0.0, 0.0, 0.0, 0.0])
self.check_pixel_value(pipe.GetOutputTargets()[0].resourceId, 0.75, 0.0, [0.0, 0.0, 0.0, 0.0])
tex_details: rd.TextureDescription = self.get_texture(pipe.GetOutputTargets()[0].resourceId)
w = int(tex_details.width / 40)
h = int(tex_details.height / 40)
# Left side of the screen should be 20x40 red V shaped triangles on red background
for y in range(40):
for x in range(20):
self.check_pixel_value(pipe.GetOutputTargets()[0].resourceId, int(x*w), int(tex_details.height - 1 - y*h), [0.3, 0.2, 0.2, 1.0])
self.check_pixel_value(pipe.GetOutputTargets()[0].resourceId, int(x*w + w/2), int(tex_details.height - 1 - y*h - h/2), [1.0, 0.0, 0.25, 1.0])
# Right side of the screen should be delta shaped blue triangles
for y in range(40):
for x in range(20):
self.check_pixel_value(pipe.GetOutputTargets()[0].resourceId, int(tex_details.width/2) + int(x*w), int(tex_details.height - 1 - y*h - (h-1)), [0.2, 0.3, 0.2, 1.0])
self.check_pixel_value(pipe.GetOutputTargets()[0].resourceId, int(tex_details.width/2) + int(x*w + w/2), int(tex_details.height - 1 - y*h - h/2), [0.0, 1.0, 0.75, 1.0])