diff options
author | Roland Scheidegger <[email protected]> | 2015-03-25 03:10:10 +0100 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2015-03-27 19:25:53 +0100 |
commit | 8dad9455ff748c543635b24908566c3b94cb93a9 (patch) | |
tree | fadf8b3b7e08a30fe37e53b4c4ea226db29ad55d /src/gallium/auxiliary/draw/draw_llvm.c | |
parent | 787aa26cb7b48504f7770cacfc321324ecafa29a (diff) |
gallivm: pass jit_context pointer through to sampling
The callbacks used for getting the dynamic texture/sampler state were using
the jit_context from the generated jit function. This works just fine, however
that way it's impossible to generate separate functions for texture sampling,
as will be done in the next commit. Hence, pass this pointer through all
interfaces so it can be passed to a separate function (technically, it would
probably be possible to extract this pointer from the current function instead,
but this feels hacky and would probably require some more hacks if we'd use
real functions instead of inlining all shader functions at some point).
There should be no difference in the generated code for now.
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_llvm.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_llvm.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c index 6e1fb407c53..1e6e6993814 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.c +++ b/src/gallium/auxiliary/draw/draw_llvm.c @@ -620,6 +620,7 @@ generate_vs(struct draw_llvm_variant *variant, system_values, inputs, outputs, + context_ptr, draw_sampler, &llvm->draw->vs.vertex_shader->info, NULL); @@ -1630,9 +1631,7 @@ draw_llvm_generate(struct draw_llvm *llvm, struct draw_llvm_variant *variant, LLVMBuildStore(builder, lp_build_zero(gallivm, lp_int_type(vs_type)), clipmask_bool_ptr); /* code generated texture sampling */ - sampler = draw_llvm_sampler_soa_create( - draw_llvm_variant_key_samplers(key), - context_ptr); + sampler = draw_llvm_sampler_soa_create(draw_llvm_variant_key_samplers(key)); if (elts) { start = zero; @@ -2163,8 +2162,7 @@ draw_gs_llvm_generate(struct draw_llvm *llvm, draw_gs_jit_context_num_constants(variant->gallivm, context_ptr); /* code generated texture sampling */ - sampler = draw_llvm_sampler_soa_create(variant->key.samplers, - context_ptr); + sampler = draw_llvm_sampler_soa_create(variant->key.samplers); mask_val = generate_mask_value(variant, gs_type); lp_build_mask_begin(&mask, gallivm, gs_type, mask_val); @@ -2187,6 +2185,7 @@ draw_gs_llvm_generate(struct draw_llvm *llvm, &system_values, NULL, outputs, + context_ptr, sampler, &llvm->draw->gs.geometry_shader->info, (const struct lp_build_tgsi_gs_iface *)&gs_iface); |