-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor: remove fatal error from the constructor of texture. #22
base: master
Are you sure you want to change the base?
refactor: remove fatal error from the constructor of texture. #22
Conversation
@@ -6,7 +6,7 @@ public class ImageGenerator: ImageSource { | |||
|
|||
public init(size:Size) { | |||
self.size = size | |||
internalTexture = Texture(device:sharedMetalRenderingDevice.device, orientation:.portrait, width:Int(size.width), height:Int(size.height), timingStyle:.stillImage) | |||
internalTexture = Texture(device:sharedMetalRenderingDevice.device, orientation:.portrait, width:Int(size.width), height:Int(size.height), timingStyle:.stillImage)! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Is it safe to use force unwrap here?
I vote option 2 |
Sorry please ignore it |
Hi @yyjim, I've updated the code with the option 1, please help to review the PR again when you're available, thanks! |
else { | ||
assertionFailure("CommandBuffer or Texture creation failed") | ||
removeTransientInputs() | ||
textureInputSemaphore.signal() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we should, and I notice it shouldn't be invoke inside the defer
Let we add and remove them in the next commit, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure if this correct or not. The L138 call also wait.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling it in defer seems reasonable to me since it calls wait at the beginning.
it only wants to run one at the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's weird...sorry I didn't notice this 🤔
I'll go back to check this later after I update the implementation for the PR of the face mask.
- Stop the process when it occurs in the newTextureAvailable - Force unwrap the value for those who won't be used in PicCollage
646d38d
to
870abf3
Compare
Descriptions:
Solution:
Topics for discussion:
In CBVisualEffectBuiltIn, we use the input as the output directly when the makeTexture function return nil: