- float offset, total_weight;
- combine_two_samples(w1, w2, &offset, &total_weight, NULL);
-
- float x = 0.0f, y = 0.0f;
-
- if (direction == HORIZONTAL) {
- x = (base_pos + offset) / (float)width;
- } else if (direction == VERTICAL) {
- y = (base_pos + offset) / (float)height;
- } else {
- assert(false);
- }
+ float pos1 = base_pos / (float)size;
+ float pos, total_weight;
+ combine_two_samples(w1, w2, pos1, 1.0 / (float)size, size, num_subtexels, inv_num_subtexels, &pos, &total_weight, nullptr);