From fe37647c8475a45d8fb1c3e20360be63e0adc21d Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Tue, 17 May 2022 17:26:13 +0200 Subject: [PATCH] (D3D11) d3d11_init_shader - simplify some code --- gfx/common/d3d11_common.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gfx/common/d3d11_common.c b/gfx/common/d3d11_common.c index 7ac5817f51..fcdbfc55d4 100644 --- a/gfx/common/d3d11_common.c +++ b/gfx/common/d3d11_common.c @@ -282,11 +282,6 @@ bool d3d11_init_shader( success = false; } - if (vs_code) - device->lpVtbl->CreateVertexShader( - device, D3DGetBufferPointer(vs_code), D3DGetBufferSize(vs_code), - NULL, &out->vs); - if (ps_code) device->lpVtbl->CreatePixelShader( device, D3DGetBufferPointer(ps_code), D3DGetBufferSize(ps_code), @@ -297,10 +292,15 @@ bool d3d11_init_shader( device, D3DGetBufferPointer(gs_code), D3DGetBufferSize(gs_code), NULL, &out->gs); - if (vs_code && input_element_descs) - device->lpVtbl->CreateInputLayout( - device, input_element_descs, num_elements, D3DGetBufferPointer(vs_code), - D3DGetBufferSize(vs_code), &out->layout); + if (vs_code) + { + LPVOID buf_ptr = D3DGetBufferPointer(vs_code); + SIZE_T buf_size = D3DGetBufferSize(vs_code); + device->lpVtbl->CreateVertexShader(device, buf_ptr, buf_size, NULL, &out->vs); + if (input_element_descs) + device->lpVtbl->CreateInputLayout(device, input_element_descs, num_elements, + buf_ptr, buf_size, &out->layout); + } Release(vs_code); Release(ps_code);