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

It doesn't render to more than one render target using metal backend #1359

Open
BlackGoku36 opened this issue Sep 2, 2021 · 3 comments
Open

Comments

@BlackGoku36
Copy link

Describe the bug
Doing this, where colorImage and normalImage are render target.

var g = colorImage.g4;
g.begin([normalImage]);
// drawing
g.end();

normalImage render target appears black.
To Reproduce
https://github.com/BlackGoku36/MRTKhaBug

Expected behavior
Screen Shot 2021-09-02 at 9 41 13 PM

Screenshots
Screen Shot 2021-09-02 at 9 40 47 PM

Execution Environment:

  • Host system (where you compile your code): MacOS
  • Target system (where you run your code): MacOS
  • IDE used (if any): VSCode
  • Kha revision: 0ad3463
  • Kha build output (Using Kha...):
Using Kha (0ad34631, M Kinc,?? Backends/Kore/) from /Users/urjasvisuthar/Kha
Creating Kha project.
Compiling shader 1 of 4 (shade.frag.glsl).
Compiling shader 2 of 4 (shade.vert.glsl).
Compiling shader 3 of 4 (texdebug.frag.glsl).
Compiling shader 4 of 4 (texdebug.vert.glsl).
Compiling shader 1 of 8 (painter-colored.frag.glsl).
Compiling shader 2 of 8 (painter-colored.vert.glsl).
Compiling shader 3 of 8 (painter-image.frag.glsl).
Compiling shader 4 of 8 (painter-image.vert.glsl).
Compiling shader 5 of 8 (painter-text.frag.glsl).
Compiling shader 6 of 8 (painter-text.vert.glsl).
Compiling shader 7 of 8 (painter-video.frag.glsl).
Compiling shader 8 of 8 (painter-video.vert.glsl).
Using Kinc (e2a61ca0, M Backends/System/macOS/Sources/kinc/backend/audio.cpp, M Backends/System/macOS/Sources/kinc/backend/input/mouse.mm, M Backends/System/macOS/Sources/kinc/backend/system.mm, M Backends/System/macOS/Sources/kinc/backend/windowdata.h) from /Users/urjasvisuthar/Kha/Kinc
kincfile found.
Creating macOS project files.
Done.
  • Application output (if it runs):
Starting Kinc
2021-09-02 21:52:26.969092+0530 New Project[5504:77300] Metal GPU Frame Capture Enabled
2021-09-02 21:52:26.969708+0530 New Project[5504:77300] Metal API Validation Enabled
Starting application
2021-09-02 21:52:27.062177+0530 New Project[5504:77300] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600003b9bcc0> F8BB1C28-BAE8-11D6-9C31-00039315CD46
2021-09-02 21:52:27.120209+0530 New Project[5504:77300]   saved enable noise cancellation setting is the same as the default (=1)
deviceBufferSize = 4096

mSampleRate = 44100

mFormatFlags = 00000009

mBytesPerPacket = 8

mFramesPerPacket = 1

mChannelsPerFrame = 2

mBytesPerFrame = 8

mBitsPerChannel = 32
@BlackGoku36
Copy link
Author

Using this project instead: https://github.com/BlackGoku36/MRTKhaBug2
Kha version: 87009c6

Build output:

Using Kha (¯\_(ツ)_/¯) from /Users/urjasvisuthar/Desktop/MRTKhaBug2/Kha
Creating Kha project.
Compiling shader 1 of 6 (light.frag.glsl).
Compiling shader 2 of 6 (light.vert.glsl).
Compiling shader 3 of 6 (shade.frag.glsl).
Compiling shader 4 of 6 (shade.vert.glsl).
Compiling shader 5 of 6 (texdebug.frag.glsl).
Compiling shader 6 of 6 (texdebug.vert.glsl).
Compiling shader 1 of 8 (painter-colored.frag.glsl).
Compiling shader 2 of 8 (painter-colored.vert.glsl).
Compiling shader 3 of 8 (painter-image.frag.glsl).
Compiling shader 4 of 8 (painter-image.vert.glsl).
Compiling shader 5 of 8 (painter-text.frag.glsl).
Compiling shader 6 of 8 (painter-text.vert.glsl).
Compiling shader 7 of 8 (painter-video.frag.glsl).
Compiling shader 8 of 8 (painter-video.vert.glsl).
Using Kinc (9eed21a7) from /Users/urjasvisuthar/Desktop/MRTKhaBug2/Kha/Kinc
kincfile found.
Creating macOS project files.
Done.

Application output:

-[MTLDebugRenderCommandEncoder validateFramebufferWithRenderPipelineState:]:1288: failed assertion `Framebuffer With Render Pipeline State Validation
For color attachment 1, the render pipeline's pixelFormat (MTLPixelFormatInvalid) does not match the framebuffer's pixelFormat (MTLPixelFormatBGRA8Unorm).
'

@BlackGoku36
Copy link
Author

(Kha version has nothing to do with both the issue)

@XANOZOID
Copy link

XANOZOID commented Sep 8, 2021

Fixed the Kha version not showing up though, here: Kode/khamake#250

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