mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
Remove support for DMA-BUF flags
They are never used in practice, which makes all of our flag handling effectively dead code. Also, APIs such as KMS don't provide a good way to deal with the flags. Let's just fail the DMA-BUF import when clients provide flags.
This commit is contained in:
parent
9a4e1095ca
commit
a04cfca4da
15 changed files with 12 additions and 83 deletions
|
|
@ -309,7 +309,6 @@ static bool gles2_render_subtexture_with_matrix(
|
|||
glUseProgram(shader->program);
|
||||
|
||||
glUniformMatrix3fv(shader->proj, 1, GL_FALSE, gl_matrix);
|
||||
glUniform1i(shader->invert_y, texture->inverted_y);
|
||||
glUniform1i(shader->tex, 0);
|
||||
glUniform1f(shader->alpha, alpha);
|
||||
|
||||
|
|
@ -810,7 +809,6 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
|
|||
goto error;
|
||||
}
|
||||
renderer->shaders.tex_rgba.proj = glGetUniformLocation(prog, "proj");
|
||||
renderer->shaders.tex_rgba.invert_y = glGetUniformLocation(prog, "invert_y");
|
||||
renderer->shaders.tex_rgba.tex = glGetUniformLocation(prog, "tex");
|
||||
renderer->shaders.tex_rgba.alpha = glGetUniformLocation(prog, "alpha");
|
||||
renderer->shaders.tex_rgba.pos_attrib = glGetAttribLocation(prog, "pos");
|
||||
|
|
@ -822,7 +820,6 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
|
|||
goto error;
|
||||
}
|
||||
renderer->shaders.tex_rgbx.proj = glGetUniformLocation(prog, "proj");
|
||||
renderer->shaders.tex_rgbx.invert_y = glGetUniformLocation(prog, "invert_y");
|
||||
renderer->shaders.tex_rgbx.tex = glGetUniformLocation(prog, "tex");
|
||||
renderer->shaders.tex_rgbx.alpha = glGetUniformLocation(prog, "alpha");
|
||||
renderer->shaders.tex_rgbx.pos_attrib = glGetAttribLocation(prog, "pos");
|
||||
|
|
@ -835,7 +832,6 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
|
|||
goto error;
|
||||
}
|
||||
renderer->shaders.tex_ext.proj = glGetUniformLocation(prog, "proj");
|
||||
renderer->shaders.tex_ext.invert_y = glGetUniformLocation(prog, "invert_y");
|
||||
renderer->shaders.tex_ext.tex = glGetUniformLocation(prog, "tex");
|
||||
renderer->shaders.tex_ext.alpha = glGetUniformLocation(prog, "alpha");
|
||||
renderer->shaders.tex_ext.pos_attrib = glGetAttribLocation(prog, "pos");
|
||||
|
|
|
|||
|
|
@ -28,18 +28,13 @@ const GLchar quad_fragment_src[] =
|
|||
// Textured quads
|
||||
const GLchar tex_vertex_src[] =
|
||||
"uniform mat3 proj;\n"
|
||||
"uniform bool invert_y;\n"
|
||||
"attribute vec2 pos;\n"
|
||||
"attribute vec2 texcoord;\n"
|
||||
"varying vec2 v_texcoord;\n"
|
||||
"\n"
|
||||
"void main() {\n"
|
||||
" gl_Position = vec4(proj * vec3(pos, 1.0), 1.0);\n"
|
||||
" if (invert_y) {\n"
|
||||
" v_texcoord = vec2(texcoord.x, 1.0 - texcoord.y);\n"
|
||||
" } else {\n"
|
||||
" v_texcoord = texcoord;\n"
|
||||
" }\n"
|
||||
" v_texcoord = texcoord;\n"
|
||||
"}\n";
|
||||
|
||||
const GLchar tex_fragment_src_rgba[] =
|
||||
|
|
|
|||
|
|
@ -250,8 +250,6 @@ static struct wlr_texture *gles2_texture_from_dmabuf(
|
|||
return NULL;
|
||||
}
|
||||
texture->drm_format = DRM_FORMAT_INVALID; // texture can't be written anyways
|
||||
texture->inverted_y =
|
||||
(attribs->flags & WLR_DMABUF_ATTRIBUTES_FLAGS_Y_INVERT) != 0;
|
||||
|
||||
const struct wlr_pixel_format_info *drm_fmt =
|
||||
drm_get_pixel_format_info(attribs->format);
|
||||
|
|
@ -363,6 +361,5 @@ void wlr_gles2_texture_get_attribs(struct wlr_texture *wlr_texture,
|
|||
memset(attribs, 0, sizeof(*attribs));
|
||||
attribs->target = texture->target;
|
||||
attribs->tex = texture->tex;
|
||||
attribs->inverted_y = texture->inverted_y;
|
||||
attribs->has_alpha = texture->has_alpha;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue