microsoft / DirectXTK12

The DirectX Tool Kit (aka DirectXTK12) is a collection of helper classes for writing DirectX 12 code in C++
https://walbourn.github.io/directx-tool-kit-for-directx-12/
MIT License
1.47k stars 393 forks source link

Removed SkinnedEffect weightsPerVertex parameter #79

Closed walbourn closed 4 years ago

walbourn commented 4 years ago

When SkinnedEffect was first moved over to DX12, the "1, 2, or 4 weight per vertex" optimization was kept. In practice, since you need a new effect instance for each PSO to have different weights-per-vertex, this isn't really practical to use. Also with Feature Level 11.0 minimum hardware there's not much value in saving a little ALU performance.

This removes 8 shaders from the project.

Minor breaking change if someone uses the defaulted parameter:

SkinnedEffect(_In_ ID3D12Device* device, uint32_t effectFlags, const EffectPipelineStateDescription& pipelineDescription,
   int weightsPerVertex = 4);

is now:

SkinnedEffect(_In_ ID3D12Device* device, uint32_t effectFlags, const EffectPipelineStateDescription& pipelineDescription);
walbourn commented 4 years ago

I'm not making this change in the DirectX Tool Kit for DX 11. There it makes more sense to be able to flip between shaders and it can be a good optimization for low-end 9.x level parts.