Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
Cleanup XA_RECOMPUTE_CHARTS.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpcy committed Jul 24, 2020
1 parent 6cc90ef commit 36b7a02
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions xatlas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6480,7 +6480,6 @@ static bool computeLeastSquaresConformalMap(Mesh *mesh)
return true;
}

#if XA_RECOMPUTE_CHARTS
struct PiecewiseParam
{
void reset(const Mesh *mesh)
Expand Down Expand Up @@ -6878,7 +6877,6 @@ struct PiecewiseParam
return (edgeVertex0.x - point.x) * (edgeVertex1.y - point.y) - (edgeVertex0.y - point.y) * (edgeVertex1.x - point.x);
}
};
#endif

// Estimate quality of existing parameterization.
struct Quality
Expand Down Expand Up @@ -7125,7 +7123,6 @@ class Chart
#endif
}

#if XA_RECOMPUTE_CHARTS
Chart(ChartCtorBuffers &buffers, const Chart *parent, const Mesh *parentMesh, ConstArrayView<uint32_t> faces, const Vector2 *texcoords, const Mesh *sourceMesh) : m_mesh(nullptr), m_unifiedMesh(nullptr), m_type(ChartType::Piecewise), m_tjunctionCount(0), m_isInvalid(false)
{
const uint32_t faceCount = faces.length;
Expand Down Expand Up @@ -7188,7 +7185,6 @@ class Chart
// Need to store texcoords for backup/restore so packing can be run multiple times.
backupTexcoords();
}
#endif

~Chart()
{
Expand Down Expand Up @@ -7364,9 +7360,7 @@ struct CreateAndParameterizeChartTaskGroupArgs
ThreadLocal<UniformGrid2> *boundaryGrid;
ThreadLocal<ChartCtorBuffers> *chartBuffers;
const ChartOptions *options;
#if XA_RECOMPUTE_CHARTS
ThreadLocal<PiecewiseParam> *pp;
#endif
};

struct CreateAndParameterizeChartTaskArgs
Expand Down Expand Up @@ -7470,11 +7464,7 @@ class ChartGroup
Chart *chartAt(uint32_t i) const { return m_charts[i]; }
uint32_t faceCount() const { return m_faceCount; }

#if XA_RECOMPUTE_CHARTS
void computeCharts(TaskScheduler *taskScheduler, const ChartOptions &options, segment::Atlas &atlas, ThreadLocal<UniformGrid2> *boundaryGrid, ThreadLocal<ChartCtorBuffers> *chartBuffers, ThreadLocal<PiecewiseParam> *piecewiseParam)
#else
void computeCharts(TaskScheduler *taskScheduler, const ChartOptions &options, segment::Atlas &atlas, ThreadLocal<UniformGrid2> *boundaryGrid, ThreadLocal<ChartCtorBuffers> *chartBuffers)
#endif
{
// This function may be called multiple times, so destroy existing charts.
for (uint32_t i = 0; i < m_charts.size(); i++) {
Expand Down Expand Up @@ -7558,9 +7548,7 @@ class ChartGroup
groupArgs.boundaryGrid = boundaryGrid;
groupArgs.chartBuffers = chartBuffers;
groupArgs.options = &options;
#if XA_RECOMPUTE_CHARTS
groupArgs.pp = piecewiseParam;
#endif
TaskGroupHandle taskGroup = taskScheduler->createTaskGroup(&groupArgs, chartCount);
Array<CreateAndParameterizeChartTaskArgs> taskArgs;
taskArgs.resize(chartCount);
Expand Down Expand Up @@ -7694,9 +7682,7 @@ struct ChartGroupComputeChartsTaskGroupArgs
TaskScheduler *taskScheduler;
ThreadLocal<UniformGrid2> *boundaryGrid;
ThreadLocal<ChartCtorBuffers> *chartBuffers;
#if XA_RECOMPUTE_CHARTS
ThreadLocal<PiecewiseParam> *piecewiseParam;
#endif
};

static void runChartGroupComputeChartsTask(void *groupUserData, void *taskUserData)
Expand All @@ -7706,11 +7692,7 @@ static void runChartGroupComputeChartsTask(void *groupUserData, void *taskUserDa
if (args->progress->cancel)
return;
XA_PROFILE_START(chartGroupComputeChartsThread)
#if XA_RECOMPUTE_CHARTS
chartGroup->computeCharts(args->taskScheduler, *args->options, args->atlas->get(), args->boundaryGrid, args->chartBuffers, args->piecewiseParam);
#else
chartGroup->computeCharts(args->taskScheduler, *args->options, args->atlas->get(), args->boundaryGrid, args->chartBuffers);
#endif
XA_PROFILE_END(chartGroupComputeChartsThread)
}

Expand All @@ -7722,9 +7704,7 @@ struct MeshComputeChartsTaskGroupArgs
TaskScheduler *taskScheduler;
ThreadLocal<UniformGrid2> *boundaryGrid;
ThreadLocal<ChartCtorBuffers> *chartBuffers;
#if XA_RECOMPUTE_CHARTS
ThreadLocal<PiecewiseParam> *piecewiseParam;
#endif
};

struct MeshComputeChartsTaskArgs
Expand Down Expand Up @@ -7818,9 +7798,7 @@ static void runMeshComputeChartsTask(void *groupUserData, void *taskUserData)
taskGroupArgs.taskScheduler = groupArgs->taskScheduler;
taskGroupArgs.boundaryGrid = groupArgs->boundaryGrid;
taskGroupArgs.chartBuffers = groupArgs->chartBuffers;
#if XA_RECOMPUTE_CHARTS
taskGroupArgs.piecewiseParam = groupArgs->piecewiseParam;
#endif
TaskGroupHandle taskGroup = groupArgs->taskScheduler->createTaskGroup(&taskGroupArgs, chartGroupCount);
for (uint32_t i = 0; i < chartGroupCount; i++) {
Task task;
Expand Down Expand Up @@ -7914,19 +7892,15 @@ class Atlas
ThreadLocal<segment::Atlas> atlas;
ThreadLocal<UniformGrid2> boundaryGrid; // For Quality boundary intersection.
ThreadLocal<ChartCtorBuffers> chartBuffers;
#if XA_RECOMPUTE_CHARTS
ThreadLocal<PiecewiseParam> piecewiseParam;
#endif
MeshComputeChartsTaskGroupArgs taskGroupArgs;
taskGroupArgs.atlas = &atlas;
taskGroupArgs.options = &options;
taskGroupArgs.progress = &progress;
taskGroupArgs.taskScheduler = taskScheduler;
taskGroupArgs.boundaryGrid = &boundaryGrid;
taskGroupArgs.chartBuffers = &chartBuffers;
#if XA_RECOMPUTE_CHARTS
taskGroupArgs.piecewiseParam = &piecewiseParam;
#endif
TaskGroupHandle taskGroup = taskScheduler->createTaskGroup(&taskGroupArgs, meshCount);
for (uint32_t i = 0; i < meshCount; i++) {
Task task;
Expand Down

0 comments on commit 36b7a02

Please sign in to comment.