Skip to content

gallium: kill `PIPE_CAP_SM3`

Erik Faye-Lund requested to merge kusma/mesa:kill-pipe-cap-sm3 into master

Every time I stumble over PIPE_CAP_SM3, I get a bit depressed. This cap is different than most caps in Gallium, as it's much broader, and I need to read up a lot to try to figure out anything specific about what it does. Shader Model 3.0 is a big feature-set.

It seems I'm not the only one who feels this way, because of the comment in screen.rst, saying "XXX oh god this is horrible".

But there's some more direct issues lurking as well: Some mobile GPUs can support some, but not all of the SM3 features. For instance, Mali-400 supports OES_standard_derivatives but not FP32 precision (which is a SM3 requirement). So when it's time for the Lima driver to implement OES_standard_derivatives, something needs to be done anyway.

So, here's patches that turns PIPE_CAP_SM3 into PIPE_CAP_FRAGMENT_SHADER_TEXTURE_LOD, PIPE_CAP_FRAGMENT_SHADER_DERIVATIVES and PIPE_CAP_VERTEX_SHADER_SATURATE, which is what we care about anyway.

As I don't know much about the hardware capabilities of the various drivers, I've just kept functionality as it is for now. I can imagine some drivers might want to benefit from this already. For instance, some drivers might be able to enable PIPE_CAP_VERTEX_SHADER_SATURATE without enabling the rest. But for now, I leave that up to follow-up patches.

Merge request reports