Commit a4400510 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Add a shader DLL init callback.

parent 18e16f4e
......@@ -2058,6 +2058,9 @@ static void shader_arb_get_caps(WINED3DDEVTYPE devtype, WineD3D_GL_Info *gl_info
TRACE_(d3d_caps)("Hardware pixel shader version 1.4 enabled (ARB_PROGRAM)\n");
}
static void shader_arb_load_init(void) {
}
const shader_backend_t arb_program_shader_backend = {
&shader_arb_select,
&shader_arb_select_depth_blt,
......@@ -2072,5 +2075,6 @@ const shader_backend_t arb_program_shader_backend = {
&shader_arb_generate_pshader,
&shader_arb_generate_vshader,
&shader_arb_get_caps,
&shader_arb_load_init,
FFPStateTable
};
......@@ -1104,6 +1104,7 @@ static void shader_none_generate_pshader(IWineD3DPixelShader *iface, SHADER_BUFF
static void shader_none_generate_vshader(IWineD3DVertexShader *iface, SHADER_BUFFER *buffer) {
FIXME("NONE shader backend asked to generate a vertex shader\n");
}
static void shader_none_load_init(void) {}
#define GLINFO_LOCATION (*gl_info)
static void shader_none_get_caps(WINED3DDEVTYPE devtype, WineD3D_GL_Info *gl_info, struct shader_caps *pCaps) {
......@@ -1185,6 +1186,7 @@ const shader_backend_t none_shader_backend = {
&shader_none_generate_pshader,
&shader_none_generate_vshader,
&shader_none_get_caps,
&shader_none_load_init,
FFPStateTable
};
......
......@@ -3580,6 +3580,8 @@ static void shader_glsl_get_caps(WINED3DDEVTYPE devtype, WineD3D_GL_Info *gl_inf
TRACE_(d3d_caps)("Hardware pixel shader version %d.%d enabled (GLSL)\n", (pCaps->PixelShaderVersion >> 8) & 0xff, pCaps->PixelShaderVersion & 0xff);
}
static void shader_glsl_load_init(void) {}
const shader_backend_t glsl_shader_backend = {
&shader_glsl_select,
&shader_glsl_select_depth_blt,
......@@ -3594,5 +3596,6 @@ const shader_backend_t glsl_shader_backend = {
&shader_glsl_generate_pshader,
&shader_glsl_generate_vshader,
&shader_glsl_get_caps,
&shader_glsl_load_init,
FFPStateTable
};
......@@ -93,6 +93,10 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
DWORD len;
WNDCLASSA wc;
glsl_shader_backend.shader_dll_load_init();
arb_program_shader_backend.shader_dll_load_init();
none_shader_backend.shader_dll_load_init();
/* We need our own window class for a fake window which we use to retrieve GL capabilities */
/* We might need CS_OWNDC in the future if we notice strange things on Windows.
* Various articles/posts about OpenGL problems on Windows recommend this. */
......
......@@ -291,6 +291,7 @@ typedef struct {
void (*shader_generate_pshader)(IWineD3DPixelShader *iface, SHADER_BUFFER *buffer);
void (*shader_generate_vshader)(IWineD3DVertexShader *iface, SHADER_BUFFER *buffer);
void (*shader_get_caps)(WINED3DDEVTYPE devtype, WineD3D_GL_Info *gl_info, struct shader_caps *caps);
void (*shader_dll_load_init)(void);
const struct StateEntry *StateTable;
} shader_backend_t;
......@@ -789,6 +790,9 @@ struct IWineD3DDeviceImpl
struct list shaders; /* a linked list to track shaders (pixel and vertex) */
unsigned int highest_dirty_ps_const, highest_dirty_vs_const;
/* TODO: Move this into the shader model private data */
struct list fragment_shaders; /* A linked list to track fragment pipeline replacement shaders */
/* Render Target Support */
IWineD3DSurface **render_targets;
IWineD3DSurface *auto_depth_stencil_buffer;
......
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