c/render: Correctly scale uv for compute distortion

This commit is contained in:
Jakob Bornecrantz 2022-04-15 21:44:46 +01:00 committed by Jakob Bornecrantz
parent 3b6b45b762
commit ca33ac434c

View file

@ -449,11 +449,11 @@ create_and_file_in_distortion_buffer_for_view(struct vk_bundle *vk,
for (int row = 0; row < COMP_DISTORTION_IMAGE_DIMENSIONS; row++) {
// This goes from 0 to 1.0 inclusive.
float v = (double)row / (double)COMP_DISTORTION_IMAGE_DIMENSIONS;
float v = (double)row / (double)(COMP_DISTORTION_IMAGE_DIMENSIONS - 1);
for (int col = 0; col < COMP_DISTORTION_IMAGE_DIMENSIONS; col++) {
// This goes from 0 to 1.0 inclusive.
float u = (double)col / (double)COMP_DISTORTION_IMAGE_DIMENSIONS;
float u = (double)col / (double)(COMP_DISTORTION_IMAGE_DIMENSIONS - 1);
struct xrt_uv_triplet result;
xrt_device_compute_distortion(xdev, view, u, v, &result);