Skip to content

Commit 4f7402d

Browse files
committed
Merge branch 'RB-10.4' into main
2 parents 8fe1645 + 16942e8 commit 4f7402d

File tree

5 files changed

+92
-42
lines changed

5 files changed

+92
-42
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,55 +30,45 @@ jobs:
3030
# and then use `include` to define their settings.
3131

3232
name: [
33-
linux-python2,
34-
linux-python2-debug,
3533
linux-python3,
34+
linux-python3-debug,
3635
windows-python3,
3736
windows-python3-debug
3837
]
3938

4039
include:
4140

42-
- name: linux-python2
41+
- name: linux-python3
4342
os: ubuntu-20.04
4443
buildType: RELEASE
4544
containerImage: ghcr.io/gafferhq/build/build:2.0.0
4645
options: .github/workflows/main/options.posix
47-
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/5.1.0/gafferDependencies-5.1.0-Python2-linux.tar.gz
46+
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/6.0.0/gafferDependencies-6.0.0-linux.tar.gz
4847
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB testAppleseed
4948
publish: true
5049

51-
- name: linux-python2-debug
50+
- name: linux-python3-debug
5251
os: ubuntu-20.04
5352
buildType: DEBUG
5453
containerImage: ghcr.io/gafferhq/build/build:2.0.0
5554
options: .github/workflows/main/options.posix
56-
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/5.1.0/gafferDependencies-5.1.0-Python2-linux.tar.gz
55+
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/6.0.0/gafferDependencies-6.0.0-linux.tar.gz
5756
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB testAppleseed
5857
publish: false
5958

60-
- name: linux-python3
61-
os: ubuntu-20.04
62-
buildType: RELEASE
63-
containerImage: ghcr.io/gafferhq/build/build:2.0.0
64-
options: .github/workflows/main/options.posix
65-
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/5.1.0/gafferDependencies-5.1.0-Python3-linux.tar.gz
66-
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB testAppleseed
67-
publish: true
68-
6959
- name: windows-python3
7060
os: windows-2019
7161
buildType: RELEASE
7262
options: .github/workflows/main/options.windows
73-
dependenciesURL: https://github.com/hypothetical-inc/gafferDependencies/releases/download/6.2.1/gafferDependencies-6.2.1-Python3-windows.zip
63+
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/6.0.0/gafferDependencies-6.0.0-windows.zip
7464
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
7565
publish: true
7666

7767
- name: windows-python3-debug
7868
os: windows-2019
7969
buildType: RELWITHDEBINFO
8070
options: .github/workflows/main/options.windows
81-
dependenciesURL: https://github.com/hypothetical-inc/gafferDependencies/releases/download/6.2.1/gafferDependencies-6.2.1-Python3-windows.zip
71+
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/6.0.0/gafferDependencies-6.0.0-windows.zip
8272
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
8373
publish: false
8474

Changes

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
1-
10.4.x.x (relative to 10.4.5.0)
1+
10.4.6.0 (relative to 10.4.5.0)
22
========
33

4+
Features
5+
--------
6+
7+
- MeshAlgo : Added new MeshSplitter class, for efficient splitting meshes based on uniform primitive variables.
8+
- ImathHash : Added new header that defines `std::hash` for Imath types.
9+
10+
Improvements
11+
------------
12+
13+
- PointsPrimitive, Primitive : Accelerated bounds computation using `tbb::parallel_reduce`.
14+
- MeshAlgo : Improved performance of `segment()`.
15+
416
Fixes
517
-----
618

719
- ImageReader : Fixed compilation with versions of OIIO < 2.4.
820
- USDScene : Invalid primitive variables are now skipped during loading, with a warning being emitted instead.
21+
- MeshAlgo : Fixed crease handling in `deleteFaces()`.
22+
23+
Build
24+
-----
25+
26+
- Updated CI builds to use GafferHQ/dependencies version `6.0.0`, making them suitable for use in Gaffer `1.2.x.x`.
927

1028
10.4.5.0 (relative to 10.4.4.0)
1129
========

SConstruct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ SConsignFile()
5656

5757
ieCoreMilestoneVersion = 10 # for announcing major milestones - may contain all of the below
5858
ieCoreMajorVersion = 4 # backwards-incompatible changes
59-
ieCoreMinorVersion = 5 # new backwards-compatible features
59+
ieCoreMinorVersion = 6 # new backwards-compatible features
6060
ieCorePatchVersion = 0 # bug fixes
6161
ieCoreVersionSuffix = "" # used for alpha/beta releases. Example: "a1", "b2", etc.
6262

