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

wined3d: Add fog and tex types to the ffp fragment description.

parent 40cfec25
...@@ -780,13 +780,13 @@ static GLuint gen_ati_shader(struct texture_stage_op op[MAX_TEXTURES], WineD3D_G ...@@ -780,13 +780,13 @@ static GLuint gen_ati_shader(struct texture_stage_op op[MAX_TEXTURES], WineD3D_G
static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
IWineD3DDeviceImpl *This = stateblock->wineD3DDevice; IWineD3DDeviceImpl *This = stateblock->wineD3DDevice;
struct atifs_ffp_desc *desc; struct atifs_ffp_desc *desc;
struct texture_stage_op op[MAX_TEXTURES]; struct ffp_settings settings;
struct atifs_private_data *priv = (struct atifs_private_data *) This->fragment_priv; struct atifs_private_data *priv = (struct atifs_private_data *) This->fragment_priv;
DWORD mapped_stage; DWORD mapped_stage;
unsigned int i; unsigned int i;
gen_ffp_op(stateblock, op); gen_ffp_op(stateblock, &settings, TRUE);
desc = (struct atifs_ffp_desc *) find_ffp_shader(&priv->fragment_shaders, op); desc = (struct atifs_ffp_desc *) find_ffp_shader(&priv->fragment_shaders, &settings);
if(!desc) { if(!desc) {
desc = HeapAlloc(GetProcessHeap(), 0, sizeof(*desc)); desc = HeapAlloc(GetProcessHeap(), 0, sizeof(*desc));
if(!desc) { if(!desc) {
...@@ -795,12 +795,12 @@ static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, Wi ...@@ -795,12 +795,12 @@ static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, Wi
} }
desc->num_textures_used = 0; desc->num_textures_used = 0;
for(i = 0; i < GL_LIMITS(texture_stages); i++) { for(i = 0; i < GL_LIMITS(texture_stages); i++) {
if(op[i].cop == WINED3DTOP_DISABLE) break; if(settings.op[i].cop == WINED3DTOP_DISABLE) break;
desc->num_textures_used = i; desc->num_textures_used = i;
} }
memcpy(desc->parent.op, op, sizeof(op)); memcpy(&desc->parent.settings, &settings, sizeof(settings));
desc->shader = gen_ati_shader(op, &GLINFO_LOCATION); desc->shader = gen_ati_shader(settings.op, &GLINFO_LOCATION);
add_ffp_shader(&priv->fragment_shaders, &desc->parent); add_ffp_shader(&priv->fragment_shaders, &desc->parent);
TRACE("Allocated fixed function replacement shader descriptor %p\n", desc); TRACE("Allocated fixed function replacement shader descriptor %p\n", desc);
} }
......
...@@ -728,18 +728,29 @@ struct texture_stage_op ...@@ -728,18 +728,29 @@ struct texture_stage_op
DWORD carg1, carg2, carg0; DWORD carg1, carg2, carg0;
DWORD aarg1, aarg2, aarg0; DWORD aarg1, aarg2, aarg0;
WINED3DFORMAT color_correction; WINED3DFORMAT color_correction;
DWORD tex_type;
DWORD dst; DWORD dst;
enum projection_types projected; enum projection_types projected;
}; };
struct ffp_settings {
struct texture_stage_op op[MAX_TEXTURES];
enum {
FOG_OFF,
FOG_LINEAR,
FOG_EXP,
FOG_EXP2
} fog;
};
struct ffp_desc struct ffp_desc
{ {
struct texture_stage_op op[MAX_TEXTURES]; struct ffp_settings settings;
struct list entry; struct list entry;
}; };
void gen_ffp_op(IWineD3DStateBlockImpl *stateblock,struct texture_stage_op op[MAX_TEXTURES]); void gen_ffp_op(IWineD3DStateBlockImpl *stateblock, struct ffp_settings *settings, BOOL ignore_textype);
struct ffp_desc *find_ffp_shader(struct list *shaders, struct texture_stage_op op[MAX_TEXTURES]); struct ffp_desc *find_ffp_shader(struct list *shaders, struct ffp_settings *settings);
void add_ffp_shader(struct list *shaders, struct ffp_desc *desc); void add_ffp_shader(struct list *shaders, struct ffp_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