mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
pco: stubs for SPIR-V/NIR compilation options
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
3349b5b296
commit
008b635031
3 changed files with 51 additions and 2 deletions
|
|
@ -30,6 +30,14 @@ pco_ctx *pco_ctx_create(const struct pvr_device_info *dev_info, void *mem_ctx)
|
|||
|
||||
pco_debug_init();
|
||||
|
||||
#ifndef NDEBUG
|
||||
/* Ensure NIR debug variables are processed. */
|
||||
nir_process_debug_variable();
|
||||
#endif /* NDEBUG */
|
||||
|
||||
pco_setup_spirv_options(dev_info, &ctx->spirv_options);
|
||||
pco_setup_nir_options(dev_info, &ctx->nir_options);
|
||||
|
||||
return ctx;
|
||||
}
|
||||
|
||||
|
|
@ -42,7 +50,6 @@ pco_ctx *pco_ctx_create(const struct pvr_device_info *dev_info, void *mem_ctx)
|
|||
*/
|
||||
const struct spirv_to_nir_options *pco_spirv_options(pco_ctx *ctx)
|
||||
{
|
||||
unreachable("finishme: pco_spirv_options");
|
||||
return &ctx->spirv_options;
|
||||
}
|
||||
|
||||
|
|
@ -55,6 +62,5 @@ const struct spirv_to_nir_options *pco_spirv_options(pco_ctx *ctx)
|
|||
*/
|
||||
const nir_shader_compiler_options *pco_nir_options(pco_ctx *ctx)
|
||||
{
|
||||
unreachable("finishme: pco_nir_options");
|
||||
return &ctx->nir_options;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,11 @@ typedef struct _pco_ctx {
|
|||
struct spirv_to_nir_options spirv_options;
|
||||
} pco_ctx;
|
||||
|
||||
void pco_setup_spirv_options(const struct pvr_device_info *dev_info,
|
||||
struct spirv_to_nir_options *spirv_options);
|
||||
void pco_setup_nir_options(const struct pvr_device_info *dev_info,
|
||||
nir_shader_compiler_options *nir_options);
|
||||
|
||||
/* Debug. */
|
||||
enum pco_debug {
|
||||
PCO_DEBUG_VAL_SKIP = BITFIELD64_BIT(0),
|
||||
|
|
|
|||
|
|
@ -15,6 +15,44 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
/** Base/common SPIR-V to NIR options. */
|
||||
static const struct spirv_to_nir_options pco_base_spirv_options = {
|
||||
.environment = NIR_SPIRV_VULKAN,
|
||||
};
|
||||
|
||||
/** Base/common NIR options. */
|
||||
static const nir_shader_compiler_options pco_base_nir_options = {};
|
||||
|
||||
/**
|
||||
* \brief Sets up device/core-specific SPIR-V to NIR options.
|
||||
*
|
||||
* \param[in] dev_info Device info.
|
||||
* \param[out] spirv_options SPIR-V to NIR options.
|
||||
*/
|
||||
void pco_setup_spirv_options(const struct pvr_device_info *dev_info,
|
||||
struct spirv_to_nir_options *spirv_options)
|
||||
{
|
||||
memcpy(spirv_options, &pco_base_spirv_options, sizeof(*spirv_options));
|
||||
|
||||
/* TODO: Device/core-dependent options. */
|
||||
puts("finishme: pco_setup_spirv_options");
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Sets up device/core-specific NIR options.
|
||||
*
|
||||
* \param[in] dev_info Device info.
|
||||
* \param[out] nir_options NIR options.
|
||||
*/
|
||||
void pco_setup_nir_options(const struct pvr_device_info *dev_info,
|
||||
nir_shader_compiler_options *nir_options)
|
||||
{
|
||||
memcpy(nir_options, &pco_base_nir_options, sizeof(*nir_options));
|
||||
|
||||
/* TODO: Device/core-dependent options. */
|
||||
puts("finishme: pco_setup_nir_options");
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Runs pre-processing passes on a NIR shader.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue