OSDN Git Service

st/mesa/r200/i915/i965: use rzalloc() to create gl_program
authorTimothy Arceri <timothy.arceri@collabora.com>
Wed, 2 Nov 2016 22:18:17 +0000 (09:18 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Wed, 2 Nov 2016 23:39:13 +0000 (10:39 +1100)
commitcc6aa1d161280f10ded7834d1ec2413bc97589fe
tree5b124517f421f6581a8f518bac4b719c93162129
parent548b5fee6b4a71d1b7b52b2268ef809a2cb90149
st/mesa/r200/i915/i965: use rzalloc() to create gl_program

This allows us to use ralloc_parent() to see which data structure owns
shader_info which allows us to fix a regression in nir_sweep().

This will also allow us to move some fields from gl_linked_shader to
gl_program, which will allow us to do some clean-ups like storing
gl_program directly in the CurrentProgram array in gl_pipeline_object
enabling some small validation optimisations at draw time.

Also it is error prone to depend on the gl_linked_shader for
programs in current use because a failed linking attempt will free
infomation about the current program. In i965 we could be trying
to recompile a shader variant but may have lost some required fields.

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i915/i915_fragprog.c
src/mesa/drivers/dri/i965/brw_program.c
src/mesa/drivers/dri/r200/r200_vertprog.c
src/mesa/program/program.c
src/mesa/state_tracker/st_cb_program.c