Prevent any state from carrying over to a new translation in cases
where we assume that data is still zero from initial calloc (these
would require us to do individual zeroing before translation which
would be more code).
void
nv50_program_destroy(struct nv50_context *nv50, struct nv50_program *p)
{
+ const struct pipe_shader_state pipe = p->pipe;
+ const ubyte type = p->type;
+
if (p->res)
nouveau_resource_free(&p->res);
if (p->fixups)
FREE(p->fixups);
- p->translated = FALSE;
+ memset(p, 0, sizeof(*p));
+
+ p->pipe = pipe;
+ p->type = type;
}
void
nvc0_program_destroy(struct nvc0_context *nvc0, struct nvc0_program *prog)
{
+ const struct pipe_shader_state pipe = prog->pipe;
+ const ubyte type = prog->type;
+
if (prog->res)
nouveau_resource_free(&prog->res);
FREE(prog->tfb);
}
- memset(prog->hdr, 0, sizeof(prog->hdr));
+ memset(prog, 0, sizeof(*prog));
- prog->translated = FALSE;
+ prog->pipe = pipe;
+ prog->type = type;
}