diff --git a/src/nouveau/compiler/meson.build b/src/nouveau/compiler/meson.build index e69de29bb2d..a70218539d1 100644 --- a/src/nouveau/compiler/meson.build +++ b/src/nouveau/compiler/meson.build @@ -0,0 +1,22 @@ +libnak_c_files = files( + 'nak.h', +) + +libnak_deps = [ + idep_mesautil, + idep_nir_headers, +] + +_libnak = static_library( + 'nak', + libnak_c_files, + include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium], + dependencies : libnak_deps, + c_args : [no_override_init_args], + gnu_symbol_visibility : 'hidden', +) + +idep_nak = declare_dependency( + include_directories : include_directories('.'), + link_with : _libnak, +) diff --git a/src/nouveau/compiler/nak.h b/src/nouveau/compiler/nak.h new file mode 100644 index 00000000000..e05d3eb5a32 --- /dev/null +++ b/src/nouveau/compiler/nak.h @@ -0,0 +1,50 @@ +/* + * Copyright © 2022 Collabora, Ltd. + * SPDX-License-Identifier: MIT + */ + +#ifndef NAK_H +#define NAK_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct nir_shader_compiler_options; +typedef struct nir_shader nir_shader; + +struct nak_compiler { +}; + +void nak_optimize_nir(nir_shader *nir, const struct nak_compiler *nak); +void nak_preprocess_nir(nir_shader *nir, const struct nak_compiler *nak); +void nak_postprocess_nir(nir_shader *nir, const struct nak_compiler *nak); + +struct nak_shader_info { + /** Number of GPRs used */ + uint8_t num_gprs; + + /** Size of thread-local storage */ + uint32_t tls_size; + + struct { + /* Local workgroup size */ + uint16_t local_size[3]; + + /* Shared memory size */ + uint16_t smem_size; + } cs; + + /** Shader header for 3D stages */ + uint32_t hdr[32]; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* NAK_H */ diff --git a/src/nouveau/meson.build b/src/nouveau/meson.build index 6a7fa0b5924..470e07661d6 100644 --- a/src/nouveau/meson.build +++ b/src/nouveau/meson.build @@ -19,7 +19,9 @@ # SOFTWARE. subdir('nvidia-headers') -subdir('compiler') +if with_nouveau_vk + subdir('compiler') +endif subdir('winsys') if with_tools.contains('drm-shim') subdir('drm-shim')