r300/compiler: Fix dataflow analysis bug with ELSE blocks
authorTom Stellard <tstellar@gmail.com>
Tue, 19 Apr 2011 04:16:14 +0000 (21:16 -0700)
committerTom Stellard <tstellar@gmail.com>
Tue, 19 Apr 2011 04:27:03 +0000 (21:27 -0700)
Writes within ELSE blocks were being ignored which prevented us from
discovering all possible writers for some register values.

Fixes piglit glsl-fs-raytrace-bug27060

src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c

index c080d5aecc6eb9c99fad7cd34f8aa6632309d0f0..d1a7eab50f7e58cf86889b0c8d0582acaee416e1 100644 (file)
@@ -704,9 +704,16 @@ static void get_readers_for_single_write(
                                        &d->BranchMasks[branch_depth];
 
                                if (masks->HasElse) {
+                                       /* Abort on read for components that
+                                        * were written in the IF block. */
                                        d->ReaderData->AbortOnRead |=
                                                masks->IfWriteMask
                                                        & ~masks->ElseWriteMask;
+                                       /* Abort on read for components that
+                                        * were written in the ELSE block. */
+                                       d->ReaderData->AbortOnRead |=
+                                               masks->ElseWriteMask
+                                                       & ~d->AliveWriteMask;
                                        d->AliveWriteMask = masks->IfWriteMask
                                                ^ ((masks->IfWriteMask ^
                                                        masks->ElseWriteMask)