FransBouma / ShaderToggler

Reshade 5+ addin to toggle shaders on/off in groups based on a key press. It allows you to configure these groups from within the addin as well.
MIT License
100 stars 28 forks source link

createComputePipelineState failed with E_INVALIDARG #26

Open artshade opened 1 week ago

artshade commented 1 week ago

Greetings! ✨

Thank you very much for the so awesome project!


May I ask regarding the following issue encountered?

I've just installed ReShade for Need For Speed: Unbound. In the result, launching of the title results in a crash with the error shown as in the preview attached (E_INVALIDARG ("An invalid parameter was passed to the returning function.")) during function execution createComputePipelineState.

image


The steps followed to install ReShade were:

  1. Download the latest installer version (v6.3.1) of ReShade with add-on support from the official resource;
  2. While installing, chose the location of the NeedForSpeedUnbound.exe (inside \Steam\steamapps\common\Excalibur\);
  3. Selected Direct 11/12 as the renderer;
  4. Selected all the shaders to download;
  5. Selected 2 add-on to install: ShaderToggler and ReshadeEffectShaderToggler.

Here, launching results in the crash mentioned.


With either the addon file ShaderToggler.addon64 or ReshadeEffectShaderToggler.addon64 located in the title directory and title re-laucnh, the error is shown.

With both addon files removal from the title directory and title re-launch, no error appears.

Please correct if mistaken, considering the error, is it possible the ReShade add-on is not compatible with the current driver in use where the function parameters does not match the function declaration?


What might it be or how would you try debugging the case case to find the root cause?

Best and kind regards 🪐

artshade commented 1 week ago

I got a suggestion in the Discord guild of the creator of mod Camera Toolkit for Need for Speed: Unbound. There was a member (@mik_sharov) who had no issues with both ReShade and the ShaderToggler add-on, and the latest video-game title installed, and they suggested to try out the same ReShade version as they have - 5.8.0, and it worked! I've modified ReShade using the older installer, re-launched the title, terminated, added a single add-on file ShaderToggler.addon64 of its latest version, launched again, and voila - few shaders could not compile, but there's no error, and the add-on is working like a charm! Freaking marvelous...

Into the light may you fall Into the light may you follow Into the light may you know ~ Words Darker Than Their Wings - Alter Bridge

FransBouma commented 1 week ago

Strange, considering I use the latest reshade with shadertoggler all the time and no issues...

artshade commented 1 week ago

Strange, considering I use the latest reshade with shadertoggler all the time and no issues...

Thank you for the response! Could it be the driver where ReShade behaves differently (e.g. changes the function declaration)?

FransBouma commented 1 week ago

Honestly, no idea...

artshade commented 1 week ago

Honestly, no idea...

I haven't found any historical difference, too, for function in Nvidia driver changelogs and the repo as of now, except the following:

- Commit 2024-08-13T23:07:06.000Z - Commit 2023-12-21T02:03:34.000Z


There's also a chance it's something related to the driver. I've found at least several mentions regarding it, but those are fairly dated:

I fixed this, I uninstalled NVIDIA latest drivers (516.59v 06/28/2022) and installed previous version of drivers (516.40v 06/15/2022) Source

...a DDU with my network disabled fixed it Source

Updating driver worked. Source


Interesting that the NvAPI function declaration differs from DirectX 12 it seems:

HRESULT CreateComputePipelineState(
  [in]  const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc,
        REFIID                                  riid,
  [out] void                                    **ppPipelineState
);

Source

NVAPI_INTERFACE NvAPI_D3D12_CreateComputePipelineState (
    __in ID3D12Device *                                 pDevice,
    __in const D3D12_COMPUTE_PIPELINE_STATE_DESC *      pPSODesc,
    NvU32                                           numExtensions,
    __in const NVAPI_D3D12_PSO_EXTENSION_DESC **        ppExtensions,
    __out ID3D12PipelineState **                        ppPSO 
)   

Source

Related: There are various other NVIDIA-specific pipeline state extensions that...