diff options
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c index 9371e1c2818..b9c8446032e 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c @@ -152,7 +152,7 @@ lp_build_sample_wrap_nearest_float(struct lp_build_sample_context *bld, break; case PIPE_TEX_WRAP_CLAMP_TO_EDGE: length_minus_one = lp_build_sub(coord_bld, length, coord_bld->one); - if (bld->static_state->normalized_coords) { + if (bld->static_sampler_state->normalized_coords) { /* scale coord to length */ coord = lp_build_mul(coord_bld, coord, length); } @@ -407,7 +407,7 @@ lp_build_sample_wrap_linear_float(struct lp_build_sample_context *bld, } break; case PIPE_TEX_WRAP_CLAMP_TO_EDGE: - if (bld->static_state->normalized_coords) { + if (bld->static_sampler_state->normalized_coords) { /* mul by tex size */ coord = lp_build_mul(coord_bld, coord, length); } @@ -549,7 +549,7 @@ lp_build_sample_image_nearest(struct lp_build_sample_context *bld, s_float = s; t_float = t; r_float = r; - if (bld->static_state->normalized_coords) { + if (bld->static_sampler_state->normalized_coords) { LLVMValueRef scaled_size; LLVMValueRef flt_size; @@ -594,8 +594,8 @@ lp_build_sample_image_nearest(struct lp_build_sample_context *bld, bld->format_desc->block.width, s_ipart, s_float, width_vec, x_stride, - bld->static_state->pot_width, - bld->static_state->wrap_s, + bld->static_texture_state->pot_width, + bld->static_sampler_state->wrap_s, &x_offset, &x_subcoord); offset = x_offset; if (dims >= 2) { @@ -604,8 +604,8 @@ lp_build_sample_image_nearest(struct lp_build_sample_context *bld, bld->format_desc->block.height, t_ipart, t_float, height_vec, row_stride_vec, - bld->static_state->pot_height, - bld->static_state->wrap_t, + bld->static_texture_state->pot_height, + bld->static_sampler_state->wrap_t, &y_offset, &y_subcoord); offset = lp_build_add(&bld->int_coord_bld, offset, y_offset); if (dims >= 3) { @@ -614,15 +614,15 @@ lp_build_sample_image_nearest(struct lp_build_sample_context *bld, 1, /* block length (depth) */ r_ipart, r_float, depth_vec, img_stride_vec, - bld->static_state->pot_depth, - bld->static_state->wrap_r, + bld->static_texture_state->pot_depth, + bld->static_sampler_state->wrap_r, &z_offset, &z_subcoord); offset = lp_build_add(&bld->int_coord_bld, offset, z_offset); } } - if (bld->static_state->target == PIPE_TEXTURE_CUBE || - bld->static_state->target == PIPE_TEXTURE_1D_ARRAY || - bld->static_state->target == PIPE_TEXTURE_2D_ARRAY) { + if (bld->static_texture_state->target == PIPE_TEXTURE_CUBE || + bld->static_texture_state->target == PIPE_TEXTURE_1D_ARRAY || + bld->static_texture_state->target == PIPE_TEXTURE_2D_ARRAY) { LLVMValueRef z_offset; /* The r coord is the cube face in [0,5] or array layer */ z_offset = lp_build_mul(&bld->int_coord_bld, r, img_stride_vec); @@ -678,28 +678,28 @@ lp_build_sample_image_nearest_afloat(struct lp_build_sample_context *bld, /* Do texcoord wrapping */ lp_build_sample_wrap_nearest_float(bld, s, width_vec, - bld->static_state->pot_width, - bld->static_state->wrap_s, + bld->static_texture_state->pot_width, + bld->static_sampler_state->wrap_s, &x_icoord); if (dims >= 2) { lp_build_sample_wrap_nearest_float(bld, t, height_vec, - bld->static_state->pot_height, - bld->static_state->wrap_t, + bld->static_texture_state->pot_height, + bld->static_sampler_state->wrap_t, &y_icoord); if (dims >= 3) { lp_build_sample_wrap_nearest_float(bld, r, depth_vec, - bld->static_state->pot_depth, - bld->static_state->wrap_r, + bld->static_texture_state->pot_depth, + bld->static_sampler_state->wrap_r, &z_icoord); } } - if (bld->static_state->target == PIPE_TEXTURE_CUBE || - bld->static_state->target == PIPE_TEXTURE_1D_ARRAY || - bld->static_state->target == PIPE_TEXTURE_2D_ARRAY) { + if (bld->static_texture_state->target == PIPE_TEXTURE_CUBE || + bld->static_texture_state->target == PIPE_TEXTURE_1D_ARRAY || + bld->static_texture_state->target == PIPE_TEXTURE_2D_ARRAY) { z_icoord = r; } @@ -885,7 +885,7 @@ lp_build_sample_fetch_image_linear(struct lp_build_sample_context *bld, /* * Linear interpolation with 8.8 fixed point. */ - if (bld->static_state->force_nearest_s) { + if (bld->static_sampler_state->force_nearest_s) { /* special case 1-D lerp */ packed_lo = lp_build_lerp(&h16, t_fpart_lo, @@ -897,7 +897,7 @@ lp_build_sample_fetch_image_linear(struct lp_build_sample_context *bld, neighbors_hi[0][1][0], neighbors_hi[0][1][0]); } - else if (bld->static_state->force_nearest_t) { + else if (bld->static_sampler_state->force_nearest_t) { /* special case 1-D lerp */ packed_lo = lp_build_lerp(&h16, s_fpart_lo, @@ -1016,7 +1016,7 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld, s_float = s; t_float = t; r_float = r; - if (bld->static_state->normalized_coords) { + if (bld->static_sampler_state->normalized_coords) { LLVMValueRef scaled_size; LLVMValueRef flt_size; @@ -1045,10 +1045,10 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld, /* subtract 0.5 (add -128) */ i32_c128 = lp_build_const_int_vec(bld->gallivm, i32.type, -128); - if (!bld->static_state->force_nearest_s) { + if (!bld->static_sampler_state->force_nearest_s) { s = LLVMBuildAdd(builder, s, i32_c128, ""); } - if (dims >= 2 && !bld->static_state->force_nearest_t) { + if (dims >= 2 && !bld->static_sampler_state->force_nearest_t) { t = LLVMBuildAdd(builder, t, i32_c128, ""); } if (dims >= 3) { @@ -1082,15 +1082,15 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld, bld->format_desc->block.width, s_ipart, &s_fpart, s_float, width_vec, x_stride, - bld->static_state->pot_width, - bld->static_state->wrap_s, + bld->static_texture_state->pot_width, + bld->static_sampler_state->wrap_s, &x_offset0, &x_offset1, &x_subcoord[0], &x_subcoord[1]); /* add potential cube/array/mip offsets now as they are constant per pixel */ - if (bld->static_state->target == PIPE_TEXTURE_CUBE || - bld->static_state->target == PIPE_TEXTURE_1D_ARRAY || - bld->static_state->target == PIPE_TEXTURE_2D_ARRAY) { + if (bld->static_texture_state->target == PIPE_TEXTURE_CUBE || + bld->static_texture_state->target == PIPE_TEXTURE_1D_ARRAY || + bld->static_texture_state->target == PIPE_TEXTURE_2D_ARRAY) { LLVMValueRef z_offset; z_offset = lp_build_mul(&bld->int_coord_bld, r, img_stride_vec); /* The r coord is the cube face in [0,5] or array layer */ @@ -1114,8 +1114,8 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld, bld->format_desc->block.height, t_ipart, &t_fpart, t_float, height_vec, y_stride, - bld->static_state->pot_height, - bld->static_state->wrap_t, + bld->static_texture_state->pot_height, + bld->static_sampler_state->wrap_t, &y_offset0, &y_offset1, &y_subcoord[0], &y_subcoord[1]); @@ -1134,8 +1134,8 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld, bld->format_desc->block.height, r_ipart, &r_fpart, r_float, depth_vec, z_stride, - bld->static_state->pot_depth, - bld->static_state->wrap_r, + bld->static_texture_state->pot_depth, + bld->static_sampler_state->wrap_r, &z_offset0, &z_offset1, &z_subcoord[0], &z_subcoord[1]); for (y = 0; y < 2; y++) { @@ -1205,28 +1205,28 @@ lp_build_sample_image_linear_afloat(struct lp_build_sample_context *bld, lp_build_sample_wrap_linear_float(bld, bld->format_desc->block.width, s, width_vec, - bld->static_state->pot_width, - bld->static_state->wrap_s, + bld->static_texture_state->pot_width, + bld->static_sampler_state->wrap_s, &x_icoord0, &x_icoord1, &s_fpart, - bld->static_state->force_nearest_s); + bld->static_sampler_state->force_nearest_s); if (dims >= 2) { lp_build_sample_wrap_linear_float(bld, bld->format_desc->block.height, t, height_vec, - bld->static_state->pot_height, - bld->static_state->wrap_t, + bld->static_texture_state->pot_height, + bld->static_sampler_state->wrap_t, &y_icoord0, &y_icoord1, &t_fpart, - bld->static_state->force_nearest_t); + bld->static_sampler_state->force_nearest_t); if (dims >= 3) { lp_build_sample_wrap_linear_float(bld, bld->format_desc->block.height, r, depth_vec, - bld->static_state->pot_depth, - bld->static_state->wrap_r, + bld->static_texture_state->pot_depth, + bld->static_sampler_state->wrap_r, &z_icoord0, &z_icoord1, &r_fpart, 0); } @@ -1259,9 +1259,9 @@ lp_build_sample_image_linear_afloat(struct lp_build_sample_context *bld, &x_offset1, &x_subcoord[1]); /* add potential cube/array/mip offsets now as they are constant per pixel */ - if (bld->static_state->target == PIPE_TEXTURE_CUBE || - bld->static_state->target == PIPE_TEXTURE_1D_ARRAY || - bld->static_state->target == PIPE_TEXTURE_2D_ARRAY) { + if (bld->static_texture_state->target == PIPE_TEXTURE_CUBE || + bld->static_texture_state->target == PIPE_TEXTURE_1D_ARRAY || + bld->static_texture_state->target == PIPE_TEXTURE_2D_ARRAY) { LLVMValueRef z_offset; z_offset = lp_build_mul(&bld->int_coord_bld, r, img_stride_vec); /* The r coord is the cube face in [0,5] or array layer */ @@ -1582,20 +1582,20 @@ lp_build_sample_aos(struct lp_build_sample_context *bld, { struct lp_build_context *int_bld = &bld->int_bld; LLVMBuilderRef builder = bld->gallivm->builder; - const unsigned mip_filter = bld->static_state->min_mip_filter; - const unsigned min_filter = bld->static_state->min_img_filter; - const unsigned mag_filter = bld->static_state->mag_img_filter; + const unsigned mip_filter = bld->static_sampler_state->min_mip_filter; + const unsigned min_filter = bld->static_sampler_state->min_img_filter; + const unsigned mag_filter = bld->static_sampler_state->mag_img_filter; const unsigned dims = bld->dims; LLVMValueRef packed, packed_lo, packed_hi; LLVMValueRef unswizzled[4]; struct lp_build_context h16_bld; /* we only support the common/simple wrap modes at this time */ - assert(lp_is_simple_wrap_mode(bld->static_state->wrap_s)); + assert(lp_is_simple_wrap_mode(bld->static_sampler_state->wrap_s)); if (dims >= 2) - assert(lp_is_simple_wrap_mode(bld->static_state->wrap_t)); + assert(lp_is_simple_wrap_mode(bld->static_sampler_state->wrap_t)); if (dims >= 3) - assert(lp_is_simple_wrap_mode(bld->static_state->wrap_r)); + assert(lp_is_simple_wrap_mode(bld->static_sampler_state->wrap_r)); /* make 16-bit fixed-pt builder context */ |