[Mesa-dev] [v2 3/6] glsl: ir_serializer class for the shader cache

Kenneth Graunke kenneth at whitecape.org
Thu Nov 7 00:15:26 PST 2013


On 11/06/2013 12:55 PM, Paul Berry wrote:
[snip]
> Ok, I think you are correct about the functions.  But I believe for
> variables, the ir_variable always appears in the IR before any
> references to it.  Can someone confirm this? (Ken or Ian perhaps?)

That's correct, and actually critical.  Driver backends allocate storage
space for variables when they see ir_variable declarations in the
instruction stream.  Later, when they encounter an
ir_dereference_variable, they look up the storage for that variable,
which must already exist.  (i965 has assertions to verify this - if you
dereference a variable that hasn't been declared yet, it will abort.)

--Ken


More information about the mesa-dev mailing list