gallivm/llvmpipe: hand sample position type in for loading.
Reviewed-by: Mihai Preda <mhpreda@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18932>
This commit is contained in:
@@ -1893,7 +1893,8 @@ static void emit_sysval_intrin(struct lp_build_nir_context *bld_base,
|
||||
for (unsigned i = 0; i < 2; i++) {
|
||||
LLVMValueRef idx = LLVMBuildMul(gallivm->builder, bld->system_values.sample_id, lp_build_const_int32(gallivm, 2), "");
|
||||
idx = LLVMBuildAdd(gallivm->builder, idx, lp_build_const_int32(gallivm, i), "");
|
||||
LLVMValueRef val = lp_build_array_get(gallivm, bld->system_values.sample_pos, idx);
|
||||
LLVMValueRef val = lp_build_array_get2(gallivm, bld->system_values.sample_pos_type,
|
||||
bld->system_values.sample_pos, idx);
|
||||
result[i] = lp_build_broadcast_scalar(&bld_base->base, val);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -183,6 +183,7 @@ struct lp_bld_tgsi_system_values {
|
||||
LLVMValueRef tess_inner;
|
||||
LLVMValueRef vertices_in;
|
||||
LLVMValueRef sample_id;
|
||||
LLVMTypeRef sample_pos_type;
|
||||
LLVMValueRef sample_pos;
|
||||
LLVMValueRef sample_mask_in;
|
||||
LLVMValueRef view_index;
|
||||
|
||||
@@ -643,6 +643,7 @@ generate_fs_loop(struct gallivm_state *gallivm,
|
||||
struct lp_type type,
|
||||
LLVMTypeRef context_type,
|
||||
LLVMValueRef context_ptr,
|
||||
LLVMTypeRef sample_pos_type,
|
||||
LLVMValueRef sample_pos_array,
|
||||
LLVMValueRef num_loop,
|
||||
struct lp_build_interp_soa_context *interp,
|
||||
@@ -1020,6 +1021,7 @@ generate_fs_loop(struct gallivm_state *gallivm,
|
||||
|
||||
}
|
||||
system_values.sample_pos = sample_pos_array;
|
||||
system_values.sample_pos_type = sample_pos_type;
|
||||
|
||||
lp_build_interp_soa_update_inputs_dyn(interp, gallivm, loop_state.counter,
|
||||
mask_type, mask_store, sample_loop_state.counter);
|
||||
@@ -3415,6 +3417,7 @@ generate_fragment(struct llvmpipe_context *lp,
|
||||
fs_type,
|
||||
variant->jit_context_type,
|
||||
context_ptr,
|
||||
LLVMTypeOf(sample_pos_array),
|
||||
glob_sample_pos,
|
||||
num_loop,
|
||||
&interp,
|
||||
|
||||
Reference in New Issue
Block a user