MINGW-packages/mingw-w64-vtk/011-anari-integer-types.patch
Markus Mützel 6f0fc110e2 vtk: update to 9.4.1
Remove patches that have been applied upstream.
Fix compilation issues with `clang++` version 19.
Fix new build issues with fmt 11.
Cherry-pick patches from upstream VTK-m.
Update patch to make it apply cleanly.
Update DIY to version 3.6.0 to avoid compilation issue with C++ STL from LLVM 19 (`std::char_traits<T>` can no longer be instantiated with arbitrary types).
Add patch to fix compatibility with DIY 3.
Add patch to fix build issue of the InfovisBoostGraphAlgorithms module that requires C++14 now.
Add patch for the ANARI rendering module to fix an issue with undeclared type identifiers.
Add optional dependencies for new Alembic and ANARI modules.
2025-01-15 14:49:40 +01:00

227 lines
10 KiB
Diff

Use standard integer type identifiers in ANARI Rendering module.
diff -urN VTK-9.4.1/Rendering/ANARI/vtkAnariPolyDataMapperNode.cxx.orig VTK-9.4.1/Rendering/ANARI/vtkAnariPolyDataMapperNode.cxx
--- VTK-9.4.1/Rendering/ANARI/vtkAnariPolyDataMapperNode.cxx.orig 2024-12-27 18:08:14.000000000 +0100
+++ VTK-9.4.1/Rendering/ANARI/vtkAnariPolyDataMapperNode.cxx 2025-01-14 16:35:12.992846600 +0100
@@ -74,7 +74,7 @@
* (e.g., wireframe or points).
*/
void RenderSurfaces(anari::Sampler, vtkActor*, vtkPolyData*, std::vector<vec3>&,
- std::vector<u_int>&, bool, double, double, vtkDataArray*, vtkPiecewiseFunction*,
+ std::vector<unsigned int>&, bool, double, double, vtkDataArray*, vtkPiecewiseFunction*,
std::vector<vec2>&, std::vector<float>&, std::vector<vec4>&,
vtkPolyDataMapperNode::vtkPDConnectivity& conn, int);
@@ -83,7 +83,7 @@
* of which can have its own radius.
*/
anari::Surface RenderAsSpheres(anari::Sampler, vtkProperty*, std::vector<vec3>&,
- std::vector<u_int>&, double, vtkDataArray*, vtkPiecewiseFunction*, std::vector<vec2>&,
+ std::vector<unsigned int>&, double, vtkDataArray*, vtkPiecewiseFunction*, std::vector<vec2>&,
std::vector<float>&, std::vector<vec4>&, int);
/**
@@ -91,7 +91,7 @@
* of which can have its own radius.
*/
anari::Surface RenderAsCylinders(anari::Sampler, vtkProperty* property, std::vector<vec3>&,
- std::vector<u_int>&, double, vtkDataArray*, vtkPiecewiseFunction*, std::vector<vec2>&,
+ std::vector<unsigned int>&, double, vtkDataArray*, vtkPiecewiseFunction*, std::vector<vec2>&,
std::vector<float>&, std::vector<vec4>&, int);
/**
@@ -99,14 +99,14 @@
* of which can have its own radius.
*/
anari::Surface RenderAsCurves(anari::Sampler, vtkProperty* property, std::vector<vec3>&,
- std::vector<u_int>&, double, vtkDataArray*, vtkPiecewiseFunction*, std::vector<vec2>&,
+ std::vector<unsigned int>&, double, vtkDataArray*, vtkPiecewiseFunction*, std::vector<vec2>&,
std::vector<float>&, std::vector<vec4>&, int);
/**
* Create an ANARI surface with a geometry consisting of triangles.
*/
anari::Surface RenderAsTriangles(anari::Sampler anariSampler, vtkProperty* property,
- std::vector<vec3>&, std::vector<u_int>& indexArray, std::vector<vec3>& normals,
+ std::vector<vec3>&, std::vector<unsigned int>& indexArray, std::vector<vec3>& normals,
std::vector<vec2>& textureCoords, std::vector<float>&, std::vector<vec4>&, int);
/**
@@ -363,11 +363,11 @@
anari::DataType anariLinearColorFormats[4] = { ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB,
ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB };
- std::vector<u_char> charData;
+ std::vector<unsigned char> charData;
if (comps > 4)
{
- u_char* imageDataPtr = (u_char*)imageData->GetScalarPointer(0, 0, 0);
+ unsigned char* imageDataPtr = (unsigned char*)imageData->GetScalarPointer(0, 0, 0);
for (int i = 0; i < xsize; i++)
{
@@ -426,11 +426,11 @@
anari::DataType anariColorFormats[4] = { ANARI_UFIXED16, ANARI_UFIXED16_VEC2,
ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4 };
- std::vector<u_short> shortData;
+ std::vector<unsigned short> shortData;
if (comps > 4)
{
- u_short* imageDataPtr = reinterpret_cast<u_short*>(imageData->GetScalarPointer(0, 0, 0));
+ unsigned short* imageDataPtr = reinterpret_cast<unsigned short*>(imageData->GetScalarPointer(0, 0, 0));
for (int i = 0; i < xsize; i++)
{
@@ -779,7 +779,7 @@
//----------------------------------------------------------------------------
void vtkAnariPolyDataMapperNodeInternals::RenderSurfaces(anari::Sampler anariSampler,
- vtkActor* actor, vtkPolyData* poly, std::vector<vec3>& vertices, std::vector<u_int>& indexArray,
+ vtkActor* actor, vtkPolyData* poly, std::vector<vec3>& vertices, std::vector<unsigned int>& indexArray,
bool isTriangleIndex, double pointSize, double lineWidth, vtkDataArray* scaleArray,
vtkPiecewiseFunction* scaleFunction, std::vector<vec2>& textureCoords,
std::vector<float>& pointValueTextureCoords, std::vector<vec4>& pointColors,
@@ -877,7 +877,7 @@
//----------------------------------------------------------------------------
anari::Surface vtkAnariPolyDataMapperNodeInternals::RenderAsTriangles(anari::Sampler anariSampler,
- vtkProperty* property, std::vector<vec3>& vertices, std::vector<u_int>& indexArray,
+ vtkProperty* property, std::vector<vec3>& vertices, std::vector<unsigned int>& indexArray,
std::vector<vec3>& normals, std::vector<vec2>& textureCoords,
std::vector<float>& pointValueTextureCoords, std::vector<vec4>& pointColors, int cellFlag)
{
@@ -914,7 +914,7 @@
else
{
char buffer[50];
- snprintf(buffer, 50, "[RenderAsTriangles] numVertices = %ld", numVertices);
+ snprintf(buffer, 50, "[RenderAsTriangles] numVertices = %zu", numVertices);
vtkDebugWithObjectMacro(this->Owner, << buffer);
return nullptr;
}
@@ -1092,7 +1092,7 @@
//----------------------------------------------------------------------------
anari::Surface vtkAnariPolyDataMapperNodeInternals::RenderAsCylinders(anari::Sampler anariSampler,
- vtkProperty* property, std::vector<vec3>& vertices, std::vector<u_int>& indexArray,
+ vtkProperty* property, std::vector<vec3>& vertices, std::vector<unsigned int>& indexArray,
double lineWidth, vtkDataArray* scaleArray, vtkPiecewiseFunction* scaleFunction,
std::vector<vec2>& textureCoords, std::vector<float>& pointValueTextureCoords,
std::vector<vec4>& pointColors, int cellFlag)
@@ -1131,7 +1131,7 @@
else
{
char buffer[50];
- snprintf(buffer, 50, "[RenderAsCylinders] numVertices = %ld", numVertices);
+ snprintf(buffer, 50, "[RenderAsCylinders] numVertices = %zu", numVertices);
vtkDebugWithObjectMacro(this->Owner, << buffer);
return nullptr;
}
@@ -1292,7 +1292,7 @@
//----------------------------------------------------------------------------
anari::Surface vtkAnariPolyDataMapperNodeInternals::RenderAsCurves(anari::Sampler anariSampler,
- vtkProperty* property, std::vector<vec3>& vertices, std::vector<u_int>& indexArray,
+ vtkProperty* property, std::vector<vec3>& vertices, std::vector<unsigned int>& indexArray,
double lineWidth, vtkDataArray* scaleArray, vtkPiecewiseFunction* scaleFunction,
std::vector<vec2>& textureCoords, std::vector<float>& pointValueTextureCoords,
std::vector<vec4>& pointColors, int cellFlag)
@@ -1331,7 +1331,7 @@
else
{
char buffer[50];
- snprintf(buffer, 50, "[RenderAsCurves] numVertices = %ld", numVertices);
+ snprintf(buffer, 50, "[RenderAsCurves] numVertices = %zu", numVertices);
vtkDebugWithObjectMacro(this->Owner, << buffer);
return nullptr;
}
@@ -1341,7 +1341,7 @@
{
auto indicesArray = anari::newArray1D(this->AnariDevice, ANARI_UINT32, numIndices);
{
- auto indicesArrayPtr = anari::map<u_int>(this->AnariDevice, indicesArray);
+ auto indicesArrayPtr = anari::map<unsigned int>(this->AnariDevice, indicesArray);
for (size_t i = 0; i < numIndices; i++)
{
@@ -1488,7 +1488,7 @@
//----------------------------------------------------------------------------
anari::Surface vtkAnariPolyDataMapperNodeInternals::RenderAsSpheres(anari::Sampler anariSampler,
- vtkProperty* property, std::vector<vec3>& vertices, std::vector<u_int>& indexArray,
+ vtkProperty* property, std::vector<vec3>& vertices, std::vector<unsigned int>& indexArray,
double pointSize, vtkDataArray* scaleArray, vtkPiecewiseFunction* scaleFunction,
std::vector<vec2>& textureCoords, std::vector<float>& pointValueTextureCoords,
std::vector<vec4>& pointColors, int cellFlag)
@@ -1530,7 +1530,7 @@
else
{
char buffer[50];
- snprintf(buffer, 50, "[RenderAsSpheres] numVertices = %ld", numVertices);
+ snprintf(buffer, 50, "[RenderAsSpheres] numVertices = %zu", numVertices);
vtkDebugWithObjectMacro(this->Owner, << buffer);
return nullptr;
}
@@ -1540,7 +1540,7 @@
{
auto indicesArray = anari::newArray1D(this->AnariDevice, ANARI_UINT32, numPositions);
{
- auto indicesArrayPtr = anari::map<u_int32_t>(this->AnariDevice, indicesArray);
+ auto indicesArrayPtr = anari::map<uint32_t>(this->AnariDevice, indicesArray);
for (size_t i = 0; i < numPositions; i++)
{
@@ -1870,7 +1870,7 @@
{
// Use the color for the field data value
int ncomps = mapperColors->GetNumberOfComponents();
- u_char* mapperColorsPtr = mapperColors->GetPointer(0);
+ unsigned char* mapperColorsPtr = mapperColors->GetPointer(0);
mapperColorsPtr = mapperColorsPtr + mapper->GetFieldDataTupleId() * ncomps;
double diffuseColor[3] = { mapperColorsPtr[0] * property->GetDiffuse() / 255.0,
mapperColorsPtr[1] * property->GetDiffuse() / 255.0,
@@ -1886,7 +1886,7 @@
for (int i = 0; i < numPointColors; i++)
{
- u_char* color = mapperColors->GetPointer(ncomps * i);
+ unsigned char* color = mapperColors->GetPointer(ncomps * i);
float alpha = ncomps == 3 ? 1.0f : (color[3] / 255.0f);
pointColors[i] = { color[0] / 255.0f, color[1] / 255.0f, color[2] / 255.0f, alpha };
diff -urN VTK-9.4.1/Rendering/ANARI/vtkAnariRendererNode.cxx.orig VTK-9.4.1/Rendering/ANARI/vtkAnariRendererNode.cxx
--- VTK-9.4.1/Rendering/ANARI/vtkAnariRendererNode.cxx.orig 2024-12-27 18:08:14.000000000 +0100
+++ VTK-9.4.1/Rendering/ANARI/vtkAnariRendererNode.cxx 2025-01-14 16:36:21.358276500 +0100
@@ -123,7 +123,7 @@
int ColorBufferTex{ 0 };
int DepthBufferTex{ 0 };
- std::vector<u_char> ColorBuffer;
+ std::vector<unsigned char> ColorBuffer;
std::vector<float> DepthBuffer;
int ImageX;
@@ -575,8 +575,8 @@
//----------------------------------------------------------------------------
void vtkAnariRendererNode::UpdateAnariFrameSize()
{
- const uvec2 frameSize = { static_cast<uint>(this->Size[0]), static_cast<uint>(this->Size[1]) };
- if ((uint)this->Internal->ImageX == frameSize[0] && (uint)this->Internal->ImageY == frameSize[1])
+ const uvec2 frameSize = { static_cast<unsigned int>(this->Size[0]), static_cast<unsigned int>(this->Size[1]) };
+ if ((unsigned int)this->Internal->ImageX == frameSize[0] && (unsigned int)this->Internal->ImageY == frameSize[1])
{
return;
}
@@ -1115,7 +1115,7 @@
for (int h = 0; h < 3; h++)
{
- *optr = static_cast<u_char>(((float)*iptr) * (A) + ((float)*optr) * (1 - A));
+ *optr = static_cast<unsigned char>(((float)*iptr) * (A) + ((float)*optr) * (1 - A));
optr++;
iptr++;
}