summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2016-07-21 20:32:12 -0700
committerFrancisco Jerez <currojerez@riseup.net>2016-08-25 18:36:06 -0700
commit40b23ad57e8da0fd7af21e81ad52d615f9b492ed (patch)
treef47d1b986b54bd787dc60eb68e4affd4f929e6c4
parent4a87e4ade778e56d43333c65a58752b15a00ce69 (diff)
downloadexternal_mesa3d-40b23ad57e8da0fd7af21e81ad52d615f9b492ed.zip
external_mesa3d-40b23ad57e8da0fd7af21e81ad52d615f9b492ed.tar.gz
external_mesa3d-40b23ad57e8da0fd7af21e81ad52d615f9b492ed.tar.bz2
i965/fs: Add brw_wm_prog_key bit specifying whether FB reads should be coherent.
Some of the following changes in this series are specific to the non-coherent path, so I need some way to tell whether the coherent or non-coherent path is in use. The flag defaults to the value of the gl_extensions::MESA_shader_framebuffer_fetch enable so that it can be overridden easily on hardware that supports both framebuffer fetch extensions in order to test the non-coherent path, like: MESA_EXTENSION_OVERRIDE=-GL_EXT_shader_framebuffer_fetch (Of course trying to force-enable the coherent framebuffer fetch extension on hardware without native support won't work and lead to assertion failures). Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
-rw-r--r--src/mesa/drivers/dri/i965/brw_compiler.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_compiler.h b/src/mesa/drivers/dri/i965/brw_compiler.h
index 7d15c28..0c300e7 100644
--- a/src/mesa/drivers/dri/i965/brw_compiler.h
+++ b/src/mesa/drivers/dri/i965/brw_compiler.h
@@ -260,6 +260,7 @@ struct brw_wm_prog_key {
unsigned line_aa:2;
bool high_quality_derivatives:1;
bool force_dual_color_blend:1;
+ bool coherent_fb_fetch:1;
uint16_t drawable_height;
uint64_t input_slots_valid;
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index d725a16..c513dbc 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -549,6 +549,9 @@ brw_wm_populate_key(struct brw_context *brw, struct brw_wm_prog_key *key)
/* The unique fragment program ID */
key->program_string_id = fp->id;
+
+ /* Whether reads from the framebuffer should behave coherently. */
+ key->coherent_fb_fetch = ctx->Extensions.MESA_shader_framebuffer_fetch;
}
void
@@ -613,6 +616,9 @@ brw_fs_precompile(struct gl_context *ctx,
key.program_string_id = bfp->id;
+ /* Whether reads from the framebuffer should behave coherently. */
+ key.coherent_fb_fetch = ctx->Extensions.MESA_shader_framebuffer_fetch;
+
uint32_t old_prog_offset = brw->wm.base.prog_offset;
struct brw_wm_prog_data *old_prog_data = brw->wm.prog_data;