LLVMValueRef context_ptr = params->context_ptr;
unsigned texture_unit = params->texture_unit;
unsigned target = params->target;
+ LLVMValueRef texture_unit_offset = params->texture_unit_offset;
if (static_state->format == PIPE_FORMAT_NONE) {
/*
if (params->samples_only) {
params->sizes_out[0] = lp_build_broadcast(gallivm, lp_build_vec_type(gallivm, params->int_type),
dynamic_state->num_samples(dynamic_state, gallivm,
- context_ptr, texture_unit, NULL));
+ context_ptr, texture_unit,
+ texture_unit_offset));
return;
}
if (params->explicit_lod) {
lod = LLVMBuildExtractElement(gallivm->builder, params->explicit_lod,
lp_build_const_int32(gallivm, 0), "");
first_level = dynamic_state->first_level(dynamic_state, gallivm,
- context_ptr, texture_unit, NULL);
+ context_ptr, texture_unit, texture_unit_offset);
level = LLVMBuildAdd(gallivm->builder, lod, first_level, "level");
lod = lp_build_broadcast_scalar(&bld_int_vec4, level);
} else {
size = LLVMBuildInsertElement(gallivm->builder, size,
dynamic_state->width(dynamic_state, gallivm,
- context_ptr, texture_unit, NULL),
+ context_ptr, texture_unit, texture_unit_offset),
lp_build_const_int32(gallivm, 0), "");
if (dims >= 2) {
size = LLVMBuildInsertElement(gallivm->builder, size,
dynamic_state->height(dynamic_state, gallivm,
- context_ptr, texture_unit, NULL),
+ context_ptr, texture_unit, texture_unit_offset),
lp_build_const_int32(gallivm, 1), "");
}
if (dims >= 3) {
size = LLVMBuildInsertElement(gallivm->builder, size,
dynamic_state->depth(dynamic_state, gallivm,
- context_ptr, texture_unit, NULL),
+ context_ptr, texture_unit, texture_unit_offset),
lp_build_const_int32(gallivm, 2), "");
}
if (has_array) {
LLVMValueRef layers = dynamic_state->depth(dynamic_state, gallivm,
- context_ptr, texture_unit, NULL);
+ context_ptr, texture_unit, texture_unit_offset);
if (target == PIPE_TEXTURE_CUBE_ARRAY) {
/*
* It looks like GL wants number of cubes, d3d10.1 has it undefined?
/* everything is scalar for now */
lp_build_context_init(&leveli_bld, gallivm, lp_type_int_vec(32, 32));
last_level = dynamic_state->last_level(dynamic_state, gallivm,
- context_ptr, texture_unit, NULL);
+ context_ptr, texture_unit, texture_unit_offset);
out = lp_build_cmp(&leveli_bld, PIPE_FUNC_LESS, level, first_level);
out1 = lp_build_cmp(&leveli_bld, PIPE_FUNC_GREATER, level, last_level);
LLVMValueRef last_level;
last_level = dynamic_state->last_level(dynamic_state, gallivm,
- context_ptr, texture_unit, NULL);
+ context_ptr, texture_unit, texture_unit_offset);
num_levels = lp_build_sub(&bld_int_scalar, last_level, first_level);
num_levels = lp_build_add(&bld_int_scalar, num_levels, bld_int_scalar.one);
}