Discussion:
[PATCH] svga: check for null fs pointer in update_samplers()
Add Reply
Brian Paul
2017-12-28 16:19:24 UTC
Reply
Permalink
Raw Message
This can happen when there's no active fragment shader, such as
when using transform feedback. This wasn't hit by any Piglit test
but is hit by Daniel Rákos' Nature demo. VMware bug 2026189.
---
src/gallium/drivers/svga/svga_state_sampler.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/svga/svga_state_sampler.c b/src/gallium/drivers/svga/svga_state_sampler.c
index 9bd0d53..11f36e3 100644
--- a/src/gallium/drivers/svga/svga_state_sampler.c
+++ b/src/gallium/drivers/svga/svga_state_sampler.c
@@ -399,7 +399,7 @@ update_samplers(struct svga_context *svga, unsigned dirty )
* for this texture unit, don't enable shadow compare in
* the texture sampler state.
*/
- if (fs->fs_shadow_compare_units & (1 << i)) {
+ if (fs && (fs->fs_shadow_compare_units & (1 << i))) {
fs_shadow = true;
}
}
--
1.9.1
Charmaine Lee
2017-12-28 16:43:43 UTC
Reply
Permalink
Raw Message
Reviewed-by: Charmaine Lee <***@vmware.com>

________________________________________
From: Brian Paul <***@vmware.com>
Sent: Thursday, December 28, 2017 8:19:24 AM
To: mesa-***@lists.freedesktop.org
Cc: Charmaine Lee; Neha Bhende
Subject: [PATCH] svga: check for null fs pointer in update_samplers()

This can happen when there's no active fragment shader, such as
when using transform feedback. This wasn't hit by any Piglit test
but is hit by Daniel Rákos' Nature demo. VMware bug 2026189.
---
src/gallium/drivers/svga/svga_state_sampler.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/svga/svga_state_sampler.c b/src/gallium/drivers/svga/svga_state_sampler.c
index 9bd0d53..11f36e3 100644
--- a/src/gallium/drivers/svga/svga_state_sampler.c
+++ b/src/gallium/drivers/svga/svga_state_sampler.c
@@ -399,7 +399,7 @@ update_samplers(struct svga_context *svga, unsigned dirty )
* for this texture unit, don't enable shadow compare in
* the texture sampler state.
*/
- if (fs->fs_shadow_compare_units & (1 << i)) {
+ if (fs && (fs->fs_shadow_compare_units & (1 << i))) {
fs_shadow = true;
}
}
--
1.9.1
Neha Bhende
2017-12-28 17:07:58 UTC
Reply
Permalink
Raw Message
Looks good.

Reviewed-by: Neha Bhende<***@vmware.com>
________________________________
From: Brian Paul <***@vmware.com>
Sent: Thursday, December 28, 2017 8:19:24 AM
To: mesa-***@lists.freedesktop.org
Cc: Charmaine Lee; Neha Bhende
Subject: [PATCH] svga: check for null fs pointer in update_samplers()

This can happen when there's no active fragment shader, such as
when using transform feedback. This wasn't hit by any Piglit test
but is hit by Daniel Rákos' Nature demo. VMware bug 2026189.
---
src/gallium/drivers/svga/svga_state_sampler.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/svga/svga_state_sampler.c b/src/gallium/drivers/svga/svga_state_sampler.c
index 9bd0d53..11f36e3 100644
--- a/src/gallium/drivers/svga/svga_state_sampler.c
+++ b/src/gallium/drivers/svga/svga_state_sampler.c
@@ -399,7 +399,7 @@ update_samplers(struct svga_context *svga, unsigned dirty )
* for this texture unit, don't enable shadow compare in
* the texture sampler state.
*/
- if (fs->fs_shadow_compare_units & (1 << i)) {
+ if (fs && (fs->fs_shadow_compare_units & (1 << i))) {
fs_shadow = true;
}
}
--
1.9.1

Loading...