Mesa (master): svga: fix vgpu9 sprite coordinate bug
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Aug 29 17:31:13 UTC 2018
Module: Mesa
Branch: master
Commit: fb7e462c979b29b65b841811cfe97a26c9cc93ee
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fb7e462c979b29b65b841811cfe97a26c9cc93ee
Author: Brian Paul <brianp at vmware.com>
Date: Thu Aug 23 09:25:15 2018 -0600
svga: fix vgpu9 sprite coordinate bug
Setting GL_POINT_SPRITE_COORD_ORIGIN to GL_LOWER_LEFT did not work for
vgpu9. We can use the rasterizer sprite_coord_enable bitfield as-is.
We need to index into it using the TGSI semantic index, not the
register index.
This fixes the Piglit fbo-gl_pointcoord and glsl-fs-pointcoord tests.
Testing done: Piglit, Mesa sprite demos
Reviewed-by: Charmaine Lee <charmainel at vmware.com>
---
src/gallium/drivers/svga/svga_shader.h | 3 +--
src/gallium/drivers/svga/svga_state_fs.c | 5 +----
src/gallium/drivers/svga/svga_tgsi_decl_sm30.c | 2 +-
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/src/gallium/drivers/svga/svga_shader.h b/src/gallium/drivers/svga/svga_shader.h
index 70d1246982..b703e048b2 100644
--- a/src/gallium/drivers/svga/svga_shader.h
+++ b/src/gallium/drivers/svga/svga_shader.h
@@ -93,7 +93,7 @@ struct svga_compile_key
unsigned num_unnormalized_coords:8;
unsigned clip_plane_enable:PIPE_MAX_CLIP_PLANES;
unsigned sprite_origin_lower_left:1;
- unsigned sprite_coord_enable;
+ uint16_t sprite_coord_enable;
struct {
unsigned compare_mode:1;
unsigned compare_func:3;
@@ -101,7 +101,6 @@ struct svga_compile_key
unsigned texel_bias:1;
unsigned width_height_idx:5; /**< texture unit */
unsigned is_array:1;
- unsigned sprite_texgen:1;
unsigned swizzle_r:3;
unsigned swizzle_g:3;
unsigned swizzle_b:3;
diff --git a/src/gallium/drivers/svga/svga_state_fs.c b/src/gallium/drivers/svga/svga_state_fs.c
index 5190542d02..73f8856b15 100644
--- a/src/gallium/drivers/svga/svga_state_fs.c
+++ b/src/gallium/drivers/svga/svga_state_fs.c
@@ -331,10 +331,7 @@ make_fs_key(const struct svga_context *svga,
}
/* sprite coord gen state */
- for (i = 0; i < svga->curr.num_samplers[shader]; ++i) {
- key->tex[i].sprite_texgen =
- svga->curr.rast->templ.sprite_coord_enable & (1 << i);
- }
+ key->sprite_coord_enable = svga->curr.rast->templ.sprite_coord_enable;
key->sprite_origin_lower_left = (svga->curr.rast->templ.sprite_coord_mode
== PIPE_SPRITE_COORD_LOWER_LEFT);
diff --git a/src/gallium/drivers/svga/svga_tgsi_decl_sm30.c b/src/gallium/drivers/svga/svga_tgsi_decl_sm30.c
index 0ecabc7e74..766e439188 100644
--- a/src/gallium/drivers/svga/svga_tgsi_decl_sm30.c
+++ b/src/gallium/drivers/svga/svga_tgsi_decl_sm30.c
@@ -289,7 +289,7 @@ ps30_input(struct svga_shader_emitter *emit,
if (semantic.Name == TGSI_SEMANTIC_GENERIC &&
emit->key.sprite_origin_lower_left &&
index >= 1 &&
- emit->key.tex[index - 1].sprite_texgen) {
+ emit->key.sprite_coord_enable & (1 << semantic.Index)) {
/* This is a sprite texture coord with lower-left origin.
* We need to invert the texture T coordinate since the SVGA3D
* device only supports an upper-left origin.
More information about the mesa-commit
mailing list