summaryrefslogtreecommitdiffstats
path: root/src/mesa/Makefile.am
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-01-08 17:00:13 -0800
committerKenneth Graunke <[email protected]>2013-01-12 15:36:21 -0800
commit8c80bdc4a8d0b1c39cad8b8bfb1b982a498f0a8e (patch)
tree456e326bf812e7bd13f1bd72434a9c0121969d77 /src/mesa/Makefile.am
parent2c4ad502ce12259160be6c73ebdd6e73a5d27c6f (diff)
i965: Move program_id to intel_screen instead of brw_context.
According to bug #54524, I regressed oglconform's multicontext test when I reenabled the fragment shader precompile. However, these test cases only passed by miraculous coincedence. We assign each fragment program a unique ID (brw_fragment_program::id which becomes brw_wm_prog_key::program_string_id) which we obtain by storing a per-context counter. The test case uses GLX context sharing to access the same fragment program from two different contexts. This means that we share a program cache. Before the precompile, if both contexts happened to use the same shaders in the same order, we'd obtain the same program_string_ids (by virtue of doing the same computation twice). However, the more likely scenario is that they completely disagree on program_string_id. This meant that we'd have two completely different fragment shaders in the cache with the same ID, tricking us to think they were the same (aside from NOS), so we'd render using the wrong program. This patch implements a simple fix suggested by Eric: it moves the global counter out of brw_context and into intel_screen, which is shared across all contexts. A mutex protects it from concurrent access. This is also the first direct usage of pthreads in the i965 driver. Fixes 10 subcases of oglconform's multicontext test. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54524 Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/Makefile.am')
0 files changed, 0 insertions, 0 deletions