diff options
author | Corbin Simpson <[email protected]> | 2009-02-12 23:36:21 -0800 |
---|---|---|
committer | Corbin Simpson <[email protected]> | 2009-02-12 23:36:21 -0800 |
commit | 8a2d0005af34cfaf88b2d70168fdfb2c91e79045 (patch) | |
tree | 6e81bd8c09292c7cc0bebd7a006d07d355ef7a9e /src/gallium/drivers/r300/r300_state.c | |
parent | fe7863f3f82cda290334cecfde816e21a0e9f5d3 (diff) |
r300-gallium: Take care of various bad dereferences in shader setup.
Unbreaks glxinfo.
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 5fe2b8ea3ef..2c0906aad81 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -424,7 +424,10 @@ static void r300_bind_fs_state(struct pipe_context* pipe, void* shader) struct r300_context* r300 = r300_context(pipe); struct r3xx_fragment_shader* fs = (struct r3xx_fragment_shader*)shader; - if (!fs->translated) { + if (fs == NULL) { + r300->fs = NULL; + return; + } else if (!fs->translated) { if (r300_screen(r300->context.screen)->caps->is_r500) { r500_translate_shader(r300, fs); } else { @@ -432,11 +435,7 @@ static void r300_bind_fs_state(struct pipe_context* pipe, void* shader) } } - if (!fs->translated) { - debug_printf("r300: Couldn't assemble fragment shader...\n"); - /* XXX exit here */ - } - + fs->translated = true; r300->fs = fs; r300->dirty_state |= R300_NEW_FRAGMENT_SHADER; |