- float offset, total_weight;
- combine_two_samples(w1, w2, &offset, &total_weight, NULL);
-
- if (direction == HORIZONTAL) {
- samples[2 * i + 0] = (base_pos + offset) / (float)width;
- } else if (direction == VERTICAL) {
- samples[2 * i + 0] = (base_pos + offset) / (float)height;
- } else {
- assert(false);
- }
+ float pos1 = base_pos / (float)size;
+ float pos2 = (base_pos + 1) / (float)size;
+ float pos, total_weight;
+ combine_two_samples(w1, w2, pos1, pos2, num_subtexels, inv_num_subtexels, &pos, &total_weight, NULL);