Commit 705fed33eaf60341b6ebc7c0d202dab3f18543a8.patch
mesa: Fix a division in _mesa_meta_draw_tex.
Both crop rectangle and texture dimensions are integers. Cast to get
float division.
| |   |
| 2135 | 2135 | const struct gl_texture_object *texObj; |
| 2136 | 2136 | const struct gl_texture_image *texImage; |
| 2137 | 2137 | GLfloat s, t, s1, t1; |
| GLuint tw, th; |
| 2138 | 2139 | |
| 2139 | 2140 | if (!ctx->Texture.Unit[i]._ReallyEnabled) { |
| 2140 | 2141 | GLuint j; |
| … | … | |
| 2148 | 2148 | |
| 2149 | 2149 | texObj = ctx->Texture.Unit[i]._Current; |
| 2150 | 2150 | texImage = texObj->Image[0][texObj->BaseLevel]; |
| tw = texImage->Width2; |
| th = texImage->Height2; |
| 2151 | 2153 | |
| s = texObj->CropRect[0] / texImage->Width2; |
| t = texObj->CropRect[1] / texImage->Height2; |
| s1 = (texObj->CropRect[0] + texObj->CropRect[2]) / texImage->Width2; |
| t1 = (texObj->CropRect[1] + texObj->CropRect[3]) / texImage->Height2; |
| s = (GLfloat) texObj->CropRect[0] / tw; |
| t = (GLfloat) texObj->CropRect[1] / th; |
| s1 = (GLfloat) (texObj->CropRect[0] + texObj->CropRect[2]) / tw; |
| t1 = (GLfloat) (texObj->CropRect[1] + texObj->CropRect[3]) / th; |
| 2156 | 2158 | |
| 2157 | 2159 | verts[0].st[i][0] = s; |
| 2158 | 2160 | verts[0].st[i][1] = t; |