winedd: Move shader_*_add_instruction_modifiers into the shader backend.
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index f3ec739..fd9af76 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -2247,6 +2247,10 @@
return FALSE;
}
+static void shader_arb_add_instruction_modifiers(const struct wined3d_shader_instruction *ins) {
+ /* Nothing to do for now */
+}
+
static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABLE_SIZE] =
{
/* WINED3DSIH_ABS */ shader_hw_map2gl,
@@ -2351,6 +2355,7 @@
shader_arb_generate_vshader,
shader_arb_get_caps,
shader_arb_color_fixup_supported,
+ shader_arb_add_instruction_modifiers,
};
/* ARB_fragment_program fixed function pipeline replacement definitions */
diff --git a/dlls/wined3d/baseshader.c b/dlls/wined3d/baseshader.c
index 957ec61..303460f 100644
--- a/dlls/wined3d/baseshader.c
+++ b/dlls/wined3d/baseshader.c
@@ -1028,9 +1028,7 @@
hw_fct(&ins);
/* Process instruction modifiers for GLSL apps ( _sat, etc. ) */
- /* FIXME: This should be internal to the shader backend.
- * Also, right now this is the only reason "shader_mode" exists. */
- if (This->baseShader.shader_mode == SHADER_GLSL) shader_glsl_add_instruction_modifiers(&ins);
+ device->shader_backend->shader_add_instruction_modifiers(&ins);
}
}
@@ -1252,6 +1250,7 @@
FIXME("NONE shader backend asked to generate a vertex shader\n");
return 0;
}
+static void shader_none_add_instruction_modifiers(const struct wined3d_shader_instruction *ins) {}
#define GLINFO_LOCATION (*gl_info)
static void shader_none_get_caps(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct shader_caps *pCaps)
@@ -1298,4 +1297,5 @@
shader_none_generate_vshader,
shader_none_get_caps,
shader_none_color_fixup_supported,
+ shader_none_add_instruction_modifiers,
};
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 0370fde..ca50305 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -1363,7 +1363,7 @@
}
/** Process GLSL instruction modifiers */
-void shader_glsl_add_instruction_modifiers(const struct wined3d_shader_instruction *ins)
+static void shader_glsl_add_instruction_modifiers(const struct wined3d_shader_instruction *ins)
{
glsl_dst_param_t dst_param;
DWORD modifiers;
@@ -4401,4 +4401,5 @@
shader_glsl_generate_vshader,
shader_glsl_get_caps,
shader_glsl_color_fixup_supported,
+ shader_glsl_add_instruction_modifiers,
};
diff --git a/dlls/wined3d/pixelshader.c b/dlls/wined3d/pixelshader.c
index a2e182d..9b001db 100644
--- a/dlls/wined3d/pixelshader.c
+++ b/dlls/wined3d/pixelshader.c
@@ -207,7 +207,6 @@
static HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *iface, CONST DWORD *pFunction) {
IWineD3DPixelShaderImpl *This =(IWineD3DPixelShaderImpl *)iface;
- IWineD3DDeviceImpl *deviceImpl = (IWineD3DDeviceImpl *) This->baseShader.device;
unsigned int i, highest_reg_used = 0, num_regs_used = 0;
shader_reg_maps *reg_maps = &This->baseShader.reg_maps;
const struct wined3d_shader_frontend *fe;
@@ -285,8 +284,6 @@
This->baseShader.load_local_constsF = FALSE;
- This->baseShader.shader_mode = deviceImpl->ps_selected_mode;
-
TRACE("(%p) : Copying the function\n", This);
This->baseShader.function = HeapAlloc(GetProcessHeap(), 0, This->baseShader.functionLength);
diff --git a/dlls/wined3d/vertexshader.c b/dlls/wined3d/vertexshader.c
index e5fb20f..1491b0c 100644
--- a/dlls/wined3d/vertexshader.c
+++ b/dlls/wined3d/vertexshader.c
@@ -285,8 +285,6 @@
vshader_set_limits(This);
- This->baseShader.shader_mode = deviceImpl->vs_selected_mode;
-
if(deviceImpl->vs_selected_mode == SHADER_ARB &&
(GLINFO_LOCATION).arb_vs_offset_limit &&
This->min_rel_offset <= This->max_rel_offset) {
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index d40d0ab..641ca8c 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -807,6 +807,7 @@
SHADER_BUFFER *buffer, const struct vs_compile_args *args);
void (*shader_get_caps)(WINED3DDEVTYPE devtype, const WineD3D_GL_Info *gl_info, struct shader_caps *caps);
BOOL (*shader_color_fixup_supported)(struct color_fixup_desc fixup);
+ void (*shader_add_instruction_modifiers)(const struct wined3d_shader_instruction *ins);
} shader_backend_t;
extern const shader_backend_t glsl_shader_backend;
@@ -2525,9 +2526,6 @@
extern HRESULT allocate_shader_constants(IWineD3DStateBlockImpl* object);
-/* GLSL helper functions */
-extern void shader_glsl_add_instruction_modifiers(const struct wined3d_shader_instruction *ins);
-
/*****************************************************************************
* IDirect3DBaseShader implementation structure
*/
@@ -2543,9 +2541,6 @@
const struct wined3d_shader_frontend *frontend;
void *frontend_data;
- /* Type of shader backend */
- int shader_mode;
-
/* Programs this shader is linked with */
struct list linked_programs;