summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2013-08-07 17:09:45 +0200
committerRoland Scheidegger <[email protected]>2013-08-08 18:55:57 +0200
commiteac57bc223dd2bf9d988b9f1ee0e126a27c98bf8 (patch)
treebf1aa53ac80b49f229b4062f49d9b1eb4732685a /src/gallium/auxiliary/gallivm
parentc8572a9457f8fd32e64fcf4f55c080dff6bd77be (diff)
gallivm: propagate scalar_lod to emit_size_query too
Clearly the returned values need to be per-element if the lod is per element. Does not actually change behavior yet. Reviewed-by: Zack Rusin <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/gallivm')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_sample.h1
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c1
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi.h1
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c5
4 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.h b/src/gallium/auxiliary/gallivm/lp_bld_sample.h
index f9a2b3fe5f5..dff8be22f6e 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.h
@@ -498,6 +498,7 @@ lp_build_size_query_soa(struct gallivm_state *gallivm,
struct lp_type int_type,
unsigned texture_unit,
boolean need_nr_mips,
+ boolean scalar_lod,
LLVMValueRef explicit_lod,
LLVMValueRef *sizes_out);
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
index 122ec4f271a..6780d3e53c4 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
@@ -1917,6 +1917,7 @@ lp_build_size_query_soa(struct gallivm_state *gallivm,
struct lp_type int_type,
unsigned texture_unit,
boolean need_nr_mips,
+ boolean scalar_lod,
LLVMValueRef explicit_lod,
LLVMValueRef *sizes_out)
{
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
index 0b4845064a0..aec019a1a6b 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
@@ -193,6 +193,7 @@ struct lp_build_sampler_soa
struct lp_type type,
unsigned unit,
boolean need_nr_mips,
+ boolean scalar_lod,
LLVMValueRef explicit_lod, /* optional */
LLVMValueRef *sizes_out);
};
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index c199385998c..02d804abf52 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -1990,6 +1990,7 @@ emit_size_query( struct lp_build_tgsi_soa_context *bld,
boolean is_sviewinfo)
{
LLVMValueRef explicit_lod;
+ boolean scalar_lod;
unsigned has_lod;
unsigned i;
unsigned unit = inst->Src[1].Register.Index;
@@ -2024,11 +2025,15 @@ emit_size_query( struct lp_build_tgsi_soa_context *bld,
else
explicit_lod = NULL;
+ /* TODO: use scalar lod if explicit_lod is broadcasted scalar */
+ scalar_lod = bld->bld_base.info->processor == TGSI_PROCESSOR_FRAGMENT;
+
bld->sampler->emit_size_query(bld->sampler,
bld->bld_base.base.gallivm,
bld->bld_base.int_bld.type,
unit,
is_sviewinfo,
+ scalar_lod,
explicit_lod,
sizes_out);
}