Git Product home page Git Product logo

Comments (5)

jimblandy avatar jimblandy commented on June 2, 2024

Firefox has had some long-term hopes of actually never producing RGBA data from video decoders, software or otherwise, and producing only NV12-ish formats, which would allow us to simplify our external texture support. If the WebGPU specification were to allow content to pass ordinary GPUTextures to shaders operating on texture_externals, then we would have to support RGBA external textures in perpetuity.

So it depends on how excited people are about binding non-external texture views to texture_external variables:

  • If people are really excited, then it's a valuable feature to the audience, and we should spec it as yet another helpful thing.

  • If it's just a "nice to have, and it's free" feature, then we should not provide it, as it does prevent simplifications we were hoping to pursue at some point in the future.

("Is this a cute bracelet, or an annoying handcuff?")

from gpuweb.

Kangz avatar Kangz commented on June 2, 2024

I'm surprised that Firefox would want to make video frames always NV12 (even though for most hardware or actual video thing it is much preferred) because it is supportive of WebCodecs and the VideoFrame constructor can take things that are RGB(A) data.

This is more than a pure nice to have feature because we have some folks working on video processing pipelines that introduced a copyExternalImageToTexture to convert a VideoFrame to a GPUTexture because it was more architecturally tractable to have texture_2d<f32> everywhere instead of dynamically generating that or a texture_external. So now they have a 1-copy path instead of a 0-copy. If they could use texture_external everywhere by feeding a GPUTexture in the binding, they would easily get to 0-copy.

from gpuweb.

kdashg avatar kdashg commented on June 2, 2024
GPU Web 2024-03-06 Pacific-time
  • KG: concern that this constrains our implementation of external textures. Had some positive signals from our media team that it might be possible that all video formats are 2-plane NV12 style formats. In that case, tempting to implement this to support this. But if external textures support canvases, would want them 4-channel, 1-plane textures.
  • KN: [external texture from canvas] has been discussed, but not proven that it was needed. And it's a bunch of work to implement.
  • KG: if we had that, would be easier for us to agree to this - it wouldn't constrain us, because we'd already have the constraint.
  • KN: Corentin points out that VideoFrame can be constructed from RGBA data as well.
  • KG: would receive that as bytes.
  • KG: spooky to me - crosses concerns, hard to know it'd be sound going into the future.
  • KG: this is an area where impl experience is needed. PR welcome adding this to the draft spec. Chromium can then implement behind a flag.
  • KG: What if we could create an externalTexture from a texture-view, rather than allowing binding either an ExternalTexture or a TextureView? Just wrap a TextureView in an ExternalTexture and bind that.
  • KN: small hesitation that it sounds like it accepts GPUTexture from another GPUDevice (since it’s “external”), but this would not be allowed. Otherwise seems fine.

from gpuweb.

kdashg avatar kdashg commented on June 2, 2024

Sure! Ok I didn't realize that videocodec accepted those, so that forces us to handle it, so we're ok with this I think.

from gpuweb.

Kangz avatar Kangz commented on June 2, 2024
GPU Web CG 2024-03-13 Atlantic-time
  • KG: yes, didn't realize video codecs can give you coplanar data. Given this, this sounds fine.
  • CW?: Question then, do we allow creating ExternalTexture from such a textureview, or just allow putting such textureviews in the bindgroup.
  • JB: may as well just allow binding GPUTexture to an external texture in createBindGroup?
  • KG: [weakly would prefer to create ExternalTextures in order to reuse semantics. We’ll discuss more]
  • CW: let's discuss offline.

from gpuweb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.