Rust-GPU / Rust-GPU/rust-gpu

[Migrated] Emulate Image/Sampler API operations on non-SPIRV platforms

Offen
#84 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Rust
Sterne
3.4k
Forks
125
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Issue automatically imported from old repo: https://github.com/EmbarkStudios/rust-gpu/issues/1065
Old labels: t: enhancement
Originally creatd by Keavon on 2023-05-26T16:12:52Z 👍: 4 ❤️: 2


While the GPU provides hardware for texture sampling and interpolation, on other targets (i.e. CPU in general) it's necessary to emulate that. Currently, the Image and Sampler APIs don't provide texture sampling operations when compiling to non-SPIRV targets.

We need this for an issue on Graphite to support image transformation with graceful CPU fallback (even if the performance would be not ideal), since WebGPU is only available on Chromium browsers for now and thus CPU is still an important target. Having this feature be as performant as possible would be eventually nice, but a slower solution would be a reasonable starting point of greater priority to our use case (something is better than nothing, existing is better than fast).

This issue was discussed in the Embark Discord.

Also on Discord before filing this issue, @eddyb summarized some recollection of the potential main three main concerns involved:

how to feed data into the API, how the API stores the data internally, and how the sampling is implemented - with the middle one, with its potential need to add lifetimes, and/or remove Copy & use Arc, being the worst part, since at least unoptimized sampling is mostly "just" looking up 4 texels and interpolating them

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die Image- und Sampler-APIs sowie ihre Nicht-SPIR-V-Kompilierungspfade zu finden. Verfolge, wie Texturdaten bereitgestellt und gespeichert werden, und ermittle anschließend das für CPU- und andere Nicht-SPIR-V-Ziele erforderliche Sampling-Verhalten; abgeschlossen ist die Aufgabe, wenn diese APIs Textur-Sampling und Interpolation außerhalb von SPIR-V ermöglichen und dabei das bestehende GPU-Verhalten erhalten bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
computer-graphics
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.