I'm modifying <1mb of a 256mb managed buffer (calling didModifyRange), but according to Metal System Trace, the GPU copies the whole buffer (SDMA0 channel, "Page On 268435456 bytes"), taking 13ms.
I'm making lots of small modifications (~4k) per frame. I also tried coalescing into a single call to didModifyRange (~66mb) and still the entire buffer is copied. I also tried calling didModifyRange for the first byte, and then the copied data is small.
So I'm wondering why didModifyRange doesn't seem to be efficient for many small updates to a big buffer?
Post
Replies
Boosts
Views
Activity
Does removeRenderObserver ensure that no further calls are made to the removed observer by the time removeRenderObserver returns?
I've got some shared state between render observers and I want to ensure it isn't prematurely deallocated.
On my machine (macOS 10.15.5 (19F101)), this simple program changes when the optimizer (-O2) is turned on:
#include <stdio.h>
#include <math.h>
#include "load.h"
int main() {
float x = load(0x3cc3a2be);
float result = 100 * powf(2, x);
printf("result: %f\n", result);
return 0;
}
Without optimization:
result: 101.669098 With -O2:
result: 101.669106 With load defined in a separate translation unit so this all doesn't get inlined and constant folded:
float load(uint32_t value) {
union {
float f;
uint32_t u;
} f2u;
f2u.u = value;
return f2u.f;
}
If you use godbolt.org, you'll see that clang's optimizer replaces powf(2, x) with exp2f which results in very slightly different results (at least on my machine). Here's the generated assembly on my machine:
movl $1019454142, %edi imm = 0x3CC3A2BE
callq _load
callq _exp2f
Is this a bug? Does the optimizer claim to produce the same numerical results as non-optimized?
I'm using an xcframework to hide code.So I've got an App.xcodeproj and the xcframework in one repo visible to contractors.Then I have another private project which has everything in App.xcodeproj except has the framework project as a sub-project for easier development instead of the xcframework.This works reasonably well except I have to keep the internal (private) and external projects in sync. Changes the contractors make to App.xcodeproj have to be manually brought over to the internal project, updating paths accordingly.Is there a better way to do this?
I've got an issue with ModelIO using over 2gb of ram to export a 400mb file.My app (3d sculpting) tends to produce big meshes. For simple file formats (obj, stl) I use my own code and stream out the data, keeping usage very low.But for a complex format like USD, I use modelIO. Wondering if there's any way I can reduce memory usage.I've already tried using memory mapping for the vertex and index data (NSDataReadingMappedAlways), but it doesn't seem to help.
We haven't been able to get Apple's AUv3 sample code to work reliably across our machines.I'm referring to the code here: https://developer.apple.com/documentation/audiotoolbox/creating_custom_audio_effectsiMac Pro Late 2017: validates and seems to workMacBook Pro 15" 2018: auval can't find the pluginMacBook Pro 15" Late 2013: auval -a segfaults, auval -v afux filtr Demo returns:Input/Output Channel Handling:1-1 1-2 1-4 1-5 1-6 1-7 1-8 2-2 2-4 2-5 2-6 2-7 2-8 4-4 4-5 5-5 6-6 7-7 8-8X X X X X X X ERROR: -10868 IN CALL Cannot Set Output Num Channels:2 when unit says it canERROR: -10868 IN CALL Cannot Set Output Num Channels:4 when unit says it canERROR: -10868 IN CALL Cannot Set Output Num Channels:5 when unit says it canERROR: -10868 IN CALL Cannot Set Output Num Channels:6 when unit says it canERROR: -10868 IN CALL Cannot Set Output Num Channels:7 when unit says it canERROR: -10868 IN CALL Cannot Set Output Num Channels:8 when unit says it canERROR: -10868 IN CALL Cannot Set Output Num Channels:2 when unit says it canI've tried deleting ~/Library/Caches/AudioUnitCache and rebooting.I'm not sure what else to do.
I'm following along with "Creating Great Localized Experiences with Xcode 11" from WWDC 2019.My test run generated a lot of screenshot attachments which I can see in the test results.However, in the "Export for Localization..." dialog "Include Screenshots" is grayed out.What sort of configuration is required to get this to work?
Why Auto Layout instead of the horizontal and vertical boxes used by other systems like Qt? Or a layout system like CSS?What is missing in the other ways of doing this stuff?Over a couple years, Auto Layout has given me mostly headaches, and I now generally try to avoid it, so I want to know if there's a good reason for my suffering.thanks!