internal/graphicsdriver/directx: do not cache a vertex shader when an error occurs

This commit is contained in:
Hajime Hoshi 2022-12-25 04:27:15 +09:00
parent dd7e125d9c
commit 8b588587cc

View File

@ -404,7 +404,9 @@ func newShader(vs, ps string) (vsh, psh *_ID3DBlob, ferr error) {
vsh = v
} else {
defer func() {
vertexShaderCache[vs] = vsh
if ferr == nil {
vertexShaderCache[vs] = vsh
}
}()
wg.Go(func() error {
v, err := _D3DCompile([]byte(vs), "shader", nil, nil, "VSMain", "vs_5_0", flag, 0)