Mesa (master): gallivm: propagate scalar_lod to emit_size_query too
Roland Scheidegger
sroland at kemper.freedesktop.org
Thu Aug 8 16:57:03 UTC 2013
Module: Mesa
Branch: master
Commit: eac57bc223dd2bf9d988b9f1ee0e126a27c98bf8
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=eac57bc223dd2bf9d988b9f1ee0e126a27c98bf8
Author: Roland Scheidegger <sroland at vmware.com>
Date: Wed Aug 7 17:09:45 2013 +0200
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 <zackr at vmware.com>
---
src/gallium/auxiliary/draw/draw_llvm_sample.c | 2 ++
src/gallium/auxiliary/gallivm/lp_bld_sample.h | 1 +
src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 1 +
src/gallium/auxiliary/gallivm/lp_bld_tgsi.h | 1 +
src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 5 +++++
src/gallium/drivers/llvmpipe/lp_tex_sample.c | 2 ++
6 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/src/gallium/auxiliary/draw/draw_llvm_sample.c b/src/gallium/auxiliary/draw/draw_llvm_sample.c
index 0cb5c21..3016d7c 100644
--- a/src/gallium/auxiliary/draw/draw_llvm_sample.c
+++ b/src/gallium/auxiliary/draw/draw_llvm_sample.c
@@ -271,6 +271,7 @@ draw_llvm_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base,
struct lp_type type,
unsigned texture_unit,
boolean need_nr_mips,
+ boolean scalar_lod,
LLVMValueRef explicit_lod, /* optional */
LLVMValueRef *sizes_out)
{
@@ -284,6 +285,7 @@ draw_llvm_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base,
type,
texture_unit,
need_nr_mips,
+ scalar_lod,
explicit_lod,
sizes_out);
}
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.h b/src/gallium/auxiliary/gallivm/lp_bld_sample.h
index f9a2b3f..dff8be2 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 122ec4f..6780d3e 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 0b48450..aec019a 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 c199385..02d804a 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);
}
diff --git a/src/gallium/drivers/llvmpipe/lp_tex_sample.c b/src/gallium/drivers/llvmpipe/lp_tex_sample.c
index 2fb6f5b..2aec6ea 100644
--- a/src/gallium/drivers/llvmpipe/lp_tex_sample.c
+++ b/src/gallium/drivers/llvmpipe/lp_tex_sample.c
@@ -281,6 +281,7 @@ lp_llvm_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base,
struct lp_type type,
unsigned texture_unit,
boolean need_nr_mips,
+ boolean scalar_lod,
LLVMValueRef explicit_lod, /* optional */
LLVMValueRef *sizes_out)
{
@@ -294,6 +295,7 @@ lp_llvm_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base,
type,
texture_unit,
need_nr_mips,
+ scalar_lod,
explicit_lod,
sizes_out);
}
More information about the mesa-commit
mailing list