Fix screenshot with region not working correctly for some sizes and possibly crashing

This commit is contained in:
dec05eba
2025-03-13 01:38:26 +01:00
parent 92492db788
commit af54684103
10 changed files with 51 additions and 27 deletions

View File

@@ -113,12 +113,11 @@ static int gsr_capture_xcomposite_start(gsr_capture *cap, gsr_capture_metadata *
self->params.egl->glBindTexture(GL_TEXTURE_2D, 0);
if(self->params.output_resolution.x == 0 && self->params.output_resolution.y == 0) {
self->params.output_resolution = self->texture_size;
capture_metadata->width = FFALIGN(self->texture_size.x, 2);
capture_metadata->height = FFALIGN(self->texture_size.y, 2);
capture_metadata->width = self->texture_size.x;
capture_metadata->height = self->texture_size.y;
} else {
capture_metadata->width = FFALIGN(self->params.output_resolution.x, 2);
capture_metadata->height = FFALIGN(self->params.output_resolution.y, 2);
capture_metadata->width = self->params.output_resolution.x;
capture_metadata->height = self->params.output_resolution.y;
}
self->fast_path_failed = self->params.egl->gpu_info.vendor == GSR_GPU_VENDOR_AMD && !gl_driver_version_greater_than(&self->params.egl->gpu_info, 24, 0, 9);