internal/graphicsdriver/directx: add the original source at D3DCompile errors

This commit is contained in:
Hajime Hoshi 2022-07-09 01:59:51 +09:00
parent 9136d0cfd8
commit 3d5031571d

View File

@ -558,7 +558,7 @@ func newShader(source []byte, defs []_D3D_SHADER_MACRO) (vsh, psh *_ID3DBlob, fe
// Create a shader
v, err := _D3DCompile(source, "shader", defs, nil, "VSMain", "vs_5_0", 0, 0)
if err != nil {
return nil, nil, err
return nil, nil, fmt.Errorf("directx: D3DCompile for VSMain failed, original source: %s, %w", string(source), err)
}
defer func() {
if ferr != nil {
@ -568,7 +568,7 @@ func newShader(source []byte, defs []_D3D_SHADER_MACRO) (vsh, psh *_ID3DBlob, fe
p, err := _D3DCompile(source, "shader", defs, nil, "PSMain", "ps_5_0", 0, 0)
if err != nil {
return nil, nil, err
return nil, nil, fmt.Errorf("directx: D3DCompile for PSMain failed, original source: %s, %w", string(source), err)
}
defer func() {
if ferr != nil {