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

[Krom] Binding render target for compute shader doesn't work #1406

Open
MoritzBrueckner opened this issue Mar 19, 2022 · 0 comments
Open

[Krom] Binding render target for compute shader doesn't work #1406

MoritzBrueckner opened this issue Mar 19, 2022 · 0 comments

Comments

@MoritzBrueckner
Copy link
Contributor

Describe the bug
When using a render target instead of a "regular" image as a writeonly image2D uniform in a compute shader on Krom (Windows), the texture is not bound correctly.

To Reproduce

  1. Clone https://github.com/Kha-Samples/ComputeShader (e34a690)
  2. In Main.main(), replace line 36
    texture = Image.create(256, 256, TextureFormat.RGBA128);
    with
    texture = Image.createRenderTarget(256, 256, TextureFormat.RGBA128);
  3. Publish to Krom and you will see a black screen.

Expected behavior
The visual result when using a rendertarget should be the same as when using a regular image.

Screenshots
Using a regular image:
grafik

Using a render target:
(it's a black screen)

Inspecting the render target version in RenderDoc (the capture is attached below):

Execution Environment:

  • Host system (where you compile your code): Windows 10
  • Target system (where you run your code): Windows 10
  • IDE used (if any): VS Codium
  • Kha revision: 59478ab
  • Using latest Krom_bin (d99ac49)
  • Kha build output (Using Kha...):
    Using Kha (59478aba) from [...]\Kha
    Creating Kha project.
    Compiling shader 1 of 3 (shader.frag.glsl).
    Compiling shader 2 of 3 (shader.vert.glsl).
    Compiling shader 3 of 3 (test.comp.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).
    Done.
    
  • Application output (if it runs): -

Additional context
RenderDoc capture: ComputeShader_RenderTarget.zip

Using a different texture format (tested all RGBA variants), using Access.ReadWrite in setTexture() and making the uniform restricted don't change the outcome, there's still a black screen.

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

1 participant