[#366] Fix shader issue on Non-Android target#441
Merged
Conversation
Contributor
|
@easternkite 추가로 제안드리고 싶은 것이 있는데, 요건 이슈에서 대화를 이어나가보시죠. 머지 하겠습니다. 수고하셨습니다! ㅎㅎ |
3872555
into
droidknights:2025/compose-multiplatform
6 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Overview (Required)
기존 코드는 runtimeEffect에 대해서 early build를 수행하고 있었기에, shader에 필요한 해상도(
uResolution)에 올바른 값을 전달하지 못하고 있었습니다.이로 인해, Non-Android 타겟에서 Shader의 시작위치를 제대로 반영하지 못하고 있어서 랜더링 이슈가 발생한 것으로 확인했습니다.
이번 PR에서 Draw 영역의 실제 사이즈를 측정한 이후,
정확한 값을 shader의 uniform에 전달하고 runtimeEffect를 build하도록 수정하였습니다.
아래와 같이, 정확한 사이즈를 update한 뒤 build를 수행하면 문제가 해결됩니다.
.drawWithCache { val runtimeEffect = buildEffect(shader) onDrawBehind { runtimeEffect.update(shader, size.width, size.height) drawRect(brush = runtimeEffect.build()) } },확인 부탁드리겠습니다.
Screenshot