[Mesa-dev] The get/get_hash_params situation...

Ilia Mirkin imirkin at alum.mit.edu
Sat Jan 23 11:18:13 PST 2016


On Sat, Jan 23, 2016 at 1:56 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> I'll be interested to see what you come up with.  Maybe send a draft of
> your idea so people can take a look before you bother to convert the
> whole thing?

My immediate thought is to create a hash table of enum -> { avail, v,
pred, func }. The availability would be initialized based on the
predicate at ctx init time, as well as the value based on an
optionally provided string (so like ctx->Const.foo). The function
would be optional and would allow you to do whatever you wanted as a
function of the context.

At lookup time, you'd retrieve that struct, and return INVALID_ENUM if
avail == false, v if !func, otherwise func(ctx).

I'm a little concerned that the overhead at ctx init time will be
high, so I'll keep an eye on that. Perhaps I could mitigate some of
that with cleverness, perhaps delay the pred lookup and not
initialize.

  -ilia


More information about the mesa-dev mailing list