Skip to content

fix(d3d): add HRESULT checking to Create::Shader#2237

Merged
alandtse merged 2 commits into
devfrom
copilot/fix-add-hresult-checking-to-shader-calls
Apr 30, 2026
Merged

fix(d3d): add HRESULT checking to Create::Shader#2237
alandtse merged 2 commits into
devfrom
copilot/fix-add-hresult-checking-to-shader-calls

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

CreatePixelShader, CreateVertexShader, CreateHullShader, and CreateDomainShader in CompileShader had no error checking — failures silently returned null/invalid shader pointers to callers. CreateComputeShader already used DX::ThrowIfFailed correctly.

Changes

  • src/Utils/D3D.cpp: Wrap all four unchecked Create*Shader calls with DX::ThrowIfFailed, matching the existing compute shader pattern:
// Before
device->CreatePixelShader(shaderBlob->GetBufferPointer(), shaderBlob->GetBufferSize(), nullptr, &regShader);

// After
DX::ThrowIfFailed(device->CreatePixelShader(shaderBlob->GetBufferPointer(), shaderBlob->GetBufferSize(), nullptr, &regShader));

Applied consistently to ps_5_0, vs_5_0, hs_5_0, and ds_5_0 paths.

Copilot AI changed the title [WIP] Fix add HRESULT checking to Create*Shader calls in CompileShader fix(d3d): add HRESULT checking to Create*Shader calls in CompileShader Apr 30, 2026
Copilot AI requested a review from alandtse April 30, 2026 02:19
@github-actions
Copy link
Copy Markdown

No actionable suggestions for changed features.

@alandtse alandtse marked this pull request as ready for review April 30, 2026 02:32
@github-actions
Copy link
Copy Markdown

✅ A pre-release build is available for this PR:
Download

@alandtse alandtse changed the title fix(d3d): add HRESULT checking to Create*Shader calls in CompileShader fix(d3d): add HRESULT checking to Create::Shader Apr 30, 2026
@alandtse alandtse merged commit 5be2b36 into dev Apr 30, 2026
25 checks passed
ParticleTroned pushed a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request May 2, 2026
)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: alandtse <7086117+alandtse@users.noreply.github.com>
(cherry picked from commit 5be2b36)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants