Commit 42a37836 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Set load_local_constsF in shader_init().

parent a44cdbfd
...@@ -744,7 +744,7 @@ static void shader_glsl_load_constants_f(const struct wined3d_shader *shader, co ...@@ -744,7 +744,7 @@ static void shader_glsl_load_constants_f(const struct wined3d_shader *shader, co
if (!shader->load_local_constsF) if (!shader->load_local_constsF)
{ {
TRACE("No need to load local float constants for this shader\n"); TRACE("No need to load local float constants for this shader.\n");
return; return;
} }
......
...@@ -2704,8 +2704,7 @@ static HRESULT shader_set_function(struct wined3d_shader *shader, const DWORD *b ...@@ -2704,8 +2704,7 @@ static HRESULT shader_set_function(struct wined3d_shader *shader, const DWORD *b
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
} }
shader->function = HeapAlloc(GetProcessHeap(), 0, shader->functionLength); if (!(shader->function = HeapAlloc(GetProcessHeap(), 0, shader->functionLength)))
if (!shader->function)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
memcpy(shader->function, byte_code, shader->functionLength); memcpy(shader->function, byte_code, shader->functionLength);
...@@ -2969,6 +2968,8 @@ static HRESULT shader_init(struct wined3d_shader *shader, struct wined3d_device ...@@ -2969,6 +2968,8 @@ static HRESULT shader_init(struct wined3d_shader *shader, struct wined3d_device
shader_cleanup(shader); shader_cleanup(shader);
} }
shader->load_local_constsF = shader->lconst_inf_or_nan;
return hr; return hr;
} }
...@@ -2995,8 +2996,8 @@ static HRESULT vertex_shader_init(struct wined3d_shader *shader, struct wined3d_ ...@@ -2995,8 +2996,8 @@ static HRESULT vertex_shader_init(struct wined3d_shader *shader, struct wined3d_
shader->u.vs.attributes[input->register_idx].usage_idx = input->semantic_idx; shader->u.vs.attributes[input->register_idx].usage_idx = input->semantic_idx;
} }
shader->load_local_constsF = (reg_maps->usesrelconstF && !list_empty(&shader->constantsF)) || if (reg_maps->usesrelconstF && !list_empty(&shader->constantsF))
shader->lconst_inf_or_nan; shader->load_local_constsF = TRUE;
return WINED3D_OK; return WINED3D_OK;
} }
...@@ -3004,41 +3005,19 @@ static HRESULT vertex_shader_init(struct wined3d_shader *shader, struct wined3d_ ...@@ -3004,41 +3005,19 @@ static HRESULT vertex_shader_init(struct wined3d_shader *shader, struct wined3d_
static HRESULT domain_shader_init(struct wined3d_shader *shader, struct wined3d_device *device, static HRESULT domain_shader_init(struct wined3d_shader *shader, struct wined3d_device *device,
const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops) const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops)
{ {
HRESULT hr; return shader_init(shader, device, desc, 0, WINED3D_SHADER_TYPE_DOMAIN, parent, parent_ops);
if (FAILED(hr = shader_init(shader, device, desc, 0, WINED3D_SHADER_TYPE_DOMAIN, parent, parent_ops)))
return hr;
shader->load_local_constsF = shader->lconst_inf_or_nan;
return WINED3D_OK;
} }
static HRESULT hull_shader_init(struct wined3d_shader *shader, struct wined3d_device *device, static HRESULT hull_shader_init(struct wined3d_shader *shader, struct wined3d_device *device,
const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops) const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops)
{ {
HRESULT hr; return shader_init(shader, device, desc, 0, WINED3D_SHADER_TYPE_HULL, parent, parent_ops);
if (FAILED(hr = shader_init(shader, device, desc, 0, WINED3D_SHADER_TYPE_HULL, parent, parent_ops)))
return hr;
shader->load_local_constsF = shader->lconst_inf_or_nan;
return WINED3D_OK;
} }
static HRESULT geometry_shader_init(struct wined3d_shader *shader, struct wined3d_device *device, static HRESULT geometry_shader_init(struct wined3d_shader *shader, struct wined3d_device *device,
const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops) const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops)
{ {
HRESULT hr; return shader_init(shader, device, desc, 0, WINED3D_SHADER_TYPE_GEOMETRY, parent, parent_ops);
if (FAILED(hr = shader_init(shader, device, desc, 0,
WINED3D_SHADER_TYPE_GEOMETRY, parent, parent_ops)))
return hr;
shader->load_local_constsF = shader->lconst_inf_or_nan;
return WINED3D_OK;
} }
void find_gs_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, void find_gs_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader,
...@@ -3324,8 +3303,6 @@ static HRESULT pixel_shader_init(struct wined3d_shader *shader, struct wined3d_d ...@@ -3324,8 +3303,6 @@ static HRESULT pixel_shader_init(struct wined3d_shader *shader, struct wined3d_d
} }
} }
shader->load_local_constsF = shader->lconst_inf_or_nan;
return WINED3D_OK; return WINED3D_OK;
} }
...@@ -3363,14 +3340,7 @@ void pixelshader_update_resource_types(struct wined3d_shader *shader, WORD tex_t ...@@ -3363,14 +3340,7 @@ void pixelshader_update_resource_types(struct wined3d_shader *shader, WORD tex_t
static HRESULT compute_shader_init(struct wined3d_shader *shader, struct wined3d_device *device, static HRESULT compute_shader_init(struct wined3d_shader *shader, struct wined3d_device *device,
const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops) const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops)
{ {
HRESULT hr; return shader_init(shader, device, desc, 0, WINED3D_SHADER_TYPE_COMPUTE, parent, parent_ops);
if (FAILED(hr = shader_init(shader, device, desc, 0, WINED3D_SHADER_TYPE_COMPUTE, parent, parent_ops)))
return hr;
shader->load_local_constsF = shader->lconst_inf_or_nan;
return WINED3D_OK;
} }
HRESULT CDECL wined3d_shader_create_cs(struct wined3d_device *device, const struct wined3d_shader_desc *desc, HRESULT CDECL wined3d_shader_create_cs(struct wined3d_device *device, const struct wined3d_shader_desc *desc,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment