Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

[WHLSL] Not all functions should be able to run in all shader stages #59

Closed
litherum opened this issue Oct 13, 2018 · 10 comments
Closed
Milestone

Comments

@litherum
Copy link
Contributor

Migrated from https://bugs.webkit.org/show_bug.cgi?id=189121:

At 2018-08-29T23:34:17Z, mmaxfield@apple.com wrote:
Derivative functions can only run in fragment shaders. There are probably others like this.

Same for built-in variables.

@litherum
Copy link
Contributor Author

At 2018-08-29T23:38:20Z, mmaxfield@apple.com wrote:
Barriers can only be used in compute shaders

@litherum
Copy link
Contributor Author

At 2018-08-30T00:18:57Z, tdenney@apple.com wrote:
When these functions are introduced in the standard library it would be nice if we could add the restriction there, e.g.

native fragment float ddx(float)

And then enforce that native functions with the fragment annotation can only be called from inside fragment shaders. I’d prefer to have a syntactic restriction like this than something that the interpreter/spec has to worry about.

@litherum
Copy link
Contributor Author

At 2018-09-13T01:51:06Z, webkit-bug-importer@group.apple.com wrote:
rdar://problem/44403005

@litherum
Copy link
Contributor Author

At 2018-09-22T08:59:22Z, mmaxfield@apple.com wrote:
The built-in variables are handled in https://bugs.webkit.org/show_bug.cgi?id=189134

@litherum
Copy link
Contributor Author

At 2018-09-22T09:59:08Z, mmaxfield@apple.com wrote:
Created attachment 350512
Patch

@litherum
Copy link
Contributor Author

At 2018-09-22T11:24:55Z, mmaxfield@apple.com wrote:
I'm not sure that additions to the grammar are a good idea. If we add new keywords here, it seems we should also be doing it in https://bugs.webkit.org/show_bug.cgi?id=189122, but I don't think a proliferation of these keywords are a good idea. It seems like the compiler could "just know" which functions have which properties.

@litherum
Copy link
Contributor Author

At 2018-09-22T21:00:11Z, mmaxfield@apple.com wrote:
Created attachment 350533
Patch

@litherum
Copy link
Contributor Author

At 2018-09-25T00:29:22Z, commit-queue@webkit.org wrote:
Comment on attachment 350533
Patch

Rejecting attachment 350533 from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-01', 'apply-attachment', '--no-update', '--non-interactive', 350533, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Logging in as commit-queue@webkit.org...
Fetching: https://bugs.webkit.org/attachment.cgi?id=350533&action=edit
Fetching: https://bugs.webkit.org/show_bug.cgi?id=189121&ctype=xml&excludefield=attachmentdata
Processing 1 patch from 1 bug.
Processing patch 350533 from bug 189121.
Fetching: https://bugs.webkit.org/attachment.cgi?id=350533
Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Filip Pizlo']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Parsed 15 diffs from patch file(s).
patching file Tools/ChangeLog
Hunk #1 succeeded at 1 with fuzz 3.
patching file Tools/WebGPUShadingLanguageRI/All.js
patching file Tools/WebGPUShadingLanguageRI/CheckNativeFuncStages.js
patching file Tools/WebGPUShadingLanguageRI/Intrinsics.js
Hunk #1 succeeded at 715 (offset 4 lines).
Hunk #2 succeeded at 822 (offset 4 lines).
patching file Tools/WebGPUShadingLanguageRI/LateChecker.js
Hunk #1 succeeded at 72 with fuzz 2 (offset 2 lines).
patching file Tools/WebGPUShadingLanguageRI/NativeFunc.js
patching file Tools/WebGPUShadingLanguageRI/Parse.js
Hunk #1 FAILED at 1171.
Hunk #2 succeeded at 1290 (offset 53 lines).
Hunk #3 succeeded at 1300 (offset 55 lines).
Hunk #4 succeeded at 1320 (offset 55 lines).
1 out of 4 hunks FAILED -- saving rejects to file Tools/WebGPUShadingLanguageRI/Parse.js.rej
patching file Tools/WebGPUShadingLanguageRI/Prepare.js
patching file Tools/WebGPUShadingLanguageRI/SPIRV.html
patching file Tools/WebGPUShadingLanguageRI/StandardLibrary.js
Hunk #4 succeeded at 1794 (offset 9 lines).
Hunk #5 FAILED at 1905.
Hunk #6 FAILED at 1915.
2 out of 6 hunks FAILED -- saving rejects to file Tools/WebGPUShadingLanguageRI/StandardLibrary.js.rej
patching file Tools/WebGPUShadingLanguageRI/StatementCloner.js
Hunk #1 succeeded at 46 (offset 3 lines).
patching file Tools/WebGPUShadingLanguageRI/Test.html
patching file Tools/WebGPUShadingLanguageRI/Test.js
patching file Tools/WebGPUShadingLanguageRI/WSyntaxError.js
patching file Tools/WebGPUShadingLanguageRI/index.html

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Filip Pizlo']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: https://webkit-queues.webkit.org/results/9338063

@litherum
Copy link
Contributor Author

At 2018-09-25T06:36:18Z, mmaxfield@apple.com wrote:
Committed r236455: https://trac.webkit.org/changeset/236455

@litherum
Copy link
Contributor Author

At 2018-09-25T19:35:10Z, mmaxfield@apple.com wrote:
Committed r236470: https://trac.webkit.org/changeset/236470

@litherum litherum added this to the m1 milestone Oct 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant