1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
|
import renderdoc as rd
import rdtest
class GL_Separable_Geometry_Shaders(rdtest.TestCase):
demos_test_name = 'GL_Separable_Geometry_Shaders'
def check_capture(self):
action = self.find_action("Draw")
self.controller.SetFrameEvent(action.eventId, False)
postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices)
postvs_ref = {
0: {
'vtx': 0,
'idx': 0,
'gl_Position': [-0.5, -0.5, 0.0, 1.0],
'v2f_block.col': [0.0, 1.0, 0.0, 1.0],
'v2f_block.uv': [0.0, 0.0, 0.0, 1.0],
},
1: {
'vtx': 1,
'idx': 1,
'gl_Position': [0.0, 0.5, 0.0, 1.0],
'v2f_block.col': [0.0, 1.0, 0.0, 1.0],
'v2f_block.uv': [0.0, 1.0, 0.0, 1.0],
},
2: {
'vtx': 2,
'idx': 2,
'gl_Position': [0.5, -0.5, 0.0, 1.0],
'v2f_block.col': [0.0, 1.0, 0.0, 1.0],
'v2f_block.uv': [1.0, 0.0, 0.0, 1.0],
},
}
self.check_mesh_data(postvs_ref, postvs_data)
postgs_data = self.get_postvs(action, rd.MeshDataStage.GSOut, 0, action.numIndices*3)
postgs_ref = {
0: {
'vtx': 0,
'idx': 0,
'gl_Position': [0.2, -0.5, 0.0, 1.0],
'v2f_block.col': [0.0, 1.0, 0.0, 1.0],
'v2f_block.uv': [0.0, 0.0, 0.0, 1.0],
},
1: {
'vtx': 1,
'idx': 1,
'gl_Position': [0.7, 0.5, 0.0, 1.0],
'v2f_block.col': [0.0, 1.0, 0.0, 1.0],
'v2f_block.uv': [0.0, 1.0, 0.0, 1.0],
},
4: {
'vtx': 4,
'idx': 4,
'gl_Position': [-0.7, 0.5, 0.0, 1.0],
'v2f_block.col': [1.0, 0.0, 1.0, 0.0],
'v2f_block.uv': [0.0, 1.0, 0.0, 1.0],
},
5: {
'vtx': 5,
'idx': 5,
'gl_Position': [-0.2, -0.5, 0.0, 1.0],
'v2f_block.col': [1.0, 0.0, 1.0, 0.0],
'v2f_block.uv': [1.0, 0.0, 0.0, 1.0],
},
8: {
'vtx': 8,
'idx': 8,
'gl_Position': [0.5, 0.2, 0.0, 1.0],
'v2f_block.col': [1.0, 0.0, 0.0, 1.0],
'v2f_block.uv': [1.0, 0.0, 0.0, 1.0],
},
}
self.check_mesh_data(postgs_ref, postgs_data)
pipe: rd.PipeState = self.controller.GetPipelineState()
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()
|