internal/graphicsdriver/directx: refactoring

This commit is contained in:
Hajime Hoshi 2022-12-24 18:05:47 +09:00
parent fda0b1cbcb
commit 8e1bd4eaba

View File

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