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

wined3d: GL_ARB_fragment_program ffp implementation.

parent bc4435e4
......@@ -2234,8 +2234,8 @@ err_out:
IWineD3DStateBlock_Release((IWineD3DStateBlock *) This->stateBlock);
This->stateBlock = NULL;
}
This->shader_backend->shader_free_private(iface);
This->frag_pipe->free_private(iface);
This->shader_backend->shader_free_private(iface);
return hr;
}
......@@ -2324,8 +2324,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, D3DCB_D
}
/* Destroy the shader backend. Note that this has to happen after all shaders are destroyed. */
This->shader_backend->shader_free_private(iface);
This->frag_pipe->free_private(iface);
This->shader_backend->shader_free_private(iface);
/* Release the buffers (with sanity checks)*/
TRACE("Releasing the depth stencil buffer at %p\n", This->stencilBufferTarget);
......@@ -7252,8 +7252,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
This->depth_blt_rb_w = 0;
This->depth_blt_rb_h = 0;
}
This->shader_backend->shader_free_private(iface);
This->frag_pipe->free_private(iface);
This->shader_backend->shader_free_private(iface);
for (i = 0; i < GL_LIMITS(textures); i++) {
/* Textures are recreated below */
......
......@@ -1963,6 +1963,7 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceType(IWineD3D *iface, UINT Adapter
/* Check if we support bumpmapping for a format */
static BOOL CheckBumpMapCapability(UINT Adapter, WINED3DFORMAT CheckFormat)
{
/* TODO: Check this in the fixed function pipeline backend */
if(GL_SUPPORT(NV_REGISTER_COMBINERS) && GL_SUPPORT(NV_TEXTURE_SHADER2)) {
switch (CheckFormat) {
case WINED3DFMT_V8U8:
......@@ -1984,6 +1985,20 @@ static BOOL CheckBumpMapCapability(UINT Adapter, WINED3DFORMAT CheckFormat)
return FALSE;
}
}
if(GL_SUPPORT(ARB_FRAGMENT_PROGRAM)) {
switch (CheckFormat) {
case WINED3DFMT_V8U8:
case WINED3DFMT_V16U16:
case WINED3DFMT_L6V5U5:
case WINED3DFMT_X8L8V8U8:
case WINED3DFMT_Q8W8V8U8:
TRACE_(d3d_caps)("[OK]\n");
return TRUE;
default:
TRACE_(d3d_caps)("[FAILED]\n");
return FALSE;
}
}
TRACE_(d3d_caps)("[FAILED]\n");
return FALSE;
}
......@@ -2902,7 +2917,9 @@ static const struct fragment_pipeline *select_fragment_implementation(UINT Adapt
int ps_selected_mode;
select_shader_mode(&GLINFO_LOCATION, DeviceType, &ps_selected_mode, &vs_selected_mode);
if(ps_selected_mode == SHADER_ATI) {
if((ps_selected_mode == SHADER_ARB || ps_selected_mode == SHADER_GLSL) && GL_SUPPORT(ARB_FRAGMENT_PROGRAM)) {
return &arbfp_fragment_pipeline;
} else if(ps_selected_mode == SHADER_ATI) {
return &atifs_fragment_pipeline;
} else if(GL_SUPPORT(NV_REGISTER_COMBINERS) && GL_SUPPORT(NV_TEXTURE_SHADER2)) {
return &nvts_fragment_pipeline;
......
......@@ -267,6 +267,8 @@ struct shader_arb_priv {
GLuint current_fprogram_id;
GLuint depth_blt_vprogram_id;
GLuint depth_blt_fprogram_id;
BOOL use_arbfp_fixed_func;
hash_table_t *fragment_shaders;
};
/* X11 locking */
......@@ -561,6 +563,7 @@ extern const struct StateEntryTemplate misc_state_template[];
extern const struct StateEntryTemplate ffp_vertexstate_template[];
extern const struct fragment_pipeline ffp_fragment_pipeline;
extern const struct fragment_pipeline atifs_fragment_pipeline;
extern const struct fragment_pipeline arbfp_fragment_pipeline;
extern const struct fragment_pipeline nvts_fragment_pipeline;
extern const struct fragment_pipeline nvrc_fragment_pipeline;
......
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