Add no_aos_sampling GALLIVM_PERF option
authorDominik Drees <dominik.drees@wwu.de>
Mon, 15 Apr 2019 09:05:46 +0000 (11:05 +0200)
committerRoland Scheidegger <rscheidegger_lists@hispeed.ch>
Wed, 17 Apr 2019 22:16:19 +0000 (22:16 +0000)
This forces using general sampling and should improve precision and
performance in some cases.

src/gallium/auxiliary/gallivm/lp_bld_debug.h
src/gallium/auxiliary/gallivm/lp_bld_init.c
src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c

index eeef0d6ba61252a0d64c881eea91b86c77e587fe..406f628e1582d3e20c675e2dc9beec0ac536d8b3 100644 (file)
 #define GALLIVM_DEBUG_GC            (1 << 4)
 #define GALLIVM_DEBUG_DUMP_BC       (1 << 5)
 
-#define GALLIVM_PERF_NO_BRILINEAR  (1 << 0)
-#define GALLIVM_PERF_NO_RHO_APPROX (1 << 1)
-#define GALLIVM_PERF_NO_QUAD_LOD   (1 << 2)
-#define GALLIVM_PERF_NO_OPT        (1 << 3)
+#define GALLIVM_PERF_NO_BRILINEAR    (1 << 0)
+#define GALLIVM_PERF_NO_RHO_APPROX   (1 << 1)
+#define GALLIVM_PERF_NO_QUAD_LOD     (1 << 2)
+#define GALLIVM_PERF_NO_OPT          (1 << 3)
+#define GALLIVM_PERF_NO_AOS_SAMPLING (1 << 4)
 
 #ifdef __cplusplus
 extern "C" {
index e8bca5bc3afce7210149cb5b100efd99ea1814c3..ee64bc9b9530d99239aa8117eddaec47a5f31d16 100644 (file)
@@ -65,6 +65,7 @@ static const struct debug_named_value lp_bld_perf_flags[] = {
    { "no_brilinear", GALLIVM_PERF_NO_BRILINEAR, "disable brilinear optimization" },
    { "no_rho_approx", GALLIVM_PERF_NO_RHO_APPROX, "disable rho_approx optimization" },
    { "no_quad_lod", GALLIVM_PERF_NO_QUAD_LOD, "disable quad_lod optimization" },
+   { "no_aos_sampling", GALLIVM_PERF_NO_AOS_SAMPLING, "disable aos sampling optimization" },
    { "nopt",   GALLIVM_PERF_NO_OPT, "disable optimization passes to speed up shader compilation" },
    { "no_filter_hacks", GALLIVM_PERF_NO_BRILINEAR | GALLIVM_PERF_NO_RHO_APPROX |
      GALLIVM_PERF_NO_QUAD_LOD, "disable filter optimization hacks" },
index a6662c5e01b0eb2a47b7e5da7c1a20a4760c4c73..5599ca99e74b094732cad25d249620ec215c6081 100644 (file)
@@ -3112,6 +3112,11 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
       use_aos &= bld.num_lods <= num_quads ||
                  derived_sampler_state.min_img_filter ==
                     derived_sampler_state.mag_img_filter;
+
+      if(gallivm_perf & GALLIVM_PERF_NO_AOS_SAMPLING) {
+         use_aos = 0;
+      }
+
       if (dims > 1) {
          use_aos &= lp_is_simple_wrap_mode(derived_sampler_state.wrap_t);
          if (dims > 2) {