diff options
author | Olivier Galibert <galibert@pobox.com> | 2012-05-17 16:48:54 +0200 |
---|---|---|
committer | José Fonseca <jose.r.fonseca@gmail.com> | 2012-05-18 00:27:28 +0100 |
commit | 5d10d757276a599a60a68b88b21087b5824a8df7 (patch) | |
tree | b27a03dec6ac9b33f0522caf2b5e306229dbecce /src/gallium/auxiliary/draw/draw_llvm_sample.c | |
parent | 1ec421823b1263a7b482adf48a15b186ea91efd2 (diff) | |
download | external_mesa3d-5d10d757276a599a60a68b88b21087b5824a8df7.zip external_mesa3d-5d10d757276a599a60a68b88b21087b5824a8df7.tar.gz external_mesa3d-5d10d757276a599a60a68b88b21087b5824a8df7.tar.bz2 |
llvmpipe: Implement TXQ.
Piglits test for fragment shaders pass, vertex shaders fail. The
actual failure seems to be in the interpolators, and not the
textureSize query.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jose.r.fonseca@gmail.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_llvm_sample.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_llvm_sample.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm_sample.c b/src/gallium/auxiliary/draw/draw_llvm_sample.c index 8af3461..0a8b3bc 100644 --- a/src/gallium/auxiliary/draw/draw_llvm_sample.c +++ b/src/gallium/auxiliary/draw/draw_llvm_sample.c @@ -195,6 +195,28 @@ draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base, } +/** + * Fetch the texture size. + */ +static void +draw_llvm_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base, + struct gallivm_state *gallivm, + unsigned unit, + LLVMValueRef explicit_lod, /* optional */ + LLVMValueRef *sizes_out) +{ + struct draw_llvm_sampler_soa *sampler = (struct draw_llvm_sampler_soa *)base; + + assert(unit < PIPE_MAX_VERTEX_SAMPLERS); + + lp_build_size_query_soa(gallivm, + &sampler->dynamic_state.static_state[unit], + &sampler->dynamic_state.base, + unit, + explicit_lod, + sizes_out); +} + struct lp_build_sampler_soa * draw_llvm_sampler_soa_create(const struct lp_sampler_static_state *static_state, LLVMValueRef context_ptr) @@ -207,6 +229,7 @@ draw_llvm_sampler_soa_create(const struct lp_sampler_static_state *static_state, sampler->base.destroy = draw_llvm_sampler_soa_destroy; sampler->base.emit_fetch_texel = draw_llvm_sampler_soa_emit_fetch_texel; + sampler->base.emit_size_query = draw_llvm_sampler_soa_emit_size_query; sampler->dynamic_state.base.width = draw_llvm_texture_width; sampler->dynamic_state.base.height = draw_llvm_texture_height; sampler->dynamic_state.base.depth = draw_llvm_texture_depth; |