[Mesa-dev] [PATCH] i965: do not release GLSL IR for SSO programs
Timothy Arceri
timothy.arceri at collabora.com
Wed Oct 26 05:15:53 UTC 2016
On Tue, 2016-10-25 at 09:39 +0300, Tapani Pälli wrote:
> SSO shader programs can be later modified by attaching/detaching
> shaders and relinked, this requires IR.
Doesn't relinking recreate the IR? We can relink exiting shaders into
new programs. The IR is cloned from gl_shader (the compiled IR) before
this happens.
Where exactly are things falling over for SSO?
> This patch fixes regression
> caused by 4542c7ed5fc6d8cb2495d322b4f06d802d7292cc.
>
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97715
> Cc: "12.0 13.0" <mesa-stable at lists.freedesktop.org>
> ---
> src/mesa/drivers/dri/i965/brw_link.cpp | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp
> b/src/mesa/drivers/dri/i965/brw_link.cpp
> index 5ea9773..ffb66a9 100644
> --- a/src/mesa/drivers/dri/i965/brw_link.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_link.cpp
> @@ -290,14 +290,17 @@ brw_link_shader(struct gl_context *ctx, struct
> gl_shader_program *shProg)
>
> build_program_resource_list(ctx, shProg);
>
> - for (stage = 0; stage < ARRAY_SIZE(shProg->_LinkedShaders);
> stage++) {
> - struct gl_linked_shader *shader = shProg-
> >_LinkedShaders[stage];
> - if (!shader)
> - continue;
> + /* We can't free IR for SSO programs since those may need
> relinking. */
> + if (!shProg->SeparateShader) {
> + for (stage = 0; stage < ARRAY_SIZE(shProg->_LinkedShaders);
> stage++) {
> + struct gl_linked_shader *shader = shProg-
> >_LinkedShaders[stage];
> + if (!shader)
> + continue;
>
> - /* The GLSL IR won't be needed anymore. */
> - ralloc_free(shader->ir);
> - shader->ir = NULL;
> + /* The GLSL IR won't be needed anymore. */
> + ralloc_free(shader->ir);
> + shader->ir = NULL;
> + }
> }
>
> return true;
More information about the mesa-dev
mailing list