summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_llvm_sample.c
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2013-08-08 03:42:46 +0200
committerRoland Scheidegger <sroland@vmware.com>2013-08-09 20:49:18 +0200
commitb0f74250e1496d4872fd731b45049868b3efc883 (patch)
tree720be86f5b649d145d91690e37b0f59233bfe550 /src/gallium/auxiliary/draw/draw_llvm_sample.c
parent38ad404f7633aded98a0d67438e6bec0d684a5c6 (diff)
downloadexternal_mesa3d-b0f74250e1496d4872fd731b45049868b3efc883.zip
external_mesa3d-b0f74250e1496d4872fd731b45049868b3efc883.tar.gz
external_mesa3d-b0f74250e1496d4872fd731b45049868b3efc883.tar.bz2
gallivm: use texture target from shader instead of static state for size query
d3d10 has no notion of distinct array resources neither at the resource nor sampler view level. However, shader dcl of resources certainly has, and d3d10 expects resinfo to return the values according to that - in particular a resource might have been a 1d texture with some array layers, then the sampler view might have only used 1 layer so it can be accessed both as 1d or 1d array texture (I think - the former definitely works). resinfo of a resource decleared as array needs to return number of array layers but non-array resource needs to return 0 (and not 1). Hence fix this by passing the target from the shader decl to emit_size_query and use that (in case of OpenGL the target will come from the instruction itself). Could probably do the same for actual sampling, though it may not matter there (as the bogus components will essentially get clamped away), possibly could wreak havoc though if it REALLY doesn't match (which is of course an error but still). Reviewed-by: Zack Rusin <zackr@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_llvm_sample.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm_sample.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm_sample.c b/src/gallium/auxiliary/draw/draw_llvm_sample.c
index 3016d7c..f10cba3 100644
--- a/src/gallium/auxiliary/draw/draw_llvm_sample.c
+++ b/src/gallium/auxiliary/draw/draw_llvm_sample.c
@@ -270,6 +270,7 @@ draw_llvm_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base,
struct gallivm_state *gallivm,
struct lp_type type,
unsigned texture_unit,
+ unsigned target,
boolean need_nr_mips,
boolean scalar_lod,
LLVMValueRef explicit_lod, /* optional */
@@ -284,6 +285,7 @@ draw_llvm_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base,
&sampler->dynamic_state.base,
type,
texture_unit,
+ target,
need_nr_mips,
scalar_lod,
explicit_lod,