Text archives Help
- From: bigler@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r1715 - in trunk/Engine: Control PixelSamplers
- Date: Mon, 10 Sep 2007 01:35:10 -0600 (MDT)
Author: bigler
Date: Mon Sep 10 01:35:05 2007
New Revision: 1715
Modified:
trunk/Engine/Control/RTRT.cc
trunk/Engine/Control/RTRT.h
trunk/Engine/PixelSamplers/SingleSampler.cc
Log:
Engine/Control/RTRT.cc
Engine/Control/RTRT.h
Pipeline fix. setupPipelines wasn't called when the number of
processors was changed. This required separating out barrier3 into
two barriers to avoid erroneous sharing of the barrier.
Changed the name of preprocessBarrier to preprocess_barrier.
Engine/PixelSamplers/SingleSampler.cc
Fixed the annoying bug (bad pixels on the end) when the x resolution
isn't a multiple of 4.
Fixed another bug that never manifested itself. If fragment.begin()
isn't zero you get in trouble. This never happened, because
fragment.begin() was always zero, but if this happened to change in
the figure, this code would have broken.
Modified: trunk/Engine/Control/RTRT.cc
==============================================================================
--- trunk/Engine/Control/RTRT.cc (original)
+++ trunk/Engine/Control/RTRT.cc Mon Sep 10 01:35:05 2007
@@ -127,7 +127,8 @@
barrier1("RTRT frame barrier #1"),
barrier2("RTRT frame barrier #2"),
barrier3("RTRT frame barrier #3"),
- preprocessBarrier("Barrier for preprocessing"),
+ workers_changed_barrier("RTRT workers changed barrier"),
+ preprocess_barrier("Barrier for preprocessing"),
transaction_lock("RTRT transaction lock"),
thread_storage( 0 ),
channel_create_lock("RTRT channel creation lock")
@@ -617,6 +618,7 @@
if(workersChanged)
workersChanged = false;
}
+ if (workersChanged) pipelineNeedsSetup = true;
}
// New scope to control variable lifetimes
@@ -649,7 +651,13 @@
// Negotiate the image pipeline for each channel
if(proc == 0){
- setupPipelines(numProcs);
+ // Send the number of workers wanted to setupPipelines, so
+ // that we can allocate memory for the new set of render
+ // threads. You can't send numProcs, because new threads
+ // need to be accounted for. Make sure we have at least one
+ // thread, so allocators inside setupPipelines don't blow
+ // up.
+ setupPipelines(workersRendering == 0?1:workersRendering);
resizeImages(renderFrameState.frameNumber);
}
@@ -723,7 +731,7 @@
//callbackLock.readUnlock();
if(workersChanged){
- barrier3.wait(workersRendering);
+ workers_changed_barrier.wait(workersRendering);
if(proc == 0)
changedFlags.resize(workersRendering);
}
@@ -1254,7 +1262,7 @@
//
SCIRun::Barrier* RTRT::getPreprocessBarrier()
{
- return &preprocessBarrier;
+ return &preprocess_barrier;
}
///////////////////////////////////////////////////////////////////////////////
Modified: trunk/Engine/Control/RTRT.h
==============================================================================
--- trunk/Engine/Control/RTRT.h (original)
+++ trunk/Engine/Control/RTRT.h Mon Sep 10 01:35:05 2007
@@ -286,7 +286,8 @@
SCIRun::Barrier barrier1;
SCIRun::Barrier barrier2;
SCIRun::Barrier barrier3;
- SCIRun::Barrier preprocessBarrier;
+ SCIRun::Barrier workers_changed_barrier;
+ SCIRun::Barrier preprocess_barrier;
struct ReductionData {
bool changed;
char pad[MAXCACHELINESIZE-sizeof(bool)];
Modified: trunk/Engine/PixelSamplers/SingleSampler.cc
==============================================================================
--- trunk/Engine/PixelSamplers/SingleSampler.cc (original)
+++ trunk/Engine/PixelSamplers/SingleSampler.cc Mon Sep 10 01:35:05 2007
@@ -72,10 +72,9 @@
// If so place each pixel in the ray packet relative to the first
// fragment.
- int b = fragment.begin()+f;
- Real px = fragment.getX(b)*ci.xscale+ci.xoffset;
- Real py = fragment.getY(b)*ci.yscale+ci.yoffset;
- int eye = fragment.getWhichEye(b);
+ Real px = fragment.getX(f)*ci.xscale+ci.xoffset;
+ Real py = fragment.getY(f)*ci.yscale+ci.yoffset;
+ int eye = fragment.getWhichEye(f);
#if MANTA_SSE
// The code used to load in the values using _mm_set_ps, but
@@ -99,6 +98,7 @@
_mm_store_ps(&data->image[1][i], vec_py);
vec_px = _mm_add_ps(vec_px, vec_xscale4);
}
+ px += e*ci.xscale;
#else
int e = 0;
#endif
- [Manta] r1715 - in trunk/Engine: Control PixelSamplers, bigler, 09/10/2007
Archive powered by MHonArc 2.6.16.