mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 12:40:23 +01:00
pco: pygen stubs
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com> Acked-by: Frank Binns <frank.binns@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32258>
This commit is contained in:
parent
fa9892026e
commit
4d8653a643
8 changed files with 163 additions and 2 deletions
|
|
@ -12,9 +12,49 @@ libpowervr_compiler_files = files(
|
|||
'pco_trans_nir.c',
|
||||
)
|
||||
|
||||
pco_pygen_dep_files = files('pco_pygen_common.py', 'pco_isa.py', 'pco_ops.py')
|
||||
|
||||
pco_common_h = custom_target(
|
||||
'pco_common.h',
|
||||
input : ['pco_common.h.py'],
|
||||
output : 'pco_common.h',
|
||||
command : [prog_python, '@INPUT@'],
|
||||
capture : true,
|
||||
depend_files : pco_pygen_dep_files,
|
||||
)
|
||||
|
||||
pco_isa_h = custom_target(
|
||||
'pco_isa.h',
|
||||
input : ['pco_isa.h.py'],
|
||||
output : 'pco_isa.h',
|
||||
command : [prog_python, '@INPUT@'],
|
||||
capture : true,
|
||||
depend_files : pco_pygen_dep_files,
|
||||
)
|
||||
|
||||
pco_ops_h = custom_target(
|
||||
'pco_ops.h',
|
||||
input : ['pco_ops.h.py'],
|
||||
output : 'pco_ops.h',
|
||||
command : [prog_python, '@INPUT@'],
|
||||
capture : true,
|
||||
depend_files : pco_pygen_dep_files,
|
||||
)
|
||||
|
||||
idep_pco_pygen = declare_dependency(
|
||||
sources : [
|
||||
pco_common_h,
|
||||
pco_isa_h,
|
||||
pco_ops_h,
|
||||
],
|
||||
include_directories : inc_powervr_compiler,
|
||||
)
|
||||
|
||||
pco_pygen_c_files = []
|
||||
|
||||
libpowervr_compiler = static_library(
|
||||
'powervr_compiler',
|
||||
[libpowervr_compiler_files],
|
||||
[libpowervr_compiler_files, pco_pygen_c_files],
|
||||
include_directories : [
|
||||
inc_imagination,
|
||||
inc_powervr_compiler,
|
||||
|
|
@ -24,7 +64,7 @@ libpowervr_compiler = static_library(
|
|||
],
|
||||
# Suppress 'parameter passing for argument of type ... changed in GCC ...' warnings.
|
||||
c_args : [imagination_c_args, no_override_init_args, '-Wno-psabi'],
|
||||
dependencies : [idep_mesautil, idep_nir],
|
||||
dependencies : [idep_mesautil, idep_nir, idep_pco_pygen],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
install : false,
|
||||
)
|
||||
|
|
|
|||
32
src/imagination/pco/pco_common.h.py
Normal file
32
src/imagination/pco/pco_common.h.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# Copyright © 2024 Imagination Technologies Ltd.
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
from mako.template import Template
|
||||
from pco_pygen_common import *
|
||||
|
||||
template = """/*
|
||||
* Copyright © 2024 Imagination Technologies Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#ifndef PCO_COMMON_H
|
||||
#define PCO_COMMON_H
|
||||
|
||||
/**
|
||||
* \\file pco_common.h
|
||||
*
|
||||
* \\brief PCO common definitions.
|
||||
*/
|
||||
|
||||
#include "util/macros.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#endif /* PCO_COMMON_H */"""
|
||||
|
||||
def main():
|
||||
print(Template(template).render())
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
@ -13,7 +13,9 @@
|
|||
* \brief PCO internal header.
|
||||
*/
|
||||
|
||||
#include "compiler/spirv/nir_spirv.h"
|
||||
#include "pco.h"
|
||||
#include "pco_common.h"
|
||||
#include "spirv/nir_spirv.h"
|
||||
#include "util/macros.h"
|
||||
|
||||
|
|
|
|||
32
src/imagination/pco/pco_isa.h.py
Normal file
32
src/imagination/pco/pco_isa.h.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# Copyright © 2024 Imagination Technologies Ltd.
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
from mako.template import Template
|
||||
from pco_isa import *
|
||||
|
||||
template = """/*
|
||||
* Copyright © 2024 Imagination Technologies Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#ifndef PCO_ISA_H
|
||||
#define PCO_ISA_H
|
||||
|
||||
/**
|
||||
* \\file pco_isa.h
|
||||
*
|
||||
* \\brief PCO ISA definitions.
|
||||
*/
|
||||
|
||||
#include "util/macros.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#endif /* PCO_ISA_H */"""
|
||||
|
||||
def main():
|
||||
print(Template(template).render())
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
4
src/imagination/pco/pco_isa.py
Normal file
4
src/imagination/pco/pco_isa.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# Copyright © 2024 Imagination Technologies Ltd.
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
from pco_pygen_common import *
|
||||
34
src/imagination/pco/pco_ops.h.py
Normal file
34
src/imagination/pco/pco_ops.h.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# Copyright © 2024 Imagination Technologies Ltd.
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
from mako.template import Template
|
||||
from pco_ops import *
|
||||
|
||||
template = """/*
|
||||
* Copyright © 2024 Imagination Technologies Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#ifndef PCO_OPS_H
|
||||
#define PCO_OPS_H
|
||||
|
||||
/**
|
||||
* \\file pco_ops.h
|
||||
*
|
||||
* \\brief PCO op definitions and functions.
|
||||
*/
|
||||
|
||||
#include "util/macros.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#endif /* PCO_OPS_H */"""
|
||||
|
||||
def main():
|
||||
print(Template(template).render())
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
4
src/imagination/pco/pco_ops.py
Normal file
4
src/imagination/pco/pco_ops.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# Copyright © 2024 Imagination Technologies Ltd.
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
from pco_pygen_common import *
|
||||
13
src/imagination/pco/pco_pygen_common.py
Normal file
13
src/imagination/pco/pco_pygen_common.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# Copyright © 2024 Imagination Technologies Ltd.
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
from enum import Enum, auto
|
||||
|
||||
_ = None
|
||||
|
||||
prefix = 'pco'
|
||||
|
||||
class BaseType(Enum):
|
||||
bool = auto()
|
||||
uint = auto()
|
||||
enum = auto()
|
||||
Loading…
Add table
Reference in a new issue