Sitelet https://github.com/gpuweb/gpuweb/pull/1963
Skip to content

Rename SHADER_READ back to SAMPLED - #1963

Closed
Kangz wants to merge 1 commit into
gpuweb:mainfrom
Kangz:sampled
Closed

Kangz wants to merge 1 commit into
gpuweb:mainfrom
Kangz:sampled

Conversation

@Kangz

@Kangz Kangz commented Jul 19, 2021 •

Copy link
Copy Markdown
Contributor

The rename was previously bundled as part of #1794 but not really discussed in details.

I have concerns about the name SHADER_READ because in the future where we have read-write storage textures it will be confusing that SHADER_READ doesn't allow readonly-storage and how it interacts with read-write-storage.

The major difference we should try to highlight is that one path is likely to use the texture unit (so "sampled" which is why I reverted back to SAMPLED in this PR) and another one is likely to use direct memory loads (that's "storage").

I could probably be convinced that in the future when we have readonly-storage-texture, people will understand that the storage takes precedence and the texture has to be STORAGE (though they might think they also need SHADER_READ)


💥 Error: 500 Internal Server Error 💥

PR Preview failed to build. (Last tried on Jul 19, 2021, 1:10 PM UTC).

More

PR Preview relies on a number of web services to run. There seems to be an issue with the following one:

🚨 CSS Spec Preprocessor - CSS Spec Preprocessor is the web service used to build Bikeshed specs.

🔗 Related URL

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at 
 [no address given] to inform them of the time this error occurred,
 and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.4.10 (Debian) Server at api.csswg.org Port 443</address>
</body></html>

If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.

@Kangz

Kangz commented Jul 20, 2021

Copy link
Copy Markdown
Contributor Author

Was this discussed at the editor's meeting?

@toji

toji commented Jul 20, 2021

Copy link
Copy Markdown
Member

We didn't have time to discuss it this week.

@kvark

kvark commented Jul 20, 2021

Copy link
Copy Markdown
Contributor

The concern about SHADER_READ is valid. Let's see if we can find a better name for it.
First of all, I find SAMPLED to not be a good choice - #1785

Maybe we can follow D3D12 closer (which is where we get the restriction from about no sampling from integer textures) and calls it SHADER_RESOURCE?

@Kangz

Kangz commented Jul 21, 2021

Copy link
Copy Markdown
Contributor Author

SHADER_RESOURCE works although it is a bit misleading as well since storage textures are also resources. I don't think there's an ideal solution that's also short, so any of the 3 sgtm.

@kainino0x

Copy link
Copy Markdown
Contributor

Would it be valid to say that a "sample" operation is comprised of 1-8 "fetch" operations + filtering? Then could we call it something like FETCH?

In that case it would probably also be beneficial to use matching terminology in WGSL and change textureLoad to textureFetch/texelFetch (like GLSL, despite HLSL's texture.Load() and MSL's texture.read()).

@Kangz

Kangz commented Jul 22, 2021

Copy link
Copy Markdown
Contributor Author

SHADER_FETCH is a good solution too imho

@kainino0x

kainino0x commented Jul 23, 2021 •

Copy link
Copy Markdown
Contributor

Ideas from a chat between me and @kvark:

  • TEXTURE_BINDING and STORAGE_BINDING (kvark's idea to name it after the binding instead of the shader operations)
    • "Usage" wording is consistent:
      • "Use it as a COPY SOURCE"
      • "Use it as a RENDER ATTACHMENT"
      • "Use it as a TEXTURE BINDING" (GPUTextureBindingLayout)
      • "Use it as a STORAGE BINDING" (GPUStorageTextureBindingLayout)
  • SHADER_READ and SHADER_STORAGE
    • Presents "READ" and "STORAGE" as contrasting options so it looks less like you need SHADER_READ | STORAGE.

I think we both like the first option quite a bit. (We had half a mind to try to make the buffer usages to fit the pattern as well, but there isn't really any ambiguity there right now, and the buffer usages are a lot more diverse so it's harder.)

@Kangz

Kangz commented Jul 25, 2021

Copy link
Copy Markdown
Contributor Author

That's pretty good. Let's talk about it in the meeting anyway since the agenda is already out, but I hope we can settle it quickly.

@kainino0x

kainino0x commented Jul 26, 2021 •

Copy link
Copy Markdown
Contributor

Resolution: "*_BINDING is winning by half-votes across the board :)"

@kvark kvark self-assigned this Jul 26, 2021
@kvark kvark closed this in #1989 Jul 26, 2021
@Kangz
Kangz deleted the sampled branch March 25, 2022 14:22
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

Successfully merging this pull request may close these issues.

4 participants