guycalledfrank / bakery-issues

Bug tracker for Bakery
4 stars 0 forks source link

Vertex SH Disabled on non-D3D11 platforms unnecessarily #128

Closed ptbarnaby closed 2 years ago

ptbarnaby commented 2 years ago

This code disables BAKERY_VERTEXLMSH even on hardware that supports it (such as Quest 2):

// can't fit vertexLM SH to sm3_0 interpolators
#ifndef SHADER_API_D3D11
    #undef BAKERY_VERTEXLMSH
#endif

By removing the undef allows vertex SH to work on Quest 2. Perhaps the conditional should be changed to something like this:

#if SHADER_TARGET < 35

guycalledfrank commented 2 years ago

Thanks for noticing! "SHADER_TARGET < 35" won't work though, as technically standard/Bakery shaders are targeted for 3.0, but Unity will still use the GAPI-defined interpolator limit while compiling. Thus "3.0" under dx9/dx11 seems to compile differently.

It looks like GLES3 and Metal should be OK with >8 interpolators... and I bet PS4/XBOne are OK with it too.

Replaced it with

#if defined(SHADER_API_GLCORE) || defined(SHADER_API_GLES) || defined(SHADER_API_D3D11_9X)

https://github.com/guycalledfrank/bakery-csharp/commit/da591f5cc99199b5bdcbfcebd7925824fdf4aa59