mesa/src/gallium/include/pipe
Kenneth Graunke 220c1dce1e gallium: Add PIPE_BARRIER_UPDATE_BUFFER and UPDATE_TEXTURE bits.
The glMemoryBarrier() function makes shader memory stores ordered with
respect to things specified by the given bits.  Until now, st/mesa has
ignored GL_TEXTURE_UPDATE_BARRIER_BIT and GL_BUFFER_UPDATE_BARRIER_BIT,
saying that drivers should implicitly perform the needed flushing.

This seems like a pretty big assumption to make.  Instead, this commit
opts to translate them to new PIPE_BARRIER bits, and adjusts existing
drivers to continue ignoring them (preserving the current behavior).

The i965 driver performs actions on these memory barriers.  Shader
memory stores go through a "data cache" which is separate from the
render cache and other read caches (like the texture cache).  All
memory barriers need to flush the data cache (to ensure shader memory
stores are visible), and possibly invalidate read caches (to ensure
stale data is no longer visible).  The driver implicitly flushes for
most caches, but not for data cache, since ARB_shader_image_load_store
introduced MemoryBarrier() precisely to order these explicitly.

I would like to follow i965's approach in iris, flushing the data cache
on any MemoryBarrier() call, so I need st/mesa to actually call the
pipe->memory_barrier() callback.

Fixes KHR-GL45.shader_image_load_store.advanced-sync-textureUpdate
and Piglit's spec/arb_shader_image_load_store/host-mem-barrier on
the iris driver.

Roland said this looks reasonable to him.
Reviewed-by: Eric Anholt <eric@anholt.net>
2019-03-19 23:43:33 -07:00
..
p_compiler.h util: move ALWAYS_INLINE macro to util/macro.h 2017-05-09 11:21:03 +10:00
p_config.h Revert "gallium: remove unused PIPE_CC_GCC_VERSION" 2017-05-24 11:33:46 -06:00
p_context.h gallium: fix typo 2018-12-07 13:49:21 -05:00
p_defines.h gallium: Add PIPE_BARRIER_UPDATE_BUFFER and UPDATE_TEXTURE bits. 2019-03-19 23:43:33 -07:00
p_format.h gallium: add SINT formats to have exact counterparts to SNORM formats 2019-01-22 12:21:43 -05:00
p_screen.h gallium: add storage_sample_count parameter into is_format_supported 2018-07-31 18:28:41 -04:00
p_shader_tokens.h tgsi: add ATOMFADD operation 2018-12-26 20:04:57 -05:00
p_state.h gallium: add pipe_grid_info::last_block 2019-03-15 11:53:08 -04:00
p_video_codec.h Remove wrongly repeated words in comments 2016-06-23 13:55:03 -07:00
p_video_enums.h st/va: fix the incorrect max profiles report 2019-02-11 14:44:16 -05:00
p_video_state.h vl: add VP9 picture description 2018-04-12 11:15:12 -04:00