ChanServ changed the topic of #wayland to: https://wayland.freedesktop.org | Discussion about the Wayland protocol and its implementations, plus libinput
coldfeet has quit [Remote host closed the connection]
coldfeet has joined #wayland
coldfeet has quit [Quit: Lost terminal]
leon-anavi has joined #wayland
rasterman has joined #wayland
mclasen has quit [Ping timeout: 480 seconds]
glennk has joined #wayland
glennk has quit [Remote host closed the connection]
tzimmermann has joined #wayland
kts has joined #wayland
garnacho has joined #wayland
<pq>
King_DuckZ, probably best to use a solid-color surface. No need to mess with the shaders.
<pq>
King_DuckZ, well, I cannot guess what kind of chroma-keying, and would be showing through and how, so hard to say.
<pq>
*and what would be
kts has quit [Ping timeout: 480 seconds]
tanty has quit [Ping timeout: 480 seconds]
luna has quit []
privacy has joined #wayland
kts has joined #wayland
<King_DuckZ>
pq: I'm trying to figure myself, but as I understand I get a frame from a video stream and a colour threshold and need to get rid of any pixels beyond that threshold, there's a requirement to do it on gpu and to show "what's behind" after chroma-keying, whatever that means
<King_DuckZ>
soreau: thanks
<pq>
King_DuckZ, wait, so you need to emulate chroma-keying with shaders, and not use the chroma-keying hardware of a display controller?
<King_DuckZ>
pq: yeah because *I think* the hardware one has certain limitations that won't work in our case
<pq>
oh, then forget what I said
* King_DuckZ
presses the forget button
<pq>
If that needs to be off-loaded to the compositor, then shaders it is: if (color threshold) color = vec4(0, 0, 0, 0); or maybe even discard;
<King_DuckZ>
yep, just wondering how to inject that into the compositor's default shader, soreau suggested I try wayfire, I'll be looking into that if weston can't do it out of the box
kts has quit [Ping timeout: 480 seconds]
<daniels>
King_DuckZ: libweston/renderer-gl/fragment.glsl is the shader source
<daniels>
you'll want to also make pixel_format_is_opaque() inside libweston/pixel-formats.c return false for any format you're planning to apply this to
emilioslowACLsurgery[m] is now known as emilio[m]
KDDLB3 has quit [Read error: Connection reset by peer]
kode543 has joined #wayland
kode54 has quit [Read error: No route to host]
<pq>
King_DuckZ, you need a new field in struct gl_shader_requirements for turning the chroma-keying on/off.
<pq>
King_DuckZ, is this something for downstream only, or do you hope to upstream this?
rasterman has quit [Quit: Gettin' stinky!]
<pq>
King_DuckZ, Weston has no "default" shader. There is one shader source file, which gets compiled many times with different #defines. Those #defines come from struct gl_shader_requirements.
<soreau>
but instead of mucking about with the default shader, you can apply your own fullscreen shader with a plugin like this https://github.com/soreau/filters
<soreau>
this plugin allows applying a shader to the entire output, or a single surface
<soreau>
(directly from a shader file, not compiled upfront)
<soreau>
plus, I think you can install latest releases of wayfire and wayfire-plugins-extra, and keycolor will be ready OOTB
<soreau>
oh, I am wrong about the operation: it takes a color + threshold but only affects the alpha output, not the color
<soreau>
so filters plugin would probably be better but it requires latest wayfire git
narodnik has quit [Quit: WeeChat 4.3.1]
narodnik has joined #wayland
<soreau>
but for the simple purposes of just revealing the hidden message/video, keycolor still might work
vincejv has joined #wayland
kts has quit [Read error: Connection reset by peer]
fmuellner has joined #wayland
Brainium has joined #wayland
Brainium has quit []
tanty has joined #wayland
mclasen has quit [Ping timeout: 480 seconds]
<King_DuckZ>
soreau: thanks, unfortunately from asking around it seems I'll have a hard time getting wayfire approved as a new dependency, which is a shame because I think that mpv idea is exactly what's required
<King_DuckZ>
I think there will be two videos playing, the one at the front will have this chroma key applied and it will be overlayed on top of the "background" video
mclasen has joined #wayland
<pq>
King_DuckZ, and the top video cannot come with an alpha channel to begin with?
<King_DuckZ>
pq: top video is a regular mp4, I *think* I can access the shader in mpv while it gets played back, I'm just not clear how that shader will interact with weston's, if at all
systwi has quit [Ping timeout: 480 seconds]
<pq>
it cannot interact per se, they are different processes
<pq>
but if it changes the pixels that go into the buffer that weston gets, then yeah
<King_DuckZ>
I mean, say my frag shader in mpv outputs (1, 0, 0, 0), does that get rendered to black immediately (because a=0) or does it magically go through weston's shader first?
<pq>
in weston, everything goes through weston's shaders, or the equivalent
<King_DuckZ>
interesting, thanks for clarifying that!
<pq>
I have a hard time imagining how it wouldn't. :-)
<King_DuckZ>
so I think the answer is yes, I can set an alpha channel
<pq>
cool, then you don't need to hack Weston or any other compositor
<JEEB>
pq: magical passthrough somehow? but yea, not weston :)
<King_DuckZ>
idk, I might be stuck in DirectDraw's days, but to me the graphics library is something that completely "takes over" the video card
<King_DuckZ>
cool indeed
<pq>
weston has passthrough, however it also ensures to use it only if it is equivalent (enough) to the shaders
<JEEB>
drm interfaces can override other things on screen
<JEEB>
something similar to ye olde overlay in dshow
<pq>
yeah, except apps won't get access to them
<pq>
unless is some vendor-butchered downstream kernel, anyway
<pq>
*in
Brainium has joined #wayland
<King_DuckZ>
ok, well that's not my case as far as I know
<King_DuckZ>
so just having two mpv's playing, with the front one doing the chroma stuff, should just work
<pq>
There is no "taking over the video card" in the Wayland architecture by design.
<pq>
hardware is fast enough to get stuff on screen without needing to cut corners
<pq>
everything has exceptional cases though, like drm-leasing can give a whole output to an app, or a set-top box may want to push 4k video while its GPU cannot even copy so many pixels.
systwi has joined #wayland
<pq>
none of that is reason enough to cut corners, though
<King_DuckZ>
yeah it's embedded stuff, but I think it's high power enough, and either way if we want to apply some effects, there's no other way than spending the cpu/gpu time to do so
<pq>
yes - unless your display controller could do it
<pq>
the not-GPU part
kts has joined #wayland
<King_DuckZ>
it doesn't, at least that's the premise I was given when they handed this over to me
<pq>
alright
<pq>
then it should be architecturally "easy"
<King_DuckZ>
I tried asking about wayfire btw, they flat-out rejected adding new packages :| no wiggle room there
<pq>
Things get complicated, when one wants to off-load things to the display controller in order to not use the GPU, which means the stuff must be off-loaded to the compositor first, and that takes protocol extensions.
mclasen has quit [Quit: mclasen]
mclasen has joined #wayland
<soreau>
well, in the case of wayfire filters plugin at least, the shaders and other 'commands' are side loaded through a separate ipc socket, kinda like sway has
<soreau>
for the shaders, it just gives an absolute path to the shader
<soreau>
King_DuckZ: but it sounds like your task has you painted in a corner
kts has quit [Ping timeout: 480 seconds]
mvlad has joined #wayland
kts has joined #wayland
coldfeet has joined #wayland
kts has quit [Ping timeout: 480 seconds]
privacy has quit [Quit: Leaving]
nerdopolis has joined #wayland
kts has joined #wayland
kts has quit []
kts has joined #wayland
cool110 has joined #wayland
cool110 is now known as Guest9501
Guest9431 has quit [Ping timeout: 480 seconds]
Kerr has joined #wayland
cvmn has quit [Remote host closed the connection]
caveman has joined #wayland
rv1sr has quit []
Guest9501 has quit [Ping timeout: 480 seconds]
cool110_ has joined #wayland
cool110_ is now known as Guest9505
___nick___ has joined #wayland
mclasen has quit [Ping timeout: 480 seconds]
tzimmermann has quit [Quit: Leaving]
kasper93_ has quit [Remote host closed the connection]
Brainium has quit [Quit: Konversation terminated!]
nerdopolis has joined #wayland
KarenTheDorf has quit [Remote host closed the connection]
mclasen has joined #wayland
<sewn>
why does every wayland application seem to have it's own way of doing wl_buffer creation? (eg. shm_open randomized seen in wayland book, memfd_buffer, mkostemp, and the list goes on)
<sewn>
it seems to be in EVERY wayland application that wants to make a non-compositor surface, shouldn't it be provided by wayland?
<vyivel>
sewn: shm buffers aren't the only type of buffers
<bl4ckb0ne>
and there's different ways to open a shm
leon-anavi has quit [Quit: Leaving]
kts has quit [Quit: Konversation terminated!]
Brainium has joined #wayland
bindu has joined #wayland
bindu_ has quit [Ping timeout: 480 seconds]
KarenTheDorf has joined #wayland
<sewn>
bl4ckb0ne: its almost always the same for most platforms, just needs proper compiler checks and its crossplatform just like that
<sewn>
most applications have to do these things themselves
rv1sr has joined #wayland
<ids1024_>
sewn: I believe the correct way to do it is generally memfd_create on modern Linux and FreeBSD, and shm_open/shm_unlink with a random name on an OS that doesn't support it. But that can be a bit verbose for an example.
<sewn>
ids1024_: this makes sense, but i still don't get the reasoning for most wayland applications having to do the same shm or buffer creation for every codebase
cool110 has joined #wayland
cool110 is now known as Guest9526
<ids1024_>
Most applications aren't using Wayland directly anyway. They're using a toolkit.
<sewn>
right, and each toolkit has to do the same thing their own way
<sewn>
when it's all similar and to achieve the same task
<kennylevinsen>
sewn: 1. It’s pretty simple so eh, 2. The Wayland protocol is not limited to one way to do it (what about dmabufs?), 3. libwayland is not that kind of utility lib - that’s what toolkits are