cl: Fix missing OpenCL 3.0 definition
[piglit.git] / framework / replay / backends / renderdoc.py
bloba9513613ac0b171c53217d0c199c441b185d7240
1 # coding=utf-8
3 # Copyright (c) 2014, 2016-2017, 2019-2020 Intel Corporation
4 # Copyright (c) 2019 Collabora Ltd
5 # Copyright © 2020 Valve Corporation.
7 # Permission is hereby granted, free of charge, to any person obtaining a
8 # copy of this software and associated documentation files (the "Software"),
9 # to deal in the Software without restriction, including without limitation
10 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 # and/or sell copies of the Software, and to permit persons to whom the
12 # Software is furnished to do so, subject to the following conditions:
14 # The above copyright notice and this permission notice shall be included
15 # in all copies or substantial portions of the Software.
17 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 # OTHER DEALINGS IN THE SOFTWARE.
25 # SPDX-License-Identifier: MIT
28 """ Module providing a RenderDoc dump backend for replayer """
30 from os import path
32 from framework import exceptions
34 from .abstract import DumpBackend, dump_handler
35 from .register import Registry
37 __all__ = [
38 'REGISTRY',
39 'RenderDocBackend',
43 class RenderDocBackend(DumpBackend):
44 """ replayer's RenderDoc dump backend
46 This backend uses RenderDoc for replaying its traces.
48 """
49 _get_last_frame_call = None # this silences the abstract-not-subclassed warning
51 def __init__(self, trace_path, output_dir=None, calls=None, **kwargs):
52 super(RenderDocBackend, self).__init__(trace_path, output_dir, calls,
53 **kwargs)
54 extension = path.splitext(self._trace_path)[1]
56 if extension != '.rdc':
57 raise exceptions.PiglitFatalError(
58 'Invalid trace_path: "{}" tried to be dumped '
59 'by the RenderDocBackend.\n'.format(self._trace_path))
61 @dump_handler
62 def dump(self):
63 script_path = path.dirname(path.abspath(__file__))
64 cmd = [path.join(script_path, 'renderdoc/renderdoc_dump_images.py'),
65 self._trace_path, self._output_dir]
66 cmd.extend(self._calls)
67 self._run_logged_command(cmd, None)
70 REGISTRY = Registry(
71 extensions=['.rdc'],
72 backend=RenderDocBackend,