summaryrefslogtreecommitdiff
path: root/glamor/glamor_transform.c
diff options
context:
space:
mode:
Diffstat (limited to 'glamor/glamor_transform.c')
-rw-r--r--glamor/glamor_transform.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/glamor/glamor_transform.c b/glamor/glamor_transform.c
index e94bca856..f476a99b7 100644
--- a/glamor/glamor_transform.c
+++ b/glamor/glamor_transform.c
@@ -155,11 +155,7 @@ glamor_set_solid(PixmapPtr pixmap,
}
Bool
-glamor_set_texture(PixmapPtr texture,
- int off_x,
- int off_y,
- GLint offset_uniform,
- GLint size_inv_uniform)
+glamor_set_texture_pixmap(PixmapPtr texture)
{
glamor_pixmap_private *texture_priv;
@@ -174,6 +170,23 @@ glamor_set_texture(PixmapPtr texture,
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texture_priv->fbo->tex);
+ /* we're not setting the sampler uniform here as we always use
+ * GL_TEXTURE0, and the default value for uniforms is zero. So,
+ * save a bit of CPU time by taking advantage of that.
+ */
+ return TRUE;
+}
+
+Bool
+glamor_set_texture(PixmapPtr texture,
+ int off_x,
+ int off_y,
+ GLint offset_uniform,
+ GLint size_inv_uniform)
+{
+ if (!glamor_set_texture_pixmap(texture))
+ return FALSE;
+
glUniform2f(offset_uniform, off_x, off_y);
glUniform2f(size_inv_uniform, 1.0f/texture->drawable.width, 1.0f/texture->drawable.height);
return TRUE;