projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
52e5913
)
r300g: use the dummy FS shader for shaders with zero instructions
author
Marek Olšák
<maraeo@gmail.com>
Mon, 26 Apr 2010 02:52:28 +0000
(
04:52
+0200)
committer
Marek Olšák
<maraeo@gmail.com>
Mon, 26 Apr 2010 05:22:00 +0000
(07:22 +0200)
src/gallium/drivers/r300/r300_fs.c
patch
|
blob
|
history
diff --git
a/src/gallium/drivers/r300/r300_fs.c
b/src/gallium/drivers/r300/r300_fs.c
index 4d61f6385301d53b8793e548509a72f31c912a97..88303f074cd8a1039adf53e77b473fa91772abde 100644
(file)
--- a/
src/gallium/drivers/r300/r300_fs.c
+++ b/
src/gallium/drivers/r300/r300_fs.c
@@
-275,6
+275,14
@@
static void r300_translate_fragment_shader(
/* Invoke the compiler */
r3xx_compile_fragment_program(&compiler);
+ /* Shaders with zero instructions are invalid,
+ * use the dummy shader instead. */
+ if (shader->code.code.r500.inst_end == -1) {
+ rc_destroy(&compiler.Base);
+ r300_dummy_fragment_shader(r300, shader);
+ return;
+ }
+
if (compiler.Base.Error) {
fprintf(stderr, "r300 FP: Compiler Error:\n%sUsing a dummy shader"
" instead.\n", compiler.Base.ErrorMsg);