X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fswr%2Fswr_tex_sample.cpp;h=f1ac41b0895920467a52f15ff5c54e9de5bfe94a;hb=166c00e28e453e1510e2cabed028eb18bf7d8bd9;hp=66d6b0fdea58fc6ebf4b97eba0ecfc852e74971a;hpb=3a26ef23e78f811abdfe657b52b9bc057b9ce5b6;p=mesa.git diff --git a/src/gallium/drivers/swr/swr_tex_sample.cpp b/src/gallium/drivers/swr/swr_tex_sample.cpp index 66d6b0fdea5..f1ac41b0895 100644 --- a/src/gallium/drivers/swr/swr_tex_sample.cpp +++ b/src/gallium/drivers/swr/swr_tex_sample.cpp @@ -46,7 +46,7 @@ #include "state.h" #include "JitManager.h" -#include "state_llvm.h" +#include "gen_state_llvm.h" #include "pipe/p_defines.h" #include "pipe/p_shader_tokens.h" @@ -58,8 +58,9 @@ #include "util/u_memory.h" #include "swr_tex_sample.h" -#include "swr_context_llvm.h" +#include "gen_swr_context_llvm.h" +using namespace SwrJit; /** * This provides the bridge between the sampler state store in @@ -73,7 +74,7 @@ struct swr_sampler_dynamic_state { const struct swr_sampler_static_state *static_state; - unsigned shader_type; + enum pipe_shader_type shader_type; }; @@ -122,6 +123,9 @@ swr_texture_member(const struct lp_sampler_dynamic_state *base, case PIPE_SHADER_VERTEX: indices[1] = lp_build_const_int32(gallivm, swr_draw_context_texturesVS); break; + case PIPE_SHADER_GEOMETRY: + indices[1] = lp_build_const_int32(gallivm, swr_draw_context_texturesGS); + break; default: assert(0 && "unsupported shader type"); break; @@ -131,7 +135,7 @@ swr_texture_member(const struct lp_sampler_dynamic_state *base, /* context[0].textures[unit].member */ indices[3] = lp_build_const_int32(gallivm, member_index); - ptr = LLVMBuildGEP(builder, context_ptr, indices, Elements(indices), ""); + ptr = LLVMBuildGEP(builder, context_ptr, indices, ARRAY_SIZE(indices), ""); if (emit_load) res = LLVMBuildLoad(builder, ptr, ""); @@ -216,6 +220,9 @@ swr_sampler_member(const struct lp_sampler_dynamic_state *base, case PIPE_SHADER_VERTEX: indices[1] = lp_build_const_int32(gallivm, swr_draw_context_samplersVS); break; + case PIPE_SHADER_GEOMETRY: + indices[1] = lp_build_const_int32(gallivm, swr_draw_context_samplersGS); + break; default: assert(0 && "unsupported shader type"); break; @@ -225,7 +232,7 @@ swr_sampler_member(const struct lp_sampler_dynamic_state *base, /* context[0].samplers[unit].member */ indices[3] = lp_build_const_int32(gallivm, member_index); - ptr = LLVMBuildGEP(builder, context_ptr, indices, Elements(indices), ""); + ptr = LLVMBuildGEP(builder, context_ptr, indices, ARRAY_SIZE(indices), ""); if (emit_load) res = LLVMBuildLoad(builder, ptr, ""); @@ -318,7 +325,7 @@ swr_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base, struct lp_build_sampler_soa * swr_sampler_soa_create(const struct swr_sampler_static_state *static_state, - unsigned shader_type) + enum pipe_shader_type shader_type) { struct swr_sampler_soa *sampler;