static void
agx_shader_initialize(struct agx_device *dev, struct agx_uncompiled_shader *so,
- nir_shader *nir)
+ nir_shader *nir, bool support_lod_bias)
{
if (nir->info.stage == MESA_SHADER_KERNEL)
nir->info.stage = MESA_SHADER_COMPUTE;
}
bool allow_mediump = !(dev->debug & AGX_DBG_NO16);
- agx_preprocess_nir(nir, true, allow_mediump, &so->info);
+ agx_preprocess_nir(nir, support_lod_bias, allow_mediump, &so->info);
blob_init(&so->serialized_nir);
nir_serialize(&so->serialized_nir, nir, true);
agx_create_shader_state(struct pipe_context *pctx,
const struct pipe_shader_state *cso)
{
+ struct agx_context *ctx = agx_context(pctx);
struct agx_uncompiled_shader *so =
rzalloc(NULL, struct agx_uncompiled_shader);
struct agx_device *dev = agx_device(pctx->screen);
asahi_fs_shader_key_equal);
}
- agx_shader_initialize(dev, so, nir);
+ agx_shader_initialize(dev, so, nir, ctx->support_lod_bias);
/* We're done with the NIR, throw it away */
ralloc_free(nir);
agx_create_compute_state(struct pipe_context *pctx,
const struct pipe_compute_state *cso)
{
+ struct agx_context *ctx = agx_context(pctx);
struct agx_device *dev = agx_device(pctx->screen);
struct agx_uncompiled_shader *so =
rzalloc(NULL, struct agx_uncompiled_shader);
assert(cso->ir_type == PIPE_SHADER_IR_NIR && "TGSI kernels unsupported");
nir_shader *nir = (void *)cso->prog;
- agx_shader_initialize(dev, so, nir);
+ agx_shader_initialize(dev, so, nir, ctx->support_lod_bias);
agx_get_shader_variant(agx_screen(pctx->screen), so, &pctx->debug, &key);
/* We're done with the NIR, throw it away */