Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ParaView
IceT
Commits
819eaf0e
Commit
819eaf0e
authored
Oct 31, 2017
by
Kenneth Moreland
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'better-diagnostic-macros' into 'master'
Update the diagnostics macros See merge request
icet/icet!6
parents
32515220
ef7bdd67
Changes
31
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
639 additions
and
588 deletions
+639
-588
src/communication/mpi.c
src/communication/mpi.c
+25
-25
src/gl/gl_draw.c
src/gl/gl_draw.c
+8
-8
src/gl/gl_image.c
src/gl/gl_image.c
+7
-4
src/gl/gl_state.c
src/gl/gl_state.c
+6
-6
src/ice-t/cc_composite_func_body.h
src/ice-t/cc_composite_func_body.h
+22
-17
src/ice-t/cc_composite_template_body.h
src/ice-t/cc_composite_template_body.h
+4
-4
src/ice-t/communication.c
src/ice-t/communication.c
+2
-2
src/ice-t/compress_func_body.h
src/ice-t/compress_func_body.h
+29
-24
src/ice-t/compress_template_body.h
src/ice-t/compress_template_body.h
+3
-4
src/ice-t/context.c
src/ice-t/context.c
+3
-3
src/ice-t/decompress_func_body.h
src/ice-t/decompress_func_body.h
+28
-25
src/ice-t/decompress_template_body.h
src/ice-t/decompress_template_body.h
+2
-2
src/ice-t/diagnostics.c
src/ice-t/diagnostics.c
+38
-24
src/ice-t/draw.c
src/ice-t/draw.c
+44
-42
src/ice-t/image.c
src/ice-t/image.c
+221
-176
src/ice-t/porting.c
src/ice-t/porting.c
+1
-1
src/ice-t/projections.c
src/ice-t/projections.c
+2
-2
src/ice-t/state.c
src/ice-t/state.c
+60
-71
src/ice-t/tiles.c
src/ice-t/tiles.c
+14
-13
src/ice-t/timing.c
src/ice-t/timing.c
+8
-11
src/include/IceTDevDiagnostics.h
src/include/IceTDevDiagnostics.h
+12
-33
src/strategies/bswap.c
src/strategies/bswap.c
+4
-4
src/strategies/common.c
src/strategies/common.c
+18
-18
src/strategies/radixk.c
src/strategies/radixk.c
+13
-9
src/strategies/radixkr.c
src/strategies/radixkr.c
+11
-9
src/strategies/reduce.c
src/strategies/reduce.c
+7
-6
src/strategies/select.c
src/strategies/select.c
+21
-18
src/strategies/sequential.c
src/strategies/sequential.c
+3
-3
src/strategies/split.c
src/strategies/split.c
+15
-16
src/strategies/tree.c
src/strategies/tree.c
+4
-4
src/strategies/vtree.c
src/strategies/vtree.c
+4
-4
No files found.
src/communication/mpi.c
View file @
819eaf0e
...
...
@@ -111,8 +111,8 @@ static MPI_Request getMPIRequest(IceTCommRequest icet_request)
}
if
(
icet_request
->
magic_number
!=
ICET_MPI_REQUEST_MAGIC_NUMBER
)
{
icetRaiseError
(
"Request object is not from the MPI communicator."
,
ICET_INVALID_VALUE
);
icetRaiseError
(
ICET_INVALID_VALUE
,
"Request object is not from the MPI communicator."
);
return
MPI_REQUEST_NULL
;
}
...
...
@@ -122,14 +122,14 @@ static MPI_Request getMPIRequest(IceTCommRequest icet_request)
static
void
setMPIRequest
(
IceTCommRequest
icet_request
,
MPI_Request
mpi_request
)
{
if
(
icet_request
==
ICET_COMM_REQUEST_NULL
)
{
icetRaiseError
(
"Cannot set MPI request in null request."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Cannot set MPI request in null request."
);
return
;
}
if
(
icet_request
->
magic_number
!=
ICET_MPI_REQUEST_MAGIC_NUMBER
)
{
icetRaiseError
(
"Request object is not from the MPI communicator."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Request object is not from the MPI communicator."
);
return
;
}
...
...
@@ -143,8 +143,8 @@ static IceTCommRequest create_request(void)
request
=
(
IceTCommRequest
)
malloc
(
sizeof
(
struct
IceTCommRequestStruct
));
if
(
request
==
NULL
)
{
icetRaiseError
(
"Could not allocate memory for IceTCommRequest"
,
ICET_OUT_OF_MEMORY
);
icetRaiseError
(
ICET_OUT_OF_MEMORY
,
"Could not allocate memory for IceTCommRequest"
);
return
NULL
;
}
...
...
@@ -152,8 +152,8 @@ static IceTCommRequest create_request(void)
request
->
internals
=
malloc
(
sizeof
(
struct
IceTMPICommRequestInternalsStruct
));
if
(
request
->
internals
==
NULL
)
{
free
(
request
);
icetRaiseError
(
"Could not allocate memory for IceTCommRequest"
,
ICET_OUT_OF_MEMORY
);
icetRaiseError
(
ICET_OUT_OF_MEMORY
,
"Could not allocate memory for IceTCommRequest"
);
return
NULL
;
}
...
...
@@ -166,9 +166,9 @@ static void destroy_request(IceTCommRequest request)
{
MPI_Request
mpi_request
=
getMPIRequest
(
request
);
if
(
mpi_request
!=
MPI_REQUEST_NULL
)
{
icetRaiseError
(
"Destroying MPI request that is not NULL."
"
Probably leak
ing MPI request
s
."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"
Destroy
ing MPI request
that is not NULL
."
" Probably leaking MPI requests."
);
}
free
(
request
->
internals
);
...
...
@@ -178,14 +178,13 @@ static void destroy_request(IceTCommRequest request)
#ifdef BREAK_ON_MPI_ERROR
static
void
ErrorHandler
(
MPI_Comm
*
comm
,
int
*
errorno
,
...)
{
char
error_msg
[
MPI_MAX_ERROR_STRING
+
16
];
char
error_msg
[
MPI_MAX_ERROR_STRING
];
int
mpi_error_len
;
(
void
)
comm
;
strcpy
(
error_msg
,
"MPI ERROR:
\n
"
);
MPI_Error_string
(
*
errorno
,
error_msg
+
strlen
(
error_msg
),
&
mpi_error_len
);
MPI_Error_string
(
*
errorno
,
error_msg
,
&
mpi_error_len
);
icetRaiseError
(
error_msg
,
ICET_INVALID_OPERATION
);
icetRaiseError
(
ICET_INVALID_OPERATION
,
"MPI ERROR:
\n
%s"
,
error_msg
);
icetDebugBreak
();
}
#endif
...
...
@@ -203,8 +202,8 @@ IceTCommunicator icetCreateMPICommunicator(MPI_Comm mpi_comm)
comm
=
malloc
(
sizeof
(
struct
IceTCommunicatorStruct
));
if
(
comm
==
NULL
)
{
icetRaiseError
(
"Could not allocate memory for IceTCommunicator."
,
ICET_OUT_OF_MEMORY
);
icetRaiseError
(
ICET_OUT_OF_MEMORY
,
"Could not allocate memory for IceTCommunicator."
);
return
NULL
;
}
...
...
@@ -229,8 +228,8 @@ IceTCommunicator icetCreateMPICommunicator(MPI_Comm mpi_comm)
comm
->
data
=
malloc
(
sizeof
(
MPI_Comm
));
if
(
comm
->
data
==
NULL
)
{
free
(
comm
);
icetRaiseError
(
"Could not allocate memory for IceTCommunicator."
,
ICET_OUT_OF_MEMORY
);
icetRaiseError
(
ICET_OUT_OF_MEMORY
,
"Could not allocate memory for IceTCommunicator."
);
return
NULL
;
}
MPI_Comm_dup
(
mpi_comm
,
(
MPI_Comm
*
)
comm
->
data
);
...
...
@@ -315,8 +314,9 @@ static void MPIBarrier(IceTCommunicator self)
case ICET_FLOAT: mpi_type = MPI_FLOAT; break; \
case ICET_DOUBLE: mpi_type = MPI_DOUBLE; break; \
default: \
icetRaiseError("MPI Communicator received bad data type.", \
ICET_INVALID_ENUM); \
icetRaiseError(ICET_INVALID_ENUM, \
"MPI Communicator received bad data type 0x%X.", \
icet_type); \
mpi_type = MPI_BYTE; \
break; \
}
...
...
@@ -540,8 +540,8 @@ static int MPIWaitany(IceTCommunicator self,
mpi_requests
=
malloc
(
sizeof
(
MPI_Request
)
*
count
);
if
(
mpi_requests
==
NULL
)
{
icetRaiseError
(
"Could not allocate array for MPI requests."
,
ICET_OUT_OF_MEMORY
);
icetRaiseError
(
ICET_OUT_OF_MEMORY
,
"Could not allocate array for MPI requests."
);
return
-
1
;
}
...
...
src/gl/gl_draw.c
View file @
819eaf0e
...
...
@@ -38,9 +38,9 @@ static void inflateBuffer(IceTUByte *buffer,
void
icetGLDrawCallback
(
IceTGLDrawCallbackType
func
)
{
if
(
!
icetGLIsInitialized
())
{
icetRaiseError
(
"IceT OpenGL layer not initialized."
"
Call icetGLI
nitialize."
,
ICET_INVALID_OPERATION
);
icetRaiseError
(
ICET_INVALID_OPERATION
,
"
IceT OpenGL layer not i
nitialize
d
."
" Call icetGLInitialize."
);
return
;
}
...
...
@@ -97,9 +97,9 @@ static void setupOpenGLRender(IceTDouble *projection_matrix,
*
ok_to_proceed
=
ICET_FALSE
;
if
(
!
icetGLIsInitialized
())
{
icetRaiseError
(
"IceT OpenGL layer not initialized."
"
Call icetGLI
nitialize."
,
ICET_INVALID_OPERATION
);
icetRaiseError
(
ICET_INVALID_OPERATION
,
"
IceT OpenGL layer not i
nitialize
d
."
" Call icetGLInitialize."
);
return
;
}
...
...
@@ -117,8 +117,8 @@ static void setupOpenGLRender(IceTDouble *projection_matrix,
/* Check the GL callback. */
icetGetPointerv
(
ICET_GL_DRAW_FUNCTION
,
&
value
);
if
(
value
==
NULL
)
{
icetRaiseError
(
"GL Drawing function not set. Call icetGLDrawCallback."
,
ICET_INVALID_OPERATION
);
icetRaiseError
(
ICET_INVALID_OPERATION
,
"GL Drawing function not set. Call icetGLDrawCallback."
);
return
;
}
...
...
src/gl/gl_image.c
View file @
819eaf0e
...
...
@@ -29,8 +29,9 @@ void icetGLDrawCallbackFunction(const IceTDouble *projection_matrix,
/* Check OpenGL state. */
{
if
((
gl_viewport
[
2
]
!=
width
)
||
(
gl_viewport
[
3
]
!=
height
))
{
icetRaiseError
(
"OpenGL viewport different than expected."
" Was it changed?"
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"OpenGL viewport different than expected."
" Was it changed?"
);
}
}
...
...
@@ -102,7 +103,8 @@ void icetGLDrawCallbackFunction(const IceTDouble *projection_matrix,
colorBuffer
+
4
*
(
readback_viewport
[
0
]
+
width
*
readback_viewport
[
1
]));
}
else
if
(
color_format
!=
ICET_IMAGE_COLOR_NONE
)
{
icetRaiseError
(
"Invalid color format."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Invalid color format 0x%X."
,
color_format
);
}
if
(
depth_format
==
ICET_IMAGE_DEPTH_FLOAT
)
{
...
...
@@ -116,7 +118,8 @@ void icetGLDrawCallbackFunction(const IceTDouble *projection_matrix,
depthBuffer
+
(
readback_viewport
[
0
]
+
width
*
readback_viewport
[
1
]));
}
else
if
(
depth_format
!=
ICET_IMAGE_DEPTH_NONE
)
{
icetRaiseError
(
"Invalid depth format."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Invalid depth format 0x%X."
,
depth_format
);
}
glPixelStorei
(
GL_PACK_ROW_LENGTH
,
0
);
...
...
src/gl/gl_state.c
View file @
819eaf0e
...
...
@@ -17,8 +17,8 @@ static void gl_destroy(void);
void
icetGLInitialize
(
void
)
{
if
(
icetGLIsInitialized
())
{
icetRaiseWarning
(
"icetGLInitialize called multiple times."
,
ICET_INVALID_OPERATION
);
icetRaiseWarning
(
ICET_INVALID_OPERATION
,
"icetGLInitialize called multiple times."
);
}
icetStateSetBoolean
(
ICET_GL_INITIALIZED
,
ICET_TRUE
);
...
...
@@ -51,9 +51,9 @@ IceTBoolean icetGLIsInitialized(void)
void
icetGLSetReadBuffer
(
GLenum
mode
)
{
if
(
!
icetGLIsInitialized
())
{
icetRaiseError
(
"IceT OpenGL layer not initialized."
"
Call icetGLI
nitialize."
,
ICET_INVALID_OPERATION
);
icetRaiseError
(
ICET_INVALID_OPERATION
,
"
IceT OpenGL layer not i
nitialize
d
."
" Call icetGLInitialize."
);
return
;
}
...
...
@@ -65,7 +65,7 @@ void icetGLSetReadBuffer(GLenum mode)
{
icetStateSetInteger
(
ICET_GL_READ_BUFFER
,
GL_BACK
);
}
else
{
icetRaiseError
(
"Invalid OpenGL read buffer."
,
ICET_INVALID_ENUM
);
icetRaiseError
(
ICET_INVALID_ENUM
,
"Invalid OpenGL read buffer."
);
}
}
...
...
src/ice-t/cc_composite_func_body.h
View file @
819eaf0e
...
...
@@ -57,9 +57,9 @@
||
(
_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
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"
Input buffers do not agree for compressed-compressed"
" composite."
);
}
if
(
_composite_mode
==
ICET_COMPOSITE_MODE_Z_BUFFER
)
{
...
...
@@ -158,15 +158,18 @@
#include "cc_composite_template_body.h"
#undef UNPACK_PIXEL
}
else
{
icetRaiseError
(
"Encountered invalid color format."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Encountered invalid color format 0x%X."
,
_color_format
);
}
}
else
if
(
_depth_format
==
ICET_IMAGE_DEPTH_NONE
)
{
icetRaiseError
(
"Cannot use Z buffer compositing operation with no"
" Z buffer."
,
ICET_INVALID_OPERATION
);
icetRaiseError
(
ICET_INVALID_OPERATION
,
"Cannot use Z buffer compositing operation with no"
" Z buffer."
);
}
else
{
icetRaiseError
(
"Encountered invalid depth format."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Encountered invalid depth format 0x%X."
,
_depth_format
);
}
}
else
if
(
_composite_mode
==
ICET_COMPOSITE_MODE_BLEND
)
{
/* Use alpha for active pixel and compositing. */
...
...
@@ -214,20 +217,22 @@
#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
);
icetRaiseWarning
(
ICET_INVALID_OPERATION
,
"Compositing image with no data."
);
icetClearSparseImage
(
DEST_SPARSE_IMAGE
);
}
else
{
icetRaiseError
(
"Encountered invalid color format."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Encountered invalid color format 0x%X."
,
_color_format
);
}
}
else
{
icetRaiseError
(
"Cannot use blend composite with a depth buffer."
,
ICET_INVALID_VALUE
);
icetRaiseError
(
ICET_INVALID_VALUE
,
"Cannot use blend composite with a depth buffer."
);
}
}
else
{
icetRaiseError
(
"Encountered invalid composite mode."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Encountered invalid composite mode 0x%X."
,
_composite_mode
);
}
}
...
...
src/ice-t/cc_composite_template_body.h
View file @
819eaf0e
...
...
@@ -55,9 +55,9 @@
_num_pixels
=
icetSparseImageGetNumPixels
(
CCC_FRONT_COMPRESSED_IMAGE
);
if
(
_num_pixels
!=
icetSparseImageGetNumPixels
(
CCC_BACK_COMPRESSED_IMAGE
))
{
icetRaiseError
(
"Input buffers do not agree for compressed-compressed"
"
composite."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"
Input buffers do not agree for compressed-compressed"
" composite."
);
}
icetSparseImageSetDimensions
(
CCC_DEST_COMPRESSED_IMAGE
,
...
...
@@ -161,7 +161,7 @@
}
if
(
_pixel
!=
_num_pixels
)
{
icetRaiseError
(
"Corrupt compressed image."
,
ICET_INVALID_VALUE
);
icetRaiseError
(
ICET_INVALID_VALUE
,
"Corrupt compressed image."
);
}
{
...
...
src/ice-t/communication.c
View file @
819eaf0e
...
...
@@ -24,8 +24,8 @@
#define icetCommCheckCount(count) \
if (count > 1073741824) { \
icetRaiseWarning(
"Encountered a ridiculously large message.",
\
ICET_INVALID_VALUE);
\
icetRaiseWarning(
ICET_INVALID_VALUE,
\
"Encountered a ridiculously large message.");
\
}
IceTCommunicator
icetCommDuplicate
()
...
...
src/ice-t/compress_func_body.h
View file @
819eaf0e
...
...
@@ -88,29 +88,29 @@
if
(
(
icetSparseImageGetColorFormat
(
OUTPUT_SPARSE_IMAGE
)
!=
_color_format
)
||
(
icetSparseImageGetDepthFormat
(
OUTPUT_SPARSE_IMAGE
)
!=
_depth_format
)
)
{
icetRaiseError
(
"Format of input and output to compress do not match."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Format of input and output to compress do not match."
);
}
#ifdef PADDING
if
(
icetSparseImageGetNumPixels
(
OUTPUT_SPARSE_IMAGE
)
!=
(
_pixel_count
+
(
FULL_WIDTH
)
*
(
SPACE_TOP
+
SPACE_BOTTOM
)
+
((
FULL_HEIGHT
)
-
(
SPACE_TOP
+
SPACE_BOTTOM
))
*
(
SPACE_LEFT
+
SPACE_RIGHT
))
)
{
icetRaiseError
(
"Size of input and output to compress do not match."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Size of input and output to compress do not match."
);
}
#else
/*PADDING*/
if
(
icetSparseImageGetNumPixels
(
OUTPUT_SPARSE_IMAGE
)
!=
_pixel_count
)
{
icetRaiseError
(
"Size of input and output to compress do not match."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Size of input and output to compress do not match."
);
}
#endif
/*PADDING*/
#ifdef REGION
if
(
(
REGION_OFFSET_X
<
0
)
||
(
REGION_OFFSET_Y
<
0
)
||
(
REGION_OFFSET_X
+
REGION_WIDTH
>
icetImageGetWidth
(
INPUT_IMAGE
))
||
(
REGION_OFFSET_Y
+
REGION_HEIGHT
>
icetImageGetHeight
(
INPUT_IMAGE
))
){
icetRaiseError
(
"Size of input incompatible with region."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Size of input incompatible with region."
);
}
#endif
/*REGION*/
#endif
/*DEBUG*/
...
...
@@ -242,22 +242,25 @@
#endif
#include "compress_template_body.h"
}
else
{
icetRaiseError
(
"Encountered invalid color format."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Encountered invalid color format 0x%X."
,
_color_format
);
}
}
else
if
(
_depth_format
==
ICET_IMAGE_DEPTH_NONE
)
{
icetRaiseError
(
"Cannot use Z buffer compression with no"
" Z buffer."
,
ICET_INVALID_OPERATION
);
icetRaiseError
(
ICET_INVALID_OPERATION
,
"Cannot use Z buffer compression with no"
" Z buffer."
);
}
else
{
icetRaiseError
(
"Encountered invalid depth format."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Encountered invalid depth format 0x%X."
,
_depth_format
);
}
}
else
if
(
_composite_mode
==
ICET_COMPOSITE_MODE_BLEND
)
{
/* Use alpha for active pixel testing. */
if
(
_depth_format
!=
ICET_IMAGE_DEPTH_NONE
)
{
icetRaiseWarning
(
"Z buffer ignored during blend compress"
"
operation. Output z buffer meaningless."
,
ICET_INVALID_VALUE
);
icetRaiseWarning
(
ICET_INVALID_VALUE
,
"
Z buffer ignored during blend compress"
" operation. Output z buffer meaningless."
);
}
if
(
_color_format
==
ICET_IMAGE_COLOR_RGBA_UBYTE
)
{
const
IceTUInt
*
_color
;
...
...
@@ -340,23 +343,25 @@
#include "compress_template_body.h"
}
else
if
(
_color_format
==
ICET_IMAGE_COLOR_NONE
)
{
IceTUInt
*
_out
;
icetRaiseWarning
(
"Compressing image with no data."
,
ICET_INVALID_OPERATION
);
icetRaiseWarning
(
ICET_INVALID_OPERATION
,
"Compressing image with no data."
);
_out
=
ICET_IMAGE_DATA
(
OUTPUT_SPARSE_IMAGE
);
INACTIVE_RUN_LENGTH
(
_out
)
=
_pixel_count
;
ACTIVE_RUN_LENGTH
(
_out
)
=
0
;
_out
++
;
icetSparseImageSetActualSize
(
OUTPUT_SPARSE_IMAGE
,
_out
);
}
else
{
icetRaiseError
(
"Encountered invalid color format."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Encountered invalid color format 0x%X."
,
_color_format
);
}
}
else
{
icetRaiseError
(
"Encountered invalid composite mode."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Encountered invalid composite mode 0x%X."
,
_composite_mode
);
}
icetRaiseDebug
1
(
"Compression: %f%%
\n
"
,
icetRaiseDebug
(
"Compression: %f%%
\n
"
,
100
.
0
f
-
(
100
.
0
f
*
icetSparseImageGetCompressedBufferSize
(
OUTPUT_SPARSE_IMAGE
)
/
icetImageBufferSizeType
(
_color_format
,
_depth_format
,
icetSparseImageGetWidth
(
OUTPUT_SPARSE_IMAGE
),
...
...
src/ice-t/compress_template_body.h
View file @
819eaf0e
...
...
@@ -177,10 +177,9 @@
*
(
CT_SPACE_LEFT
+
CT_SPACE_RIGHT
)
);
#endif
/*CT_PADDING*/
if
(
_totalcount
!=
(
IceTSizeType
)
CT_PIXEL_COUNT
)
{
char
msg
[
256
];
sprintf
(
msg
,
"Total run lengths don't equal pixel count: %d != %d"
,
(
int
)
_totalcount
,
(
int
)(
CT_PIXEL_COUNT
));
icetRaiseError
(
msg
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Total run lengths don't equal pixel count: %d != %d"
,
(
int
)
_totalcount
,
(
int
)(
CT_PIXEL_COUNT
));
}
#endif
/*DEBUG*/
...
...
src/ice-t/context.c
View file @
819eaf0e
...
...
@@ -32,8 +32,8 @@ IceTContext icetCreateContext(IceTCommunicator comm)
IceTContext
context
=
malloc
(
sizeof
(
struct
IceTContextStruct
));
if
(
context
==
NULL
)
{
icetRaiseError
(
"Could not allocate memory for IceT context."
,
ICET_OUT_OF_MEMORY
);
icetRaiseError
(
ICET_OUT_OF_MEMORY
,
"Could not allocate memory for IceT context."
);
return
NULL
;
}
...
...
@@ -101,7 +101,7 @@ IceTContext icetGetContext(void)
void
icetSetContext
(
IceTContext
context
)
{
if
(
context
&&
(
context
->
magic_number
!=
CONTEXT_MAGIC_NUMBER
))
{
icetRaiseError
(
"Invalid context."
,
ICET_INVALID_VALUE
);
icetRaiseError
(
ICET_INVALID_VALUE
,
"Invalid context."
);
return
;
}
icet_current_context
=
context
;
...
...
src/ice-t/decompress_func_body.h
View file @
819eaf0e
...
...
@@ -76,28 +76,28 @@
_pixel_count
=
icetSparseImageGetNumPixels
(
INPUT_SPARSE_IMAGE
);
if
(
_color_format
!=
icetImageGetColorFormat
(
OUTPUT_IMAGE
))
{
icetRaiseError
(
"Input/output buffers have different color formats."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Input/output buffers have different color formats."
);
}
if
(
_depth_format
!=
icetImageGetDepthFormat
(
OUTPUT_IMAGE
))
{
icetRaiseError
(
"Input/output buffers have different depth formats."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Input/output buffers have different depth formats."
);
}
#ifdef PIXEL_COUNT
if
(
_pixel_count
!=
PIXEL_COUNT
)
{
icetRaiseError
(
"Unexpected input pixel count."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Unexpected input pixel count."
);
}
#else
if
(
_pixel_count
!=
icetImageGetNumPixels
(
OUTPUT_IMAGE
))
{
icetRaiseError
(
"Unexpected input pixel count."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Unexpected input pixel count."
);
}
#endif
#ifdef OFFSET
if
(
_pixel_count
>
icetImageGetNumPixels
(
OUTPUT_IMAGE
)
-
OFFSET
)
{
icetRaiseError
(
"Offset pixels outside range of output image."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Offset pixels outside range of output image."
);
}
#endif
...
...
@@ -235,22 +235,25 @@
#include "decompress_template_body.h"
#undef COPY_PIXEL
}
else
{
icetRaiseError
(
"Encountered invalid color format."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Encountered invalid color format 0x%X."
,
_color_format
);
}
}
else
if
(
_depth_format
==
ICET_IMAGE_DEPTH_NONE
)
{
icetRaiseError
(
"Cannot use Z buffer compositing operation with no"
" Z buffer."
,
ICET_INVALID_OPERATION
);
icetRaiseError
(
ICET_INVALID_OPERATION
,
"Cannot use Z buffer compositing operation with no"
" Z buffer."
);
}
else
{
icetRaiseError
(
"Encountered invalid depth format."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Encountered invalid depth format 0x%X."
,
_depth_format
);
}
}
else
if
(
_composite_mode
==
ICET_COMPOSITE_MODE_BLEND
)
{
/* Use alpha for active pixel and compositing. */
if
(
_depth_format
!=
ICET_IMAGE_DEPTH_NONE
)
{
icetRaiseWarning
(
"Z buffer ignored during blend composite"
"
operation. Output z buffer meaningless."
,
ICET_INVALID_VALUE
);
icetRaiseWarning
(
ICET_INVALID_VALUE
,
"
Z buffer ignored during blend composite"
" operation. Output z buffer meaningless."
);
}
if
(
_color_format
==
ICET_IMAGE_COLOR_RGBA_UBYTE
)
{
IceTUInt
*
_color
;
...
...
@@ -345,15 +348,15 @@
#include "decompress_template_body.h"
#undef COPY_PIXEL
}
else
if
(
_color_format
==
ICET_IMAGE_COLOR_NONE
)
{
icetRaiseWarning
(
"Decompressing image with no data."
,
ICET_INVALID_OPERATION
);
icetRaiseWarning
(
ICET_INVALID_OPERATION
,
"Decompressing image with no data."
);
}
else
{
icetRaiseError
(
"Encountered invalid color format."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Encountered invalid color format."
);
}
}
else
{
icetRaiseError
(
"Encountered invalid composite mode."
,
ICET_SANITY_CHECK_FAIL
);
icetRaiseError
(
ICET_SANITY_CHECK_FAIL
,
"Encountered invalid composite mode."
);
}
#ifdef TIME_DECOMPRESSION
...
...
src/ice-t/decompress_template_body.h
View file @
819eaf0e
...
...
@@ -55,7 +55,7 @@
_rl
=
INACTIVE_RUN_LENGTH
(
_runlengths
);
_p
+=
_rl
;
if
(
_p
>
_pixels
)
{
icetRaiseError
(
"Corrupt compressed image."
,
ICET_INVALID_VALUE
);
icetRaiseError
(
ICET_INVALID_VALUE
,
"Corrupt compressed image."
);
break
;
}
DT_INCREMENT_INACTIVE_PIXELS
(
_rl
);
...
...
@@ -64,7 +64,7 @@
_rl
=
ACTIVE_RUN_LENGTH
(
_runlengths
);
_p
+=
_rl
;
if
(
_p
>
_pixels
)
{
icetRaiseError
(
"Corrupt compressed image."
,
ICET_INVALID_VALUE
);
icetRaiseError
(
ICET_INVALID_VALUE
,
"Corrupt compressed image."
);
break
;
}
for
(
_i
=
0
;
_i
<
_rl
;
_i
++
)
{
...
...
src/ice-t/diagnostics.c
View file @
819eaf0e
...
...
@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <signal.h>
...
...
@@ -27,20 +28,26 @@
static
IceTEnum
currentError
=
ICET_NO_ERROR
;
static
IceTEnum
currentLevel
;
void
icetRaiseDiagnostic
(
const
char
*
msg
,
IceTEnum
type
,
IceTBitField
level
,
const
char
*
file
,
int
line
)
void
icetRaiseDiagnostic
(
IceTEnum
type
,
IceTBitField
level
,
const
char
*
file
,
int
line
,
const
char
*
format
,
...)
{
#define ICET_MESSAGE_SIZE 1024
static
int
raisingDiagnostic
=
0
;
IceTBitField
diagLevel
;
IceTInt
tmpInt
;
static
char
full_message
[
1024
];
char
*
m
;
static
char
full_message
[
ICET_MESSAGE_SIZE
+
1
];
IceTSizeType
offset
;
int
rank
;
va_list
format_args
;