src/IECoreScene/PointsPrimitive.cpp

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
#include "IECore/MurmurHash.h"
4141
#include "IECore/SimpleTypedData.h"
4242

43+
#include <tbb/parallel_reduce.h>
44+
#include <tbb/blocked_range.h>
45+
4346
using namespace std;
4447
using namespace Imath;
4548
using namespace IECore;
@@ -193,26 +196,45 @@ Imath::Box3f PointsPrimitive::bound() const
193196
// Compute the bounding box from the gathered data.
194197

195198
Box3f result;
196-
for( size_t i = 0; i < count; ++i )
197-
{
198-
float r = constantWidth * *width / 2.0f;
199-
width += widthStep;
200-
if( aspectRatio )
201-
{
202-
// Type is patch - the diagonal will be
203-
// longer than either the width or the
204-
// height, so derive a new radius from that.
205-
float hh = r; // half the height
206-
if( *aspectRatio != 0.0f )
199+
using RangeType = tbb::blocked_range< const V3f* >;
200+
tbb::this_task_arena::isolate( [ =, & result ]{
201+
tbb::task_group_context taskGroupContext( tbb::task_group_context::isolated );
202+
result = tbb::parallel_reduce( RangeType( p, p + count, 1000 ), Imath::Box3f(),
203+
[ = ]( const RangeType& range, const Imath::Box3f& value ) -> Imath::Box3f
207204
{
208-
hh /= *aspectRatio;
209-
}
210-
r = sqrtf( r * r + hh * hh );
211-
aspectRatio += aspectRatioStep;
212-
}
213-
result.extendBy( Box3f( *p - V3f( r ), *p + V3f( r ) ) );
214-
p++;
215-
}
205+
Imath::Box3f b( value );
206+
const size_t offset = range.begin() - p;
207+
const float* wIt = offset * widthStep + width;
208+
const float* aIt = offset * aspectRatioStep + aspectRatio;
209+
for( const V3f& pos : range )
210+
{
211+
float r = constantWidth * ( *wIt ) / 2.0f;
212+
wIt += widthStep;
213+
if( aspectRatio )
214+
{
215+
// Type is patch - the diagonal will be
216+
// longer than either the width or the
217+
// height, so derive a new radius from that.
218+
float hh = r; // half the height
219+
if( ( *aIt ) != 0.0f )
220+
{
221+
hh /= ( *aIt );
222+
}
223+
r = sqrtf( r * r + hh * hh );
224+
aIt += aspectRatioStep;
225+
}
226+
b.extendBy( Box3f( pos - V3f( r ), pos + V3f( r ) ) );
227+
}
228+
return b;
229+
},
230+
[]( const Imath::Box3f& lhs, const Imath::Box3f& rhs ) -> Imath::Box3f
231+
{
232+
Imath::Box3f b( lhs );
233+
b.extendBy( rhs );
234+
return b;
235+
},
236+
taskGroupContext );
237+
} );
216238

217239
return result;
218240
}

src/IECoreScene/Primitive.cpp

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141

4242
#include "boost/algorithm/string.hpp"
4343

44+
#include <tbb/parallel_reduce.h>
45+
#include <tbb/blocked_range.h>
46+
4447
#include <cassert>
4548

4649
using namespace IECore;
@@ -78,10 +81,27 @@ Imath::Box3f Primitive::bound() const
7881
if( p )
7982
{
8083
const vector<V3f> &pp = p->readable();
81-
for( size_t i=0; i<pp.size(); i++ )
82-
{
83-
result.extendBy( pp[i] );
84-
}
84+
using RangeType = tbb::blocked_range< const V3f* >;
85+
tbb::this_task_arena::isolate( [ & result, & pp ]{
86+
tbb::task_group_context taskGroupContext( tbb::task_group_context::isolated );
87+
result = tbb::parallel_reduce( RangeType( pp.data(), pp.data() + pp.size(), 1000 ), Imath::Box3f(),
88+
[]( const RangeType& range, const Imath::Box3f& value ) -> Imath::Box3f
89+
{
90+
Imath::Box3f b( value );
91+
for( const V3f& pos : range )
92+
{
93+
b.extendBy( pos );
94+
}
95+
return b;
96+
},
97+
[]( const Imath::Box3f& lhs, const Imath::Box3f& rhs ) -> Imath::Box3f
98+
{
99+
Imath::Box3f b( lhs );
100+
b.extendBy( rhs );
101+
return b;
102+
},
103+
taskGroupContext );
104+
} );
85105
}
86106
}
87107
return result;

0 commit comments

Comments
 (0)