Skip to content

gpu: disentangle texture filters from pl_tex

Niklas Haas requested to merge sampler_refactor_v3 into master

Merging the texture filter with the pl_tex object itself is a left-over from the mpv RA days. While it involves a different set of tradeoffs, I think it's far better overall to have this concept separate from the texture, simply because it allows the shaders to pick their preferred sample mode dynamically (improving performance in many cases), and in general reduces the burden on the provider of the textures (i.e. the user) to set this up.

In addition to splitting this from the pl_tex, we move it to pl_desc_binding, where it can be changed at runtime. We do something similar with the access field, which didn't really have a solid reason to be static in the first place. Not that it would make much sense to configure it dynamically at runtime, but whatever. Anyway, this is now grouped into the new binding field of pl_shader_desc, which is also where the sampler attributes live.

Deprecate all the old fields rather than removing them outright, to hopefully cut down on the amount of frustration this change will cause. The pl_tex_blit function got params-ified en passant, though, which is probably the most breaking change amidst this sea of breaking changes.

Merge request reports

Loading