mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-25 22:25:58 +01:00
render/gles2: reword wlr_gles2_texture comments
These comments were a bit misleading: - "GL_TEXTURE_2D == mutable": not really, imported non-external-only DMA-BUFs would also use this target, but are not mutable. - "Only affects target == GL_TEXTURE_2D": same here. - "If imported from a wlr_buffer": not really, would be NULL if imported from a shm wlr_buffer. Adjust these comments to better reflect reality and adjust the check in gles2_texture_update_from_buffer().
This commit is contained in:
parent
84bef5c0c2
commit
876d789ad5
2 changed files with 3 additions and 8 deletions
|
@ -118,19 +118,14 @@ struct wlr_gles2_texture {
|
||||||
struct wlr_gles2_renderer *renderer;
|
struct wlr_gles2_renderer *renderer;
|
||||||
struct wl_list link; // wlr_gles2_renderer.textures
|
struct wl_list link; // wlr_gles2_renderer.textures
|
||||||
|
|
||||||
// Basically:
|
|
||||||
// GL_TEXTURE_2D == mutable
|
|
||||||
// GL_TEXTURE_EXTERNAL_OES == immutable
|
|
||||||
GLenum target;
|
GLenum target;
|
||||||
bool owns_tex;
|
bool owns_tex;
|
||||||
GLuint tex;
|
GLuint tex;
|
||||||
|
|
||||||
bool has_alpha;
|
bool has_alpha;
|
||||||
|
|
||||||
// Only affects target == GL_TEXTURE_2D
|
uint32_t drm_format; // for mutable textures only, used to interpret upload data
|
||||||
uint32_t drm_format; // used to interpret upload data
|
struct wlr_gles2_buffer *buffer; // for DMA-BUF imports only
|
||||||
// If imported from a wlr_buffer
|
|
||||||
struct wlr_gles2_buffer *buffer;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct wlr_gles2_render_pass {
|
struct wlr_gles2_render_pass {
|
||||||
|
|
|
@ -32,7 +32,7 @@ static bool gles2_texture_update_from_buffer(struct wlr_texture *wlr_texture,
|
||||||
struct wlr_buffer *buffer, const pixman_region32_t *damage) {
|
struct wlr_buffer *buffer, const pixman_region32_t *damage) {
|
||||||
struct wlr_gles2_texture *texture = gles2_get_texture(wlr_texture);
|
struct wlr_gles2_texture *texture = gles2_get_texture(wlr_texture);
|
||||||
|
|
||||||
if (texture->target != GL_TEXTURE_2D || texture->buffer) {
|
if (texture->drm_format == DRM_FORMAT_INVALID) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue