Skip to content

Commit 6dcc483

Browse files
authored
Namespace Streamline annotation handles (#7)
1 parent d4b6c01 commit 6dcc483

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ This project is a Unity package for integrating the Mobile Studio tool suite
55
into game development workflows. This version of the package has the following
66
features for integrating with the Streamline profiler.
77

8-
* C# language bindings for emiting event annotations.
9-
* C# language bindings for emiting software counters.
8+
* C# language bindings for emitting event annotations.
9+
* C# language bindings for emitting software counters.
1010

1111
License
1212
=======
@@ -24,7 +24,7 @@ Technical details
2424
Requirements
2525
------------
2626

27-
This version of the package is compatible with the Unity Editor version 2018.4
27+
This version of the package is compatible with the Unity Editor version 2020.3
2828
LTS and later.
2929

3030
Building
@@ -39,8 +39,18 @@ This package is built using the Unity bee compiler.
3939
`\Editor\Data\il2cpp\build\BeeSettings\offline\bee.exe`
4040
3) To trigger a build, run `bee.exe` in the `Native~` directory.
4141

42+
Compatibility
43+
-------------
44+
45+
This package uses application-generated Streamline annotations to add more
46+
context to captured data. It allocates annotation handles in the ID range 16384-32767; other users of Streamline in the same process should avoid using
47+
this range to avoid collisions.
48+
4249
Installing and using
4350
--------------------
4451

4552
For instructions on how to install and use this package, see the
4653
[full documentation page](Documentation/Mobile-Studio.md).
54+
55+
56+

Runtime/MobileStudio.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ private static extern void gator_annotate_counter_value(
125125
private static UInt32 colorToGatorInt(Color32 color)
126126
{
127127
UInt32 colorInt = ((uint)(color.b) << 24) +
128-
((uint)(color.g) << 16) +
129-
((uint)(color.r) << 8) +
130-
((uint)0x1b);
128+
((uint)(color.g) << 16) +
129+
((uint)(color.r) << 8) +
130+
((uint)0x1b);
131131

132132
return colorInt;
133133
}
@@ -208,7 +208,9 @@ public static UInt64 getTime()
208208
public class Counter
209209
{
210210
// Maintain a unique ID for each counter.
211-
static UInt32 counterCount = 0;
211+
// Allocate in a namespace block starting from 16384 to reduce
212+
// chances of collisions with other users of annotations.
213+
static UInt32 counterCount = 0x4000;
212214

213215
// The scaling modifier used to display series as float to 2dp.
214216
const UInt32 modifier = 100;
@@ -278,7 +280,9 @@ public void set_value(float value)
278280
public class Channel
279281
{
280282
// Maintain a unique ID for each channel.
281-
static UInt32 channelCount = 0;
283+
// Allocate in a namespace block starting from 16384 to reduce
284+
// chances of collisions with other users of annotations.
285+
static UInt32 channelCount = 0x4000;
282286

283287
// Our channel ID.
284288
UInt32 channel;
@@ -397,7 +401,9 @@ public interface CAMJob
397401

398402

399403
// Maintain a unique ID for each CAM.
400-
private static UInt32 camCount = 1;
404+
// Allocate in a namespace block starting from 16384 to reduce
405+
// chances of collisions with other users of annotations.
406+
private static UInt32 camCount = 0x4000;
401407

402408
private UInt32 trackCount;
403409
private UInt32 jobCount;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.arm.mobile-studio",
33
"description": "Unity C# bindings for Mobile Studio.",
4-
"version": "1.2.0",
4+
"version": "1.3.0",
55
"unity": "2020.3",
66
"displayName": "Mobile Studio"
77
}

0 commit comments

Comments
 (0)