ITADN

fix(d3d): add HRESULT checking to Create*Shader calls in CompileShader

#2236Opencoderabbitai[bot] 创建于 2026-04-30
help wanted
## Summary In `src/Utils/D3D.cpp`, the `CompileShader` function creates shaders via `ID3D11Device::CreatePixelShader`, `CreateVertexShader`, `CreateHullShader`, and `CreateDomainShader` without checking the returned HRESULT. This can result in invalid/null shader pointers being returned to callers with no indication of failure. The Compute shader paths already correctly use `DX::ThrowIfFailed`: - `CreateComputeShader` (cs_5_0, cs_4_0) The following four paths do **not** check HRESULT: - `CreatePixelShader` (ps_5_0) - `CreateVertexShader` (vs_5_0) - `CreateHullShader` (hs_5_0) - `CreateDomainShader` (ds_5_0) ## Suggested Fix Wrap each of the four unchecked `Create*Shader` calls with `DX::ThrowIfFailed` to match the existing pattern used for compute shaders. ## Context Identified during review of PR #2234 (https://github.com/doodlum/skyrim-community-shaders/pull/2234#discussion_r3165198474). Requested by: @alandtse
0 条评论