Posts

Post not yet marked as solved
0 Replies
433 Views
In a iOS metal app, I render on a mtkView on a backround thread. I get the current renderDescriptor from the view using mtkView.currentRenderPassDescriptor. I use that renderDescriptor to create a MTLRenderCommandEncoder. That MTLRenderCommandEncoder sometimes have inconsistent size (width, height) during orientation change : _width and _height are different than the size of stored in the currentRenderPassDescriptor. This causes problem when using setScissor method :failed assertion `(rect.x(0) + rect.width(1792))(1792) must be <= render pass width(828)’.So my questions are :why those 2 sizes are different ? Where does the second size come from ?How can I access this second size (MTLRenderCommandEncoder->_width) as it seems the “real size” used to validate the setScissor method?This is a summary of the code :MTLRenderPassDescriptor* renderPassDescriptor = view.currentRenderPassDescriptor; renderPassDescriptor.colorAttachments[0].loadAction = MTLLoadActionClear; renderPassDescriptor.colorAttachments[0].clearColor = MTLClearColorMake(0, 0, 0, 1); id renderEncoder = [commandBuffer renderCommandEncoderWithDescriptor:renderPassDescriptor]; CGFloat colorAttachementWidth = _passDescriptor.colorAttachments[0].texture.width; CGFloat colorAttachementHeight = _passDescriptor.colorAttachments[0].texture.height; MTLScissorRect rect; rect.x = 0; rect.y = 0; rect.width = colorAttachementWidth; rect.height = colorAttachementHeight; [renderEncoder setScissorRect:self.scissorRect]; // -> that will trigger the assertionThis is the description of the MTLRenderCommandEncoder when I get the assertion :-> label = MyRenderEncoder device = name = Apple A12 GPU descriptor = Color Attachment 0 texture = label = Drawable textureType = MTLTextureType2D pixelFormat = MTLPixelFormatBGRA8Unorm width = 1792 // <——————————————————— this size is not consistent with the size below height = 828 depth = 1 arrayLength = 1 mipmapLevelCount = 1 sampleCount = 1 cpuCacheMode = MTLCPUCacheModeDefaultCache storageMode = MTLStorageModeShared resourceOptions = MTLResourceCPUCacheModeDefaultCache MTLResourceStorageModeShared … level = 0 slice = 0 depthPlane = 0 resolveTexture = resolveLevel = 0 resolveSlice = 0 resolveDepthPlane = 0 loadAction = MTLLoadActionClear storeAction = MTLStoreActionStore storeActionOptions = none clearColor = (0 0 0 1) yInvert = NO ... Depth Attachment: texture = label = Render Depth textureType = MTLTextureType2D pixelFormat = MTLPixelFormatDepth32Float width = 828 // <——————————————————— this size is not consistent height = 1792 depth = 1 arrayLength = 1 mipmapLevelCount = 1 sampleCount = 1 cpuCacheMode = MTLCPUCacheModeDefaultCache storageMode = MTLStorageModePrivate resourceOptions = MTLResourceCPUCacheModeDefaultCache MTLResourceStorageModePrivate usage = MTLTextureUsageRenderTarget
Posted
by apleton.
Last updated
.
Post not yet marked as solved
0 Replies
296 Views
HelloI'm implementing an AUV3 extension (AUAudioUnit) and I would like to know how to restore the state of the instance when the extension is loaded from the host. The extension should save/restore several float parameters each time the extension quits/opens. The documentation mentions the "fullState" poperty but it's not clear if/when that propery is set by the host. Also I would like to save a file specific to the running instance. So if 2 instances of the extension are running by the host, there would be two different files saved. Are there several specific directories related to each instance ? Thanks
Posted
by apleton.
Last updated
.