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

No error when using [D2DInputSimple(n)] but reading outside of current pixel #769

Open
rickbrew opened this issue Mar 2, 2024 · 0 comments
Labels
bug 🐛 Something isn't working untriaged 🧰 A new issue that needs initial triage

Comments

@rickbrew
Copy link
Collaborator

rickbrew commented Mar 2, 2024

I only noticed this recently when someone on the PDN forum posted a shader that was using D2DInputSimple even though they were doing complex sampling: https://forums.getpaint.net/topic/124551-gpu-median-filter/

To repro this, take any D2D shader that specifies [D2DInputComplex(n)] and replace it with [D2DInputSimple(n)].

Two weird things happen:

  1. No compile-time error, which I was expecting d2d1effecthelpers.hlsli to force, e.g. by mapping D2DSampleInputAtOffset(n) to some invalid syntax or the equivalent of a #pragma error
  2. The shader works fine?! What's the actual difference here then? I wonder if it would confuse/break D2D if it tries to use the shader as a linked shader

My proposal is that ComputeSharp.D2D1 should detect this and emit an error.

@rickbrew rickbrew added bug 🐛 Something isn't working untriaged 🧰 A new issue that needs initial triage labels Mar 2, 2024
@rickbrew rickbrew changed the title No error when using [D2DInputSimple(n)] but reading beyond current pixel No error when using [D2DInputSimple(n)] but reading outside of current pixel Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working untriaged 🧰 A new issue that needs initial triage
Projects
None yet
Development

No branches or pull requests

1 participant