i965/blorp: Allow caller to provide sampler settings
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Fri, 27 Feb 2015 19:59:56 +0000 (21:59 +0200)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Wed, 29 Apr 2015 21:28:48 +0000 (00:28 +0300)
v2 (Ken): s/use_unorm_coords/non_normalized_coords/

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/brw_blorp.h
src/mesa/drivers/dri/i965/gen6_blorp.cpp
src/mesa/drivers/dri/i965/gen7_blorp.cpp

index 59aecabf5bd70170daab9f650ba02ce2e1ca72f3..6aaae6537b5409592393681e1a790344e6092905 100644 (file)
@@ -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 non_normalized_coords);
+
 /** \} */
 
 #endif /* __cplusplus */
index 6c139ec94c5362425e9a0fb640c3c4cedc9e1bd1..14e073b237f29be60f3fc8801f0b9bbc1074580c 100644 (file)
@@ -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 non_normalized_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 */
+                          non_normalized_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);
index 8215fe9a0c413947be02ef95621676cdb52813df..d841346a2cdfffdf7fb1d230ade9408a699d0d13 100644 (file)
@@ -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);