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@vmware.com>
This commit is contained in:
Roland Scheidegger 2013-08-07 17:09:45 +02:00
parent c8572a9457
commit eac57bc223
6 changed files with 12 additions and 0 deletions

View File

@ -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);
}

View File

@ -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);

View File

@ -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)
{

View File

@ -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);
};

View File

@ -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);
}

View File

@ -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);
}