Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not create render pipeline state for vertex blendOperationFragment #6

Open
ahmedsafadii opened this issue Aug 18, 2021 · 1 comment

Comments

@ahmedsafadii
Copy link

VideoLab/MetalRendering.swift:113: Fatal error: Could not create render pipeline state for vertex:blendOperationVertex, fragment:blendOperationFragment, error:Error Domain=CompilerError Code=2 "reading from a rendertarget is not supported" UserInfo={NSLocalizedDescription=reading from a rendertarget is not supported}
2021-08-18 13:05:13.551297+0300 dubme-app[32964:963572] VideoLab/MetalRendering.swift:113: Fatal error: Could not create render pipeline state for vertex:blendOperationVertex, fragment:blendOperationFragment, error:Error Domain=CompilerError Code=2 "reading from a rendertarget is not supported" UserInfo={NSLocalizedDescription=reading from a rendertarget is not supported}

@ruanjx

                let tempFile = TemporaryMediaFile(withData: video.asset)
                if let asset = tempFile.avAsset {
                    let resource = AVAssetSource(asset: asset)
                    resource.selectedTimeRange = CMTimeRange(start: CMTime.zero, duration: asset.duration)
                    var timeRange = resource.selectedTimeRange
                    lastVideo = resource

                    let renderLayer1 = RenderLayer(timeRange: timeRange, source: resource)
                    
                    // 2. Composition
                    let composition = RenderComposition()
                    composition.renderSize = CGSize(width: 1280, height: 720)
                    composition.layers = [renderLayer1]

                    // 3. VideoLab
                    let videoLab = VideoLab(renderComposition: composition)

                    // 4. Make playerItem
                    let playerItem = videoLab.makePlayerItem()
                    
//                    self.renderLayers.append(renderLayer1)
                }
                ```
@devoln
Copy link

devoln commented Aug 19, 2021

I encountered this problem too. I found that the framework uses programmable blending which is not supported in the iOS simulator. However, it perfectly works on real devices and when you debug the app natively on Apple Silicon macs.
The problem can probably be solved on the VideoLab side by reimplementing common blend modes with their fixed-function counterparts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants