Skip to content
Snippets Groups Projects
Commit 87ccba7d authored by Niklas Haas's avatar Niklas Haas
Browse files

shaders/sampling: allow taking the sampler2D as an argument

Requested by VLC, which wants to abstract the texture binding and
coordinates (vertex attribute) away from the actual shader doing the
scaling.

This requires adding a new type of shader signature,
PL_SHADER_SIG_SAMPLER2D, and also extending pl_sample_src to allow
specifying samplers in this way.

The main glaring note here is that I realized the compute shader does
some hacks w.r.t the texture coordinate which does not actually work
in a general sense, since it relies on the mapping logic being performed
by the pl_dispatch. That being said, it's not entirely clear how vertex
attributes should work at all for compute shaders like this.

It's entirely possible we may need to work around this either by having
the thread 0 in the work group broadcast its position to the rest of
the work group (instead of abusing tex_map), or alternatively, we could
maybe move some of the pl_dispatch simulation code from the dispatch
mechanism to the actual shader binding mechanism, so that generated
compute shaders won't have vertex attributes to begin with.
parent a41981fa
No related branches found
No related tags found
1 merge request!91shaders/sampling: allow taking the sampler2D as an argument
Pipeline #17752 passed with stages
in 7 minutes and 15 seconds
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment