File: VK_Int8_IBuffer.py

package info (click to toggle)
renderdoc 1.11%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 93,988 kB
  • sloc: cpp: 662,188; ansic: 350,046; python: 22,871; xml: 14,473; java: 11,365; cs: 7,181; makefile: 6,703; yacc: 5,682; ruby: 4,648; perl: 3,461; sh: 2,277; php: 2,119; lisp: 1,835; javascript: 1,524; tcl: 1,068; ml: 747
file content (63 lines) | stat: -rw-r--r-- 2,353 bytes parent folder | download
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
import rdtest
import renderdoc as rd


class VK_Int8_IBuffer(rdtest.TestCase):
    demos_test_name = 'VK_Int8_IBuffer'

    def check_capture(self):
        draw = self.find_draw("Draw")

        self.check(draw is not None)

        self.controller.SetFrameEvent(draw.eventId, False)

        pipe: rd.PipeState = self.controller.GetPipelineState()

        postvs_data = self.get_postvs(draw, rd.MeshDataStage.VSOut, 0, draw.numIndices)

        # Calculate the strip restart index for this index width
        striprestart_index = pipe.GetStripRestartIndex() & ((1 << (draw.indexByteWidth*8)) - 1)

        # We don't check all of the output, we check a few key vertices to ensure they match up
        postvs_ref = {
            0: {
                'vtx': 0,
                'idx': 0,
                'gl_PerVertex_var.gl_Position': [-0.8, -0.2, 0.0, 1.0],
                'vertOut.col': [0.0, 1.0, 0.0, 1.0],
                'vertOut.uv': [0.0, 0.0, 0.0, 1.0],
            },
            4: {
                'vtx': 4,
                'idx': 4,
                'gl_PerVertex_var.gl_Position': [0.0, -0.2, 0.0, 1.0],
                'vertOut.col': [0.0, 1.0, 0.0, 1.0],
                'vertOut.uv': [0.0, 0.0, 0.0, 1.0],
            },
            8: {
                'idx': striprestart_index
            },
            9: {
                'vtx': 9,
                'idx': 8,
                'gl_PerVertex_var.gl_Position': [-0.8, 0.7, 0.0, 1.0],
                'vertOut.col': [0.0, 0.0, 1.0, 1.0],
                'vertOut.uv': [0.0, 0.0, 0.0, 1.0],
            },
        }

        self.check_mesh_data(postvs_ref, postvs_data)

        # Check that the rendered mesh is as expected
        out = pipe.GetOutputTargets()[0].resourceId
        for x in [x*0.01 for x in range(1, 100)]:
            self.check_pixel_value(out, x, 0.1, [0.2, 0.2, 0.2, 1.0])
            self.check_pixel_value(out, x, 0.5, [0.2, 0.2, 0.2, 1.0])

        self.check_pixel_value(out, 0.3, 0.25, [0.0, 1.0, 0.0, 1.0])
        self.check_pixel_value(out, 0.5, 0.25, [0.0, 1.0, 0.0, 1.0])
        self.check_pixel_value(out, 0.7, 0.25, [0.0, 1.0, 0.0, 1.0])
        self.check_pixel_value(out, 0.3, 0.75, [0.0, 0.0, 1.0, 1.0])
        self.check_pixel_value(out, 0.5, 0.75, [0.0, 0.0, 1.0, 1.0])
        self.check_pixel_value(out, 0.7, 0.75, [0.0, 0.0, 1.0, 1.0])