nvk: Add an nvk_shader_address helper

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Faith Ekstrand 2023-01-30 20:11:52 -06:00 committed by Marge Bot
parent 782d376363
commit c2f636861a
2 changed files with 11 additions and 3 deletions

View file

@ -58,9 +58,9 @@ gv100_compute_setup_launch_desc_template(uint32_t *qmd,
NVC3C0_QMDV02_02_VAL_SET(qmd, REGISTER_COUNT_V, shader->num_gprs);
NVC3C0_QMDV02_02_VAL_SET(qmd, BARRIER_COUNT, shader->num_barriers);
uint64_t entry = shader->bo->offset;
NVC3C0_QMDV02_02_VAL_SET(qmd, PROGRAM_ADDRESS_LOWER, entry & 0xffffffff);
NVC3C0_QMDV02_02_VAL_SET(qmd, PROGRAM_ADDRESS_UPPER, entry >> 32);
uint64_t addr = nvk_shader_address(shader);
NVC3C0_QMDV02_02_VAL_SET(qmd, PROGRAM_ADDRESS_LOWER, addr & 0xffffffff);
NVC3C0_QMDV02_02_VAL_SET(qmd, PROGRAM_ADDRESS_UPPER, addr >> 32);
}

View file

@ -2,8 +2,10 @@
#define NVK_SHADER_H 1
#include "nvk_private.h"
#include "nvk_device_memory.h"
#include "nir.h"
#include "nouveau_bo.h"
struct vk_shader_module;
struct nvk_device;
@ -31,6 +33,12 @@ struct nvk_shader {
struct nouveau_ws_bo *bo;
};
static inline uint64_t
nvk_shader_address(const struct nvk_shader *shader)
{
return shader->bo->offset;
}
const nir_shader_compiler_options *
nvk_physical_device_nir_options(const struct nvk_physical_device *pdevice,
gl_shader_stage stage);