Commit 88d01457 authored by Kenneth Moreland's avatar Kenneth Moreland
Browse files

Merge branch 'CompressedCompositing'

parents ef28c347 34d89795
......@@ -18,6 +18,11 @@ Revision 2.1:
problems with large numbers of processes and would probably be
inefficient anyway.
Changed the single image compositing methods to work strictly with
compressed images. This prevents having to pad images with
background only to then test that same background later during
compressiong.
Revision 2.0: A major restructuring of the IceT code comprising the
following changes:
......
/* -*- c -*- *******************************************************/
/*
* Copyright (C) 2011 Sandia Corporation
* Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
* the U.S. Government retains certain rights in this software.
*
* This source code is released under the New BSD License.
*/
/* This is not a traditional header file, but rather a "macro" file that defines
* a function body for a decompression function. (If this were C++, we would
* actually use templates to automatically generate all these cases.) In
* general, there are many flavors of the decompression functionality which
* differ only slightly. Rather than maintain lots of different code bases or
* try to debug big macros, we just include this file with various parameters.
*
* The following macros must be defined:
* FRONT_SPARSE_IMAGE - an IceTSparseImage object containing the data to
* be composited in front.
* BACK_SPARSE_IMAGE - an IceTSparseImage object containing the data to
* be composited in back. (Obviously if the current compositing
* operation is order independent, the FRONT and BACK may be
* switched without effect.)
* DEST_SPARSE_IMAGE - an IceTSparseImage object to place the result.
*
* All of the above macros are undefined at the end of this file.
*/
#ifndef FRONT_SPARSE_IMAGE
#error Need FRONT_SPARSE_IMAGE macro. Is this included in image.c?
#endif
#ifndef BACK_SPARSE_IMAGE
#error Need BACK_SPARSE_IMAGE macro. Is this included in image.c?
#endif
#ifndef DEST_SPARSE_IMAGE
#error Need DEST_SPARSE_IMAGE macro. Is this included in image.c?
#endif
#ifndef INACTIVE_RUN_LENGTH
#error Need INACTIVE_RUN_LENGTH macro. Is this included in image.c?
#endif
#ifndef ACTIVE_RUN_LENGTH
#error Need ACTIVE_RUN_LENGTH macro. Is this included in image.c?
#endif
{
IceTEnum _color_format;
IceTEnum _depth_format;
IceTEnum _composite_mode;
icetGetEnumv(ICET_COMPOSITE_MODE, &_composite_mode);
_color_format = icetSparseImageGetColorFormat(FRONT_SPARSE_IMAGE);
_depth_format = icetSparseImageGetDepthFormat(FRONT_SPARSE_IMAGE);
if ( (_color_format != icetSparseImageGetColorFormat(BACK_SPARSE_IMAGE))
|| (_color_format != icetSparseImageGetColorFormat(DEST_SPARSE_IMAGE))
|| (_depth_format != icetSparseImageGetDepthFormat(BACK_SPARSE_IMAGE))
|| (_depth_format != icetSparseImageGetDepthFormat(DEST_SPARSE_IMAGE))
) {
icetRaiseError("Input buffers do not agree for compressed-compressed"
" composite.",
ICET_SANITY_CHECK_FAIL);
}
if (_composite_mode == ICET_COMPOSITE_MODE_Z_BUFFER) {
if (_depth_format == ICET_IMAGE_DEPTH_FLOAT) {
/* Use Z buffer for active pixel testing and compositing. */
if (_color_format == ICET_IMAGE_COLOR_RGBA_UBYTE) {
#define UNPACK_PIXEL(pointer, color, depth) \
color = (IceTUInt *)pointer; \
pointer += sizeof(IceTUInt); \
depth = (IceTFloat *)pointer; \
pointer += sizeof(IceTFloat);
#define DT_FRONT_COMPRESSED_IMAGE FRONT_SPARSE_IMAGE
#define DT_BACK_COMPRESSED_IMAGE BACK_SPARSE_IMAGE
#define DT_DEST_COMPRESSED_IMAGE DEST_SPARSE_IMAGE
#define DT_COMPOSITE(src1_pointer, src2_pointer, dest_pointer) \
{ \
const IceTUInt *src1_color; \
const IceTFloat *src1_depth; \
const IceTUInt *src2_color; \
const IceTFloat *src2_depth; \
IceTUInt *dest_color; \
IceTFloat *dest_depth; \
UNPACK_PIXEL(src1_pointer, src1_color, src1_depth); \
UNPACK_PIXEL(src2_pointer, src2_color, src2_depth); \
UNPACK_PIXEL(dest_pointer, dest_color, dest_depth); \
if (src1_depth[0] < src2_depth[0]) { \
dest_color[0] = src1_color[0]; \
dest_depth[0] = src1_depth[0]; \
} else { \
dest_color[0] = src2_color[0]; \
dest_depth[0] = src2_depth[0]; \
} \
}
#define DT_COPY(src_pointer, dest_pointer) \
{ \
const IceTUInt *src_color; \
const IceTFloat *src_depth; \
IceTUInt *dest_color; \
IceTFloat *dest_depth; \
UNPACK_PIXEL(src_pointer, src_color, src_depth); \
UNPACK_PIXEL(dest_pointer, dest_color, dest_depth); \
dest_color[0] = src_color[0]; \
dest_depth[0] = src_depth[0]; \
}
#include "cc_composite_template_body.h"
#undef UNPACK_PIXEL
} else if (_color_format == ICET_IMAGE_COLOR_RGBA_FLOAT) {
#define UNPACK_PIXEL(pointer, color, depth) \
color = (IceTFloat *)pointer; \
pointer += 4*sizeof(IceTUInt); \
depth = (IceTFloat *)pointer; \
pointer += sizeof(IceTFloat);
#define DT_FRONT_COMPRESSED_IMAGE FRONT_SPARSE_IMAGE
#define DT_BACK_COMPRESSED_IMAGE BACK_SPARSE_IMAGE
#define DT_DEST_COMPRESSED_IMAGE DEST_SPARSE_IMAGE
#define DT_COMPOSITE(src1_pointer, src2_pointer, dest_pointer) \
{ \
const IceTFloat *src1_color; \
const IceTFloat *src1_depth; \
const IceTFloat *src2_color; \
const IceTFloat *src2_depth; \
IceTFloat *dest_color; \
IceTFloat *dest_depth; \
UNPACK_PIXEL(src1_pointer, src1_color, src1_depth); \
UNPACK_PIXEL(src2_pointer, src2_color, src2_depth); \
UNPACK_PIXEL(dest_pointer, dest_color, dest_depth); \
if (src1_depth[0] < src2_depth[0]) { \
dest_color[0] = src1_color[0]; \
dest_color[1] = src1_color[1]; \
dest_color[2] = src1_color[2]; \
dest_color[3] = src1_color[3]; \
dest_depth[0] = src1_depth[0]; \
} else { \
dest_color[0] = src2_color[0]; \
dest_color[1] = src2_color[1]; \
dest_color[2] = src2_color[2]; \
dest_color[3] = src2_color[3]; \
dest_depth[0] = src2_depth[0]; \
} \
}
#define DT_COPY(src_pointer, dest_pointer) \
{ \
const IceTFloat *src_color; \
const IceTFloat *src_depth; \
IceTFloat *dest_color; \
IceTFloat *dest_depth; \
UNPACK_PIXEL(src_pointer, src_color, src_depth); \
UNPACK_PIXEL(dest_pointer, dest_color, dest_depth); \
dest_color[0] = src_color[0]; \
dest_color[1] = src_color[1]; \
dest_color[2] = src_color[2]; \
dest_color[3] = src_color[3]; \
dest_depth[0] = src_depth[0]; \
}
#include "cc_composite_template_body.h"
#undef UNPACK_PIXEL
} else if (_color_format == ICET_IMAGE_COLOR_NONE) {
#define UNPACK_PIXEL(pointer, depth) \
depth = (IceTFloat *)pointer; \
pointer += sizeof(IceTFloat);
#define DT_FRONT_COMPRESSED_IMAGE FRONT_SPARSE_IMAGE
#define DT_BACK_COMPRESSED_IMAGE BACK_SPARSE_IMAGE
#define DT_DEST_COMPRESSED_IMAGE DEST_SPARSE_IMAGE
#define DT_COMPOSITE(src1_pointer, src2_pointer, dest_pointer) \
{ \
const IceTFloat *src1_depth; \
const IceTFloat *src2_depth; \
IceTFloat *dest_depth; \
UNPACK_PIXEL(src1_pointer, src1_depth); \
UNPACK_PIXEL(src2_pointer, src2_depth); \
UNPACK_PIXEL(dest_pointer, dest_depth); \
if (src1_depth[0] < src2_depth[0]) { \
dest_depth[0] = src1_depth[0]; \
} else { \
dest_depth[0] = src2_depth[0]; \
} \
}
#define DT_COPY(src_pointer, dest_pointer) \
{ \
const IceTFloat *src_depth; \
IceTFloat *dest_depth; \
UNPACK_PIXEL(src_pointer, src_depth); \
UNPACK_PIXEL(dest_pointer, dest_depth); \
dest_depth[0] = src_depth[0]; \
}
#include "cc_composite_template_body.h"
#undef UNPACK_PIXEL
} else {
icetRaiseError("Encountered invalid color format.",
ICET_SANITY_CHECK_FAIL);
}
} else if (_depth_format == ICET_IMAGE_DEPTH_NONE) {
icetRaiseError("Cannot use Z buffer compositing operation with no"
" Z buffer.", ICET_INVALID_OPERATION);
} else {
icetRaiseError("Encountered invalid depth format.",
ICET_SANITY_CHECK_FAIL);
}
} else if (_composite_mode == ICET_COMPOSITE_MODE_BLEND) {
/* Use alpha for active pixel and compositing. */
if (_depth_format == ICET_IMAGE_DEPTH_NONE) {
if (_color_format == ICET_IMAGE_COLOR_RGBA_UBYTE) {
#define UNPACK_PIXEL(pointer, color) \
color = (IceTUInt *)pointer; \
pointer += sizeof(IceTUInt);
#define DT_FRONT_COMPRESSED_IMAGE FRONT_SPARSE_IMAGE
#define DT_BACK_COMPRESSED_IMAGE BACK_SPARSE_IMAGE
#define DT_DEST_COMPRESSED_IMAGE DEST_SPARSE_IMAGE
#define DT_COMPOSITE(front_pointer, back_pointer, dest_pointer) \
{ \
const IceTUInt *front_color; \
const IceTUInt *back_color; \
IceTUInt *dest_color; \
UNPACK_PIXEL(front_pointer, front_color); \
UNPACK_PIXEL(back_pointer, back_color); \
UNPACK_PIXEL(dest_pointer, dest_color); \
ICET_BLEND_UBYTE((const IceTUByte *)front_color, \
(const IceTUByte *)back_color, \
(IceTUByte *)dest_color); \
}
#define DT_COPY(src_pointer, dest_pointer) \
{ \
const IceTUInt *src_color; \
IceTUInt *dest_color; \
UNPACK_PIXEL(src_pointer, src_color); \
UNPACK_PIXEL(dest_pointer, dest_color); \
dest_color[0] = src_color[0]; \
}
#include "cc_composite_template_body.h"
#undef UNPACK_PIXEL
} else if (_color_format == ICET_IMAGE_COLOR_RGBA_FLOAT) {
#define UNPACK_PIXEL(pointer, color) \
color = (IceTFloat *)pointer; \
pointer += 4*sizeof(IceTUInt);
#define DT_FRONT_COMPRESSED_IMAGE FRONT_SPARSE_IMAGE
#define DT_BACK_COMPRESSED_IMAGE BACK_SPARSE_IMAGE
#define DT_DEST_COMPRESSED_IMAGE DEST_SPARSE_IMAGE
#define DT_COMPOSITE(front_pointer, back_pointer, dest_pointer) \
{ \
const IceTFloat *front_color; \
const IceTFloat *back_color; \
IceTFloat *dest_color; \
UNPACK_PIXEL(front_pointer, front_color); \
UNPACK_PIXEL(back_pointer, back_color); \
UNPACK_PIXEL(dest_pointer, dest_color); \
ICET_BLEND_FLOAT(front_color, back_color, dest_color); \
}
#define DT_COPY(src_pointer, dest_pointer) \
{ \
const IceTFloat *src_color; \
IceTFloat *dest_color; \
UNPACK_PIXEL(src_pointer, src_color); \
UNPACK_PIXEL(dest_pointer, dest_color); \
dest_color[0] = src_color[0]; \
dest_color[1] = src_color[1]; \
dest_color[2] = src_color[2]; \
dest_color[3] = src_color[3]; \
}
#include "cc_composite_template_body.h"
#undef UNPACK_PIXEL
} else if (_color_format == ICET_IMAGE_COLOR_NONE) {
icetRaiseWarning("Compositing image with no data.",
ICET_INVALID_OPERATION);
icetClearSparseImage(DEST_SPARSE_IMAGE);
} else {
icetRaiseError("Encountered invalid color format.",
ICET_SANITY_CHECK_FAIL);
}
} else {
icetRaiseError("Cannot use blend composite with a depth buffer.",
ICET_INVALID_VALUE);
}
} else {
icetRaiseError("Encountered invalid composite mode.",
ICET_SANITY_CHECK_FAIL);
}
}
#undef FRONT_SPARSE_IMAGE
#undef BACK_SPARSE_IMAGE
#undef DEST_SPARSE_IMAGE
/* -*- c -*- *******************************************************/
/*
* Copyright (C) 2011 Sandia Corporation
* Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
* the U.S. Government retains certain rights in this software.
*
* This source code is released under the New BSD License.
*/
/* This is not a traditional header file, but rather a "macro" file that defines
* a template for a decompression function. (If this were C++, we would
* actually use tempaltes.) In general, there are many flavors of the
* decompression functionality which differ only slightly. Rather than maintain
* lots of different code bases or try to debug big macros, we just include this
* file with various parameters.
*
* The following macros must be defined:
* DT_FRONT_COMPRESSED_IMAGE - compressed image to blend in front.
* DT_BACK_COMPRESSED_IMAGE - compressed image to blend in back.
* DT_DEST_COMPRESSED_IMAGE - the resulting compressed image buffer.
* DT_COMPOSITE(front_pointer, back_pointer, dest_pointer) - given
* pointers to actual data in the three buffers, perform the
* actual compositing operation and increment the pointers.
* DT_COPY(src_pointer, dest_pointer) - copy a pixel from the src
* pointer the the dest pointer and increment both pointers.
*
* All of the above macros are undefined at the end of this file.
*/
#ifndef ICET_IMAGE_DATA
#error Need ICET_IMAGE_DATA macro. Is this included in image.c?
#endif
#ifndef INACTIVE_RUN_LENGTH
#error Need INACTIVE_RUN_LENGTH macro. Is this included in image.c?
#endif
#ifndef ACTIVE_RUN_LENGTH
#error Need ACTIVE_RUN_LENGTH macro. Is this included in image.c?
#endif
#define CCC_MIN(x, y) ((x) < (y) ? (x) : (y))
{
/* Use IceTByte for byte-based pointer arithmetic. */
const IceTByte *_front;
const IceTByte *_back;
IceTByte *_dest;
IceTVoid *_dest_runlengths;
IceTSizeType _num_pixels;
IceTSizeType _pixel;
IceTSizeType _front_num_inactive;
IceTSizeType _front_num_active;
IceTSizeType _back_num_inactive;
IceTSizeType _back_num_active;
IceTSizeType _dest_num_active;
_num_pixels = icetSparseImageGetNumPixels(DT_FRONT_COMPRESSED_IMAGE);
if (_num_pixels != icetSparseImageGetNumPixels(DT_BACK_COMPRESSED_IMAGE)) {
icetRaiseError("Input buffers do not agree for compressed-compressed"
" composite.",
ICET_SANITY_CHECK_FAIL);
}
icetSparseImageSetDimensions(
DT_DEST_COMPRESSED_IMAGE,
icetSparseImageGetWidth(DT_FRONT_COMPRESSED_IMAGE),
icetSparseImageGetHeight(DT_BACK_COMPRESSED_IMAGE));
_front = ICET_IMAGE_DATA(DT_FRONT_COMPRESSED_IMAGE);
_back = ICET_IMAGE_DATA(DT_BACK_COMPRESSED_IMAGE);
_dest = ICET_IMAGE_DATA(DT_DEST_COMPRESSED_IMAGE);
_dest_runlengths = NULL;
_pixel = 0;
_front_num_inactive = _front_num_active = 0;
_back_num_inactive = _back_num_active = 0;
_dest_num_active = 0;
while (_pixel < _num_pixels) {
/* When num_active is 0, we have exhausted all active pixels and the
buffer pointer must be pointing to run lengths. */
while( (_front_num_active == 0)
&& ((_front_num_inactive + _pixel) < _num_pixels) ) {
_front_num_inactive += INACTIVE_RUN_LENGTH(_front);
_front_num_active = ACTIVE_RUN_LENGTH(_front);
_front += RUN_LENGTH_SIZE;
}
while( (_back_num_active == 0)
&& ((_back_num_inactive + _pixel) < _num_pixels) ) {
_back_num_inactive += INACTIVE_RUN_LENGTH(_back);
_back_num_active = ACTIVE_RUN_LENGTH(_back);
_back += RUN_LENGTH_SIZE;
}
{
IceTSizeType _dest_num_inactive
= CCC_MIN(_front_num_inactive, _back_num_inactive);
if (_dest_num_inactive > 0) {
/* Record active pixel count. (Special case on first iteration
* where there is no runlength and no place to put it.) */
if (_dest_runlengths != NULL) {
ACTIVE_RUN_LENGTH(_dest_runlengths)
= (IceTUShort)(_dest_num_active);
_dest_num_active = 0;
}
_dest_runlengths = _dest;
_dest += RUN_LENGTH_SIZE;
/* Handle inactive pixel region. */
_pixel += _dest_num_inactive;
_front_num_inactive -= _dest_num_inactive;
_back_num_inactive -= _dest_num_inactive;
while (0xFFFF < _dest_num_inactive) {
INACTIVE_RUN_LENGTH(_dest_runlengths) = 0xFFFF;
ACTIVE_RUN_LENGTH(_dest_runlengths) = 0;
_dest_runlengths = _dest;
_dest += RUN_LENGTH_SIZE;
_dest_num_inactive -= 0xFFFF;
}
INACTIVE_RUN_LENGTH(_dest_runlengths)
= (IceTUShort)(_dest_num_inactive);
} else {
/* Handle special case where first pixel is active. */
if (_dest_runlengths == NULL) {
_dest_runlengths = _dest;
_dest += RUN_LENGTH_SIZE;
INACTIVE_RUN_LENGTH(_dest_runlengths) = 0;
}
}
}
#define DT_INCREMENT_DEST_NUM_ACTIVE() \
_dest_num_active++; \
_pixel++; \
if (0xFFFF < _dest_num_active) { \
ACTIVE_RUN_LENGTH(_dest_runlengths) = 0xFFFF; \
_dest_num_active -= 0xFFFF; \
_dest_runlengths = _dest; \
_dest += RUN_LENGTH_SIZE; \
INACTIVE_RUN_LENGTH(_dest_runlengths) = 0; \
}
while ((0 < _front_num_inactive) && (0 < _back_num_active)) {
DT_INCREMENT_DEST_NUM_ACTIVE();
DT_COPY(_back, _dest);
_front_num_inactive--;
_back_num_active--;
}
while ((0 < _back_num_inactive) && (0 < _front_num_active)) {
DT_INCREMENT_DEST_NUM_ACTIVE();
DT_COPY(_front, _dest);
_back_num_inactive--;
_front_num_active--;
}
if ((_front_num_inactive == 0) && (_back_num_inactive == 0)) {
while ((0 < _front_num_active) && (0 < _back_num_active)) {
DT_INCREMENT_DEST_NUM_ACTIVE();
DT_COMPOSITE(_front, _back, _dest);
_front_num_active--;
_back_num_active--;
}
}
}
if (_dest_runlengths != NULL) {
ACTIVE_RUN_LENGTH(_dest_runlengths) = (IceTUShort)(_dest_num_active);
}
if (_pixel != _num_pixels) {
icetRaiseError("Corrupt compressed image.", ICET_INVALID_VALUE);
}
{
/* Compute the actual number of bytes used to store the image. */
IceTPointerArithmetic _buffer_begin
=(IceTPointerArithmetic)ICET_IMAGE_HEADER(DT_DEST_COMPRESSED_IMAGE);
IceTPointerArithmetic _buffer_end
=(IceTPointerArithmetic)_dest;
IceTPointerArithmetic _compressed_size = _buffer_end - _buffer_begin;
ICET_IMAGE_HEADER(DT_DEST_COMPRESSED_IMAGE)
[ICET_IMAGE_ACTUAL_BUFFER_SIZE_INDEX]
= (IceTInt)_compressed_size;
}
}
#undef DT_FRONT_COMPRESSED_IMAGE
#undef DT_BACK_COMPRESSED_IMAGE
#undef DT_DEST_COMPRESSED_IMAGE
#undef DT_COMPOSITE
#undef DT_COPY
......@@ -15,7 +15,7 @@
* try to debug big macros, we just include this file with various parameters.
*
* The following macros must be defined:
* INPUT_SPARSE_IMAGE - an IcetSparseImage object containing the data to
* INPUT_SPARSE_IMAGE - an IceTSparseImage object containing the data to
* be decompressed.
* OUTPUT_IMAGE - an allocated IceTImage object to place the decompressed
* image.
......@@ -35,8 +35,7 @@
* BLEND_RGBA_FLOAT(src, dest) - same as above except src and dest
* are IceTFloat arrays.
* OFFSET - If defined to a number (or variable holding a number), skips
* that many pixels at the beginning of the image. This probably
* only makes sense when COMPOSITE is on.
* that many pixels at the beginning of the image.
* PIXEL_COUNT - If defined to a number (or a variable holding a number),
* uses this as the size of the image rather than the actual size
* defined in the image. This should be defined if OFFSET is
......
......@@ -705,6 +705,8 @@ static IceTImage drawInvokeStrategy(void)
}
}
icetStateCheckMemory();
return image;
}
......@@ -817,5 +819,7 @@ IceTImage icetDrawFrame(const IceTDouble *projection_matrix,
icetStateSetDouble(ICET_BUFFER_WRITE_TIME, 0.0);
icetStateCheckMemory();
return image;
}
This diff is collapsed.
......@@ -21,7 +21,7 @@
#include <string.h>
#ifdef DEBUG
#define ICET_CHECK_STATE_MEM
#define ICET_STATE_CHECK_MEM
#endif
struct IceTStateValue {
......@@ -31,7 +31,7 @@ struct IceTStateValue {
IceTTimeStamp mod_time;
};
#ifdef ICET_CHECK_STATE_MEM
#ifdef ICET_STATE_CHECK_MEM
static void stateCheck(IceTEnum pname, const IceTState state);
#else
#define stateCheck(pname, state)
......@@ -61,43 +61,49 @@ IceTState icetStateCreate(void)
void icetStateDestroy(IceTState state)
{
IceTEnum i;
IceTEnum pname;
for (i = 0; i < ICET_STATE_SIZE; i++) {
stateFree(i, state);
for (pname = ICET_STATE_ENGINE_START;
pname < ICET_STATE_ENGINE_END;
pname++) {
stateFree(pname, state);
}
free(state);
}
void icetStateCopy(IceTState dest, const IceTState src)
{
IceTEnum i;
IceTEnum pname;
IceTSizeType type_width;
IceTTimeStamp mod_time;
mod_time = icetGetTimeStamp();
for (i = 0; i < ICET_STATE_SIZE; i++) {
if ( (i == ICET_RANK) || (i == ICET_NUM_PROCESSES)
|| (i == ICET_DATA_REPLICATION_GROUP)
|| (i == ICET_DATA_REPLICATION_GROUP_SIZE)
|| (i == ICET_COMPOSITE_ORDER) || (i == ICET_PROCESS_ORDERS) )
for (pname = ICET_STATE_ENGINE_START;
pname < ICET_STATE_ENGINE_END;
pname++) {
if ( (pname == ICET_RANK)
|| (pname == ICET_NUM_PROCESSES)
|| (pname == ICET_DATA_REPLICATION_GROUP)
|| (pname == ICET_DATA_REPLICATION_GROUP_SIZE)
|| (pname == ICET_COMPOSITE_ORDER)
|| (pname == ICET_PROCESS_ORDERS) )
{
continue;
}
type_width = icetTypeWidth(src[i].type);
type_width = icetTypeWidth(src[pname].type);
if (type_width > 0) {
IceTVoid *data = stateAllocate(i,
src[i].num_entries,
src[i].type,
IceTVoid *data = stateAllocate(pname,
src[pname].num_entries,
src[pname].type,
dest);
memcpy(data, src[i].data, src[i].num_entries * type_width);
memcpy(data, src[pname].data, src[pname].num_entries * type_width);
} else {
stateFree(i, dest);
stateFree(pname, dest);
}
dest[i].mod_time = mod_time;
dest[pname].mod_time = mod_time;
}
}
......@@ -171,6 +177,20 @@ void icetStateSetDefaults(void)
icetStateResetTiming();
}
void icetStateCheckMemory(void)
{
#ifdef ICET_STATE_CHECK_MEM
IceTState state = icetGetState();
IceTEnum pname;
for (pname = ICET_STATE_ENGINE_START;
pname < ICET_STATE_ENGINE_END;
pname++) {
stateCheck(pname, state);
}
#endif
}
void icetStateSetDoublev(IceTEnum pname,