Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
dlls/wined3d/shader.c | 21 +++------------------
1 file changed, 3 insertions(+), 18 deletions(-)
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 438af50d8410..9524757470eb 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -3699,6 +3699,9 @@ static HRESULT shader_init(struct wined3d_shader *shader, struct wined3d_device
TRACE("byte_code %p, byte_code_size %#lx, format %#x.\n",
desc->byte_code, (long)desc->byte_code_size, desc->format);
+ if (!desc->byte_code)
+ return WINED3DERR_INVALIDCALL;
+
if (!(shader->frontend = shader_select_frontend(desc->format)))
{
FIXME("Unable to find frontend for shader.\n");
@@ -4251,9 +4254,6 @@ HRESULT CDECL wined3d_shader_create_cs(struct wined3d_device *device, const stru
TRACE("device %p, desc %p, parent %p, parent_ops %p, shader %p.\n",
device, desc, parent, parent_ops, shader);
- if (!desc->byte_code)
- return WINED3DERR_INVALIDCALL;
-
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
@@ -4288,9 +4288,6 @@ HRESULT CDECL wined3d_shader_create_ds(struct wined3d_device *device, const stru
TRACE("device %p, desc %p, parent %p, parent_ops %p, shader %p.\n",
device, desc, parent, parent_ops, shader);
- if (!desc->byte_code)
- return WINED3DERR_INVALIDCALL;
-
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
@@ -4326,9 +4323,6 @@ HRESULT CDECL wined3d_shader_create_gs(struct wined3d_device *device, const stru
TRACE("device %p, desc %p, so_desc %p, parent %p, parent_ops %p, shader %p.\n",
device, desc, so_desc, parent, parent_ops, shader);
- if (!desc->byte_code)
- return WINED3DERR_INVALIDCALL;
-
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
@@ -4356,9 +4350,6 @@ HRESULT CDECL wined3d_shader_create_hs(struct wined3d_device *device, const stru
TRACE("device %p, desc %p, parent %p, parent_ops %p, shader %p.\n",
device, desc, parent, parent_ops, shader);
- if (!desc->byte_code)
- return WINED3DERR_INVALIDCALL;
-
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
@@ -4393,9 +4384,6 @@ HRESULT CDECL wined3d_shader_create_ps(struct wined3d_device *device, const stru
TRACE("device %p, desc %p, parent %p, parent_ops %p, shader %p.\n",
device, desc, parent, parent_ops, shader);
- if (!desc->byte_code)
- return WINED3DERR_INVALIDCALL;
-
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
@@ -4423,9 +4411,6 @@ HRESULT CDECL wined3d_shader_create_vs(struct wined3d_device *device, const stru
TRACE("device %p, desc %p, parent %p, parent_ops %p, shader %p.\n",
device, desc, parent, parent_ops, shader);
- if (!desc->byte_code)
- return WINED3DERR_INVALIDCALL;
-
if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY;
--
2.16.4