Commit b80d4564 authored by Kenneth Moreland's avatar Kenneth Moreland

Added test for order-dependent compositions. Consequently, several bugs in

the ordered composition were also fixed.
parent 252e888f
......@@ -6,7 +6,7 @@ Copyright (C) 2000-2003 Sandia National Laboratories
Id
..
.TH icetCompositeOrder 3 "July 10, 2003" "Sandia National Labs" "ICE-T Reference"
.TH icetCompositeOrder 3 "July 15, 2003" "Sandia National Labs" "ICE-T Reference"
.SH NAME
.B icetCompositeOrder
\- specify the order in which images are composited
......@@ -62,14 +62,20 @@ When ordering is on, it is accepted that
will be called in between every frame since the order of the geometry may
change with the viewpoint.
.SH ERRORS
None.
.TP 20
.B ICET_INVALID_VALUE
Not every entry in the parameter
.I process_ranks
was a unique, valid process rank.
.SH WARNINGS
None.
.SH BUGS
Each entry in the parameter
.I process_ranks
should be a unique, valid process rank. This is not strictly enforced, but
can cause major problems if not adhered to.
If an
.B ICET_INVALID_VALUE
error is raised, internal arrays pertaining to the ordering of images may
not be restored properly. If such an error is raised, the functions should
be re-invoked with a valid ordering before preceding. Unpredictable
results may occur otherwise.
.SH COPYRIGHT
Copyright \(co 2003 Sandia Corporation
.br
......
......@@ -6,7 +6,7 @@ Copyright (C) 2000-2002 Sandia National Laboratories
Id
..
.TH icetGet 3 "July 10, 2003" "Sandia National Labs" "ICE-T Reference"
.TH icetGet 3 "July 16, 2003" "Sandia National Labs" "ICE-T Reference"
.SH NAME
.B icetGet
\- get an
......@@ -107,6 +107,14 @@ parameter contains
.B ICET_NUM_PROCESSES
entries. The value of this parameter is set with
.BR icetCompositeOrder .
If the element of index
.I i
in the array is set to
.IR j ,
then there are
.I i
images ``on top'' of the image generated by process
.IR j .
.TP
.B ICET_COMPOSITE_TIME
The total time, in seconds, spent in compositing during the last call to
......@@ -204,6 +212,20 @@ will generate from composition. The value is set with
.BR icetInputOutputBuffers .
See the documentation of that function for valid bit flags.
.TP
.B ICET_PROCESS_ORDERS
Basically, the inverse of
.BR ICET_COMPOSITE_ORDER .
The parameter contains
.B ICET_NUM_PROCESSES
entries. If the element of index
.I i
in the array is set to
.IR j ,
then there are
.I j
images ``on top'' of the image generated by process
.IR i .
.TP
.B ICET_RANK
The rank of the process as given by the
.B IceTCommunicator
......@@ -221,6 +243,9 @@ call to
.BR icetDrawFrame .
Stored as a double.
.TP
.B ICET_STRATEGY_SUPPORTS_ORDERING
Is true if and only if the current strategy supports ordered compositing.
.TP
.B ICET_TILE_DISPLAYED
The index of the tile the local process is displaying. The index will
correspond to the tile entry in the
......
......@@ -37,6 +37,8 @@ void icetDrawFunc(IceTCallback func)
void icetStrategy(IceTStrategy strategy)
{
icetStateSetPointer(ICET_STRATEGY_NAME, strategy.name);
icetStateSetBoolean(ICET_STRATEGY_SUPPORTS_ORDERING,
strategy.supports_ordering);
icetStateSetPointer(ICET_STRATEGY_COMPOSE, (GLvoid *)strategy.compose);
}
......@@ -54,8 +56,36 @@ const GLubyte *icetGetStrategyName(void)
void icetCompositeOrder(const GLint *process_ranks)
{
GLint num_proc;
GLint i;
GLint *process_orders;
GLboolean new_process_orders;
icetGetIntegerv(ICET_NUM_PROCESSES, &num_proc);
if ( (icetStateGetType(ICET_PROCESS_ORDERS) == ICET_INT)
&& (icetStateGetSize(ICET_PROCESS_ORDERS) >= num_proc) ) {
process_orders = icetUnsafeStateGet(ICET_PROCESS_ORDERS);
new_process_orders = 0;
} else {
process_orders = malloc(ICET_PROCESS_ORDERS * sizeof(GLint));
new_process_orders = 1;
}
for (i = 0; i < num_proc; i++) {
process_orders[i] = -1;
}
for (i = 0; i < num_proc; i++) {
process_orders[process_ranks[i]] = i;
}
for (i = 0; i < num_proc; i++) {
if (process_orders[i] == -1) {
icetRaiseError("Invalid composit order.", ICET_INVALID_VALUE);
return;
}
}
icetStateSetIntegerv(ICET_COMPOSITE_ORDER, num_proc, process_ranks);
if (new_process_orders) {
icetUnsafeStateSet(ICET_PROCESS_ORDERS, num_proc,
GL_INT, process_orders);
}
}
GLubyte *icetGetColorBuffer(void)
......
......@@ -777,8 +777,8 @@ static void renderTile(int tile, GLint *screen_viewport, GLint *target_viewport)
screen_viewport[3] = target_viewport[3];
}
if ( icetGetTime(ICET_RENDERED_VIEWPORT)
> icetGetTime(ICET_IS_DRAWING_FRAME) ) {
if ( icetStateGetTime(ICET_RENDERED_VIEWPORT)
> icetStateGetTime(ICET_IS_DRAWING_FRAME) ) {
/* Already rendered image for this tile. */
return;
}
......
......@@ -37,9 +37,9 @@ void icetProjectTile(GLint tile)
GLint renderable_width, renderable_height;
/* Update tile projections. */
if (viewport_time != icetGetTime(ICET_TILE_VIEWPORTS)) {
if (viewport_time != icetStateGetTime(ICET_TILE_VIEWPORTS)) {
update_tile_projections();
viewport_time = icetGetTime(ICET_TILE_VIEWPORTS);
viewport_time = icetStateGetTime(ICET_TILE_VIEWPORTS);
}
if ((tile < 0) || (tile >= num_tiles)) {
......@@ -64,9 +64,9 @@ void icetProjectTile(GLint tile)
glMultMatrixd(tile_projections + 16*tile);
if (projection_time != icetGetTime(ICET_PROJECTION_MATRIX)) {
if (projection_time != icetStateGetTime(ICET_PROJECTION_MATRIX)) {
icetGetDoublev(ICET_PROJECTION_MATRIX, global_projection);
projection_time = icetGetTime(ICET_PROJECTION_MATRIX);
projection_time = icetStateGetTime(ICET_PROJECTION_MATRIX);
}
glMultMatrixd(global_projection);
......
......@@ -80,10 +80,13 @@ void icetStateCopy(IceTState dest, const IceTState src)
}
}
static float black[] = {0.0, 0.0, 0.0, 0.0};
static GLfloat black[] = {0.0, 0.0, 0.0, 0.0};
void icetStateSetDefaults(void)
{
GLint *int_array;
int i;
icetDiagnostics(ICET_DIAG_ALL_NODES | ICET_DIAG_WARNINGS);
icetStateSetInteger(ICET_RANK, ICET_COMM_RANK());
......@@ -101,6 +104,13 @@ void icetStateSetDefaults(void)
icetStateSetPointer(ICET_STRATEGY_COMPOSE, NULL);
icetInputOutputBuffers(ICET_COLOR_BUFFER_BIT | ICET_DEPTH_BUFFER_BIT,
ICET_COLOR_BUFFER_BIT);
int_array = malloc(ICET_COMM_SIZE() * sizeof(GLint));
for (i = 0; i < ICET_COMM_SIZE(); i++) {
int_array[i] = i;
}
icetStateSetIntegerv(ICET_COMPOSITE_ORDER, ICET_COMM_SIZE(), int_array);
icetStateSetIntegerv(ICET_PROCESS_ORDERS, ICET_COMM_SIZE(), int_array);
free(int_array);
icetStateSetPointer(ICET_DRAW_FUNCTION, NULL);
icetStateSetInteger(ICET_READ_BUFFER, GL_BACK);
......@@ -169,7 +179,15 @@ void icetStateSetPointer(GLenum pname, GLvoid *value)
stateSet(pname, 1, ICET_POINTER, &value);
}
unsigned long icetGetTime(GLenum pname)
GLenum icetStateGetType(GLenum pname)
{
return icetGetState()[pname].type;
}
GLint icetStateGetSize(GLenum pname)
{
return icetGetState()[pname].size;
}
unsigned long icetStateGetTime(GLenum pname)
{
return icetGetState()[pname].mod_time;
}
......
......@@ -115,6 +115,7 @@ ICET_EXPORT GLuint *icetGetDepthBuffer(void);
typedef GLuint *IceTImage;
typedef struct _IceTStrategy {
char *name;
GLboolean supports_ordering;
IceTImage (*compose)(void);
} IceTStrategy;
......@@ -170,6 +171,8 @@ ICET_EXPORT void icetDiagnostics(GLbitfield mask);
#define ICET_INPUT_BUFFERS (ICET_STATE_ENGINE_START | 0x0026)
#define ICET_OUTPUT_BUFFERS (ICET_STATE_ENGINE_START | 0x0027)
#define ICET_COMPOSITE_ORDER (ICET_STATE_ENGINE_START | 0x0028)
#define ICET_PROCESS_ORDERS (ICET_STATE_ENGINE_START | 0x0029)
#define ICET_STRATEGY_SUPPORTS_ORDERING (ICET_STATE_ENGINE_START | 0x002A)
#define ICET_DRAW_FUNCTION (ICET_STATE_ENGINE_START | 0x0030)
#define ICET_READ_BUFFER (ICET_STATE_ENGINE_START | 0x0031)
......
......@@ -46,7 +46,9 @@ ICET_EXPORT void icetStateSetInteger(GLenum pname, GLint value);
ICET_EXPORT void icetStateSetBoolean(GLenum pname, GLboolean value);
ICET_EXPORT void icetStateSetPointer(GLenum pname, GLvoid *value);
ICET_EXPORT unsigned long icetGetTime(GLenum pname);
ICET_EXPORT GLenum icetStateGetType(GLenum pname);
ICET_EXPORT GLint icetStateGetSize(GLenum pname);
ICET_EXPORT unsigned long icetStateGetTime(GLenum pname);
ICET_EXPORT void icetUnsafeStateSet(GLenum pname, GLint size, GLenum type,
GLvoid *data);
......
This diff is collapsed.
......@@ -82,6 +82,7 @@ typedef void *(*IceTGenerateData)(int id, int dest, int *size);
typedef void *(*IceTHandleData)(void *, int src);
void icetSendRecvLargeMessages(int numMessagesSending,
int *messageDestinations,
int messagesInOrder,
IceTGenerateData generateDataFunc,
IceTHandleData handleDataFunc,
void *incomingBuffer,
......
......@@ -21,7 +21,7 @@
static IceTImage directCompose(void);
IceTStrategy ICET_STRATEGY_DIRECT = { "Direct", directCompose };
IceTStrategy ICET_STRATEGY_DIRECT = { "Direct", ICET_TRUE, directCompose };
static IceTImage directCompose(void)
{
......
......@@ -27,7 +27,7 @@ static int delegate(int **tile_image_destp,
int buffer_size);
IceTStrategy ICET_STRATEGY_REDUCE = { "Reduce", reduceCompose };
IceTStrategy ICET_STRATEGY_REDUCE = { "Reduce", ICET_FALSE, reduceCompose };
static IceTImage reduceCompose(void)
{
......
......@@ -20,7 +20,7 @@
static IceTImage serialCompose(void);
IceTStrategy ICET_STRATEGY_SERIAL = { "Serial", serialCompose };
IceTStrategy ICET_STRATEGY_SERIAL = { "Serial", ICET_TRUE, serialCompose };
static IceTImage serialCompose(void)
{
......@@ -88,9 +88,6 @@ static IceTImage serialCompose(void)
icetGetTileImage(i, ibuf);
icetBswapCompose(compose_group, num_proc, image_dest,
ibuf, inImage, outImage);
/* Restore compose_group for next tile. */
compose_group[d_node] = d_node;
}
return myImage;
......
......@@ -27,7 +27,7 @@
static IceTImage splitStrategy(void);
IceTStrategy ICET_STRATEGY_SPLIT
= { "Image Split and Delegate", splitStrategy };
= { "Image Split and Delegate", ICET_FALSE, splitStrategy };
static IceTImage splitStrategy(void)
{
......
......@@ -49,7 +49,8 @@ static void do_send_receive(struct node_info *my_info, int tile_held,
IceTImage imageBuffer,
IceTSparseImage inImage, IceTSparseImage outImage);
IceTStrategy ICET_STRATEGY_VTREE = { "Virtual Trees", vtreeCompose };
IceTStrategy ICET_STRATEGY_VTREE
= { "Virtual Trees", ICET_FALSE, vtreeCompose };
static IceTImage vtreeCompose(void)
{
......
......@@ -52,5 +52,5 @@ ENDFOREACH(test)
IF (WIN32)
ADD_CUSTOM_TARGET(logclean erase log.???? *.ppm)
ELSE (WIN32)
ADD_CUSTOM_TARGET(logclean rm -f log.???? *.ppm)
ADD_CUSTOM_TARGET(logclean rm -f log.???? *.ppm core.*)
ENDIF (WIN32)
This diff is collapsed.
......@@ -44,6 +44,7 @@ int wincreat( int x, int y, int width, int height, char *title)
GLX_RED_SIZE, 8,
GLX_GREEN_SIZE, 8,
GLX_BLUE_SIZE, 8,
GLX_ALPHA_SIZE, 8,
GLX_DOUBLEBUFFER,
None };
......
......@@ -185,6 +185,7 @@ bSetupPixelFormat(HDC hdc)
ppfd->cRedBits = 4;
ppfd->cGreenBits = 4;
ppfd->cBlueBits = 4;
ppfd->cAlphaBits = 4;
ppfd->cDepthBits = 16;
ppfd->cAccumBits = 0;
ppfd->cStencilBits = 0;
......
......@@ -83,6 +83,7 @@ static void checkIceTError(void)
/* Just in case I need to actually print stuff out to the screen in the
future. */
static FILE *realstdout;
#if 0
static void realprintf(const char *fmt, ...)
{
va_list ap;
......@@ -94,6 +95,7 @@ static void realprintf(const char *fmt, ...)
fflush(realstdout);
}
}
#endif
static IceTContext context;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment