mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-08 12:28:04 +02:00
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:
parent
21f7c922a6
commit
e7d3a309d6
1 changed files with 7 additions and 8 deletions
|
|
@ -1110,7 +1110,7 @@ gl_renderer_flush_damage(struct weston_surface *surface)
|
|||
struct gl_surface_state *gs = get_surface_state(surface);
|
||||
struct weston_buffer *buffer = gs->buffer_ref.buffer;
|
||||
|
||||
#ifdef GL_UNPACK_ROW_LENGTH
|
||||
#ifdef GL_EXT_unpack_subimage
|
||||
pixman_box32_t *rectangles;
|
||||
void *data;
|
||||
int i, n;
|
||||
|
|
@ -1144,14 +1144,13 @@ gl_renderer_flush_damage(struct weston_surface *surface)
|
|||
goto done;
|
||||
}
|
||||
|
||||
#ifdef GL_UNPACK_ROW_LENGTH
|
||||
/* Mesa does not define GL_EXT_unpack_subimage */
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, gs->pitch);
|
||||
#ifdef GL_EXT_unpack_subimage
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, gs->pitch);
|
||||
data = wl_shm_buffer_get_data(buffer->shm_buffer);
|
||||
|
||||
if (gs->needs_full_upload) {
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, 0);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, 0);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0,
|
||||
0, 0, gs->pitch, buffer->height,
|
||||
GL_BGRA_EXT, GL_UNSIGNED_BYTE, data);
|
||||
|
|
@ -1164,8 +1163,8 @@ gl_renderer_flush_damage(struct weston_surface *surface)
|
|||
|
||||
r = weston_surface_to_buffer_rect(surface, rectangles[i]);
|
||||
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, r.x1);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, r.y1);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, r.x1);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, r.y1);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, r.x1, r.y1,
|
||||
r.x2 - r.x1, r.y2 - r.y1,
|
||||
GL_BGRA_EXT, GL_UNSIGNED_BYTE, data);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue