FxPlug outputTexture have wrong usage.

After the build 4.2.9. I have a weird bug. It keep crashing and when I read the message, it display

validateRenderPassDescriptor:782: failed assertion `RenderPass Descriptor Validation
Texture at colorAttachment[0] has usage (0x01) which doesn't specify MTLTextureUsageRenderTarget (0x04)

This happen when I run in debug mode and try to hook up the motion template. I found out that the output texture create have usage only "MTLTextureUsageShaderRead" but no "MTLTextureUsageRenderTarget" Anyone have problem like me? I uusing fxplug 4.2.9 motion 5.7 and final cut 10.7.1. running in sonoma 14.2.1

在FxRemoteWindowAPI 的协议中,没有办法设置 window.frame.origin 使用NSWindow时,又无法实现 [Window setLevel:NSFloatingWindowLevel]; 请问我应该如何保持窗口在Final cut pro 的前面呢?

I have encountered the same FxPlug problem as described by @goamk. I have created my own texture and wish to render it to the output texture. In attempting to setup the command encoder with the outputTexture as the colorAttachment, the error described by goamk appears in Xcode debugger.

As goamk notes, the plugin DOES work as expected when NOT run via the Xcode debugger.

Fxplug = v4.3 Motion = v5.8 Xcode = 15.4 OS = Sonoma 14.5 on Apple M2 Max studio.

My code worked fine previously under Fxplug 4.2.2 and Motion 5.5.3 on an Intel Mac.

I have a different Fxplug in which I resolve an MSAA into the outputTexture. This is working fine.

Looking at the current FxBrightness example, it appears to me that I am doing the same type of setup to write to the output texture as demonstrated there (though mine is in Objective-C still). But I must be missing something.


Code excerpt


uint64_t            deviceRegistryID    = destinationImage.deviceRegistryID;
            FxMTLDeviceCache*   deviceCache         = [FxMTLDeviceCache deviceCache];
            // Get the destination's GPU device
            id<MTLDevice>       device              = [deviceCache deviceWithRegistryID:deviceRegistryID];
            MTLPixelFormat      pixelFormat         = [FxMTLDeviceCache MTLPixelFormatForImageTile:destinationImage];
            id<MTLCommandQueue> commandQueue        = [deviceCache commandQueueWithRegistryID:deviceRegistryID
                                                                                  pixelFormat:pixelFormat];
id<MTLTexture>      outputTexture       = [destinationImage metalTextureForDevice:device];

[SNIP]

// Setup the color attachment for the output texture, with load action to clear the output texture
            MTLRenderPassColorAttachmentDescriptor* fbColorAttachmentDescriptor = [[MTLRenderPassColorAttachmentDescriptor alloc] init];
            fbColorAttachmentDescriptor.texture = outputTexture;
            fbColorAttachmentDescriptor.clearColor = MTLClearColorMake(0.0, 0.0, 0.0, 0.0);
            fbColorAttachmentDescriptor.loadAction = MTLLoadActionClear;
            
            NSLog(@"Output texture usage is: %lu", outputTexture.usage);
  
            // Create a render pass descriptor and attach the color attachment to it
            MTLRenderPassDescriptor*    fbRenderPassDescriptor    = [MTLRenderPassDescriptor renderPassDescriptor];
            fbRenderPassDescriptor.colorAttachments [ 0 ] = fbColorAttachmentDescriptor;
        
            // Create the render command encoder
            id<MTLRenderCommandEncoder>   fbCommandEncoder  = [fbCommandBuffer renderCommandEncoderWithDescriptor:fbRenderPassDescriptor];

==> validateRenderPassDescriptor:782: failed assertion `RenderPass Descriptor Validation Texture at colorAttachment[0] has usage (0x01) which doesn't specify MTLTextureUsageRenderTarget (0x04) '

FxPlug outputTexture have wrong usage.
 
 
Q