diff options
author | Topi Pohjolainen <topi.pohjolainen@intel.com> | 2015-02-27 21:59:56 +0200 |
---|---|---|
committer | Topi Pohjolainen <topi.pohjolainen@intel.com> | 2015-03-30 10:27:20 +0300 |
commit | 54e6991a96c0fffe1fb157490a491c925425b205 (patch) | |
tree | 9f17eb5c205d93d087f526eb6cba24bcb75f618e | |
parent | 22379d3d16928bedf7b064561cbfc27bec262a98 (diff) |
i965/blorp: Allow caller to provide sampler settings
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_blorp.h | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen6_blorp.cpp | 15 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen7_blorp.cpp | 3 |
3 files changed, 14 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.h b/src/mesa/drivers/dri/i965/brw_blorp.h index 59aecabf5b..63dfe5b11c 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.h +++ b/src/mesa/drivers/dri/i965/brw_blorp.h @@ -415,7 +415,9 @@ gen6_blorp_emit_drawing_rectangle(struct brw_context *brw, uint32_t gen6_blorp_emit_sampler_state(struct brw_context *brw, - const brw_blorp_params *params); + unsigned tex_filter, unsigned max_lod, + bool use_unorm_coords); + /** \} */ #endif /* __cplusplus */ diff --git a/src/mesa/drivers/dri/i965/gen6_blorp.cpp b/src/mesa/drivers/dri/i965/gen6_blorp.cpp index 6c139ec94c..ae4f34d432 100644 --- a/src/mesa/drivers/dri/i965/gen6_blorp.cpp +++ b/src/mesa/drivers/dri/i965/gen6_blorp.cpp @@ -455,7 +455,8 @@ gen6_blorp_emit_binding_table(struct brw_context *brw, */ uint32_t gen6_blorp_emit_sampler_state(struct brw_context *brw, - const brw_blorp_params *params) + unsigned tex_filter, unsigned max_lod, + bool use_unorm_coords) { uint32_t sampler_offset; uint32_t *sampler_state = (uint32_t *) @@ -476,8 +477,8 @@ gen6_blorp_emit_sampler_state(struct brw_context *brw, brw_emit_sampler_state(brw, sampler_state, sampler_offset, - BRW_MAPFILTER_LINEAR, /* min filter */ - BRW_MAPFILTER_LINEAR, /* mag filter */ + tex_filter, /* min filter */ + tex_filter, /* mag filter */ BRW_MIPFILTER_NONE, BRW_ANISORATIO_2, address_rounding, @@ -485,11 +486,11 @@ gen6_blorp_emit_sampler_state(struct brw_context *brw, BRW_TEXCOORDMODE_CLAMP, BRW_TEXCOORDMODE_CLAMP, 0, /* min LOD */ - 0, /* max LOD */ + max_lod, 0, /* LOD bias */ 0, /* base miplevel */ 0, /* shadow function */ - true, /* non-normalized coordinates */ + use_unorm_coords, 0); /* border color offset - unused */ return sampler_offset; @@ -1059,7 +1060,9 @@ gen6_blorp_exec(struct brw_context *brw, gen6_blorp_emit_binding_table(brw, params, wm_surf_offset_renderbuffer, wm_surf_offset_texture); - sampler_offset = gen6_blorp_emit_sampler_state(brw, params); + sampler_offset = + gen6_blorp_emit_sampler_state(brw, BRW_MAPFILTER_LINEAR, 0, true); + gen6_blorp_emit_sampler_state_pointers(brw, params, sampler_offset); } gen6_blorp_emit_vs_disable(brw, params); diff --git a/src/mesa/drivers/dri/i965/gen7_blorp.cpp b/src/mesa/drivers/dri/i965/gen7_blorp.cpp index 8215fe9a0c..d841346a2c 100644 --- a/src/mesa/drivers/dri/i965/gen7_blorp.cpp +++ b/src/mesa/drivers/dri/i965/gen7_blorp.cpp @@ -830,7 +830,8 @@ gen7_blorp_exec(struct brw_context *brw, gen6_blorp_emit_binding_table(brw, params, wm_surf_offset_renderbuffer, wm_surf_offset_texture); - sampler_offset = gen6_blorp_emit_sampler_state(brw, params); + sampler_offset = + gen6_blorp_emit_sampler_state(brw, BRW_MAPFILTER_LINEAR, 0, true); } gen7_blorp_emit_vs_disable(brw, params); gen7_blorp_emit_hs_disable(brw, params); |