Commit 23e28661 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Directly pass the texture to texture_activate_dimensions().

parent 67b7a573
......@@ -838,7 +838,7 @@ static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, st
{
GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + mapped_stage));
checkGLcall("glActiveTextureARB");
texture_activate_dimensions(i, stateblock, context);
texture_activate_dimensions(stateblock->state.textures[i], gl_info);
}
}
......
......@@ -532,7 +532,7 @@ static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct
}
else
{
texture_activate_dimensions(stage, stateblock, context);
texture_activate_dimensions(stateblock->state.textures[stage], gl_info);
}
}
}
......
......@@ -3146,12 +3146,10 @@ static void tex_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct
return;
}
/* The sampler will also activate the correct texture dimensions, so no need to do it here
* if the sampler for this stage is dirty
*/
if(!isStateDirty(context, STATE_SAMPLER(stage))) {
if (tex_used) texture_activate_dimensions(stage, stateblock, context);
}
/* The sampler will also activate the correct texture dimensions, so no
* need to do it here if the sampler for this stage is dirty. */
if (!isStateDirty(context, STATE_SAMPLER(stage)) && tex_used)
texture_activate_dimensions(stateblock->state.textures[stage], gl_info);
set_tex_op(gl_info, &stateblock->state, FALSE, stage,
stateblock->state.texture_states[stage][WINED3DTSS_COLOROP],
......
......@@ -2979,13 +2979,11 @@ void add_ffp_frag_shader(struct wine_rb_tree *shaders, struct ffp_frag_desc *des
* Requires the caller to activate the correct unit before
*/
/* GL locking is done by the caller (state handler) */
void texture_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
void texture_activate_dimensions(IWineD3DBaseTextureImpl *texture, const struct wined3d_gl_info *gl_info)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
if (stateblock->state.textures[stage])
if (texture)
{
switch (stateblock->state.textures[stage]->baseTexture.target)
switch (texture->baseTexture.target)
{
case GL_TEXTURE_2D:
glDisable(GL_TEXTURE_3D);
......@@ -3079,7 +3077,7 @@ void sampler_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wine
if (sampler >= stateblock->state.lowest_disabled_stage) return;
if (isStateDirty(context, STATE_TEXTURESTAGE(sampler, WINED3DTSS_COLOROP))) return;
texture_activate_dimensions(sampler, stateblock, context);
texture_activate_dimensions(stateblock->state.textures[sampler], context->gl_info);
}
void *wined3d_rb_alloc(size_t size)
......
......@@ -2646,8 +2646,8 @@ void set_tex_op_nvrc(const struct wined3d_gl_info *gl_info, const struct wined3d
INT texture_idx, DWORD dst) DECLSPEC_HIDDEN;
void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords,
BOOL transformed, enum wined3d_format_id coordtype, BOOL ffp_can_disable_proj) DECLSPEC_HIDDEN;
void texture_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock,
struct wined3d_context *context) DECLSPEC_HIDDEN;
void texture_activate_dimensions(IWineD3DBaseTextureImpl *texture,
const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
void sampler_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock,
struct wined3d_context *context) DECLSPEC_HIDDEN;
void tex_alphaop(DWORD state, IWineD3DStateBlockImpl *stateblock,
......
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