gl-renderer: Test for GL_EXT_unpack_subimage not GL_UNPACK_ROW_LENGTH
It is defined by the mesa #include, which is just a copy of the official Khronos header. It's just defined in a different section than the extension tokens. In the mean time, the extension tokens were renamed to add a _EXT suffix (eg GL_UNPACK_ROW_LENGTH -> GL_UNPACK_ROW_LENGTH_EXT) and we silently failed to used the subimage extension.
This commit is contained in:
+7
-8
@@ -1112,7 +1112,7 @@ gl_renderer_flush_damage(struct weston_surface *surface)
|
|||||||
GLenum format;
|
GLenum format;
|
||||||
int pixel_type;
|
int pixel_type;
|
||||||
|
|
||||||
#ifdef GL_UNPACK_ROW_LENGTH
|
#ifdef GL_EXT_unpack_subimage
|
||||||
pixman_box32_t *rectangles;
|
pixman_box32_t *rectangles;
|
||||||
void *data;
|
void *data;
|
||||||
int i, n;
|
int i, n;
|
||||||
@@ -1162,14 +1162,13 @@ gl_renderer_flush_damage(struct weston_surface *surface)
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GL_UNPACK_ROW_LENGTH
|
#ifdef GL_EXT_unpack_subimage
|
||||||
/* Mesa does not define GL_EXT_unpack_subimage */
|
glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, gs->pitch);
|
||||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, gs->pitch);
|
|
||||||
data = wl_shm_buffer_get_data(buffer->shm_buffer);
|
data = wl_shm_buffer_get_data(buffer->shm_buffer);
|
||||||
|
|
||||||
if (gs->needs_full_upload) {
|
if (gs->needs_full_upload) {
|
||||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
|
glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, 0);
|
||||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
|
glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, 0);
|
||||||
glTexSubImage2D(GL_TEXTURE_2D, 0,
|
glTexSubImage2D(GL_TEXTURE_2D, 0,
|
||||||
0, 0, gs->pitch, buffer->height,
|
0, 0, gs->pitch, buffer->height,
|
||||||
format, pixel_type, data);
|
format, pixel_type, data);
|
||||||
@@ -1182,8 +1181,8 @@ gl_renderer_flush_damage(struct weston_surface *surface)
|
|||||||
|
|
||||||
r = weston_surface_to_buffer_rect(surface, rectangles[i]);
|
r = weston_surface_to_buffer_rect(surface, rectangles[i]);
|
||||||
|
|
||||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, r.x1);
|
glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, r.x1);
|
||||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, r.y1);
|
glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, r.y1);
|
||||||
glTexSubImage2D(GL_TEXTURE_2D, 0, r.x1, r.y1,
|
glTexSubImage2D(GL_TEXTURE_2D, 0, r.x1, r.y1,
|
||||||
r.x2 - r.x1, r.y2 - r.y1,
|
r.x2 - r.x1, r.y2 - r.y1,
|
||||||
format, pixel_type, data);
|
format, pixel_type, data);
|
||||||
|
|||||||
Reference in New Issue
Block a user