}
/* Context activation is done by the caller. */
-HRESULT basetexture_bind(IWineD3DBaseTextureImpl *texture, BOOL srgb, BOOL *set_surface_desc)
+HRESULT basetexture_bind(IWineD3DBaseTextureImpl *texture,
+ const struct wined3d_gl_info *gl_info, BOOL srgb, BOOL *set_surface_desc)
{
- const struct wined3d_gl_info *gl_info = &texture->resource.device->adapter->gl_info;
HRESULT hr = WINED3D_OK;
GLenum textureDimensions;
BOOL isNewTexture = FALSE;
WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture);
/* Context activation is done by the caller. */
-static HRESULT cubetexture_bind(IWineD3DBaseTextureImpl *texture, BOOL srgb)
+static HRESULT cubetexture_bind(IWineD3DBaseTextureImpl *texture,
+ const struct wined3d_gl_info *gl_info, BOOL srgb)
{
BOOL set_gl_texture_desc;
HRESULT hr;
- TRACE("texture %p, srgb %#x.\n", texture, srgb);
+ TRACE("texture %p, gl_info %p, srgb %#x.\n", texture, gl_info, srgb);
- hr = basetexture_bind(texture, srgb, &set_gl_texture_desc);
+ hr = basetexture_bind(texture, gl_info, srgb, &set_gl_texture_desc);
if (set_gl_texture_desc && SUCCEEDED(hr))
{
UINT sub_count = texture->baseTexture.level_count * texture->baseTexture.layer_count;
- const struct wined3d_gl_info *gl_info = &texture->resource.device->adapter->gl_info;
BOOL srgb_tex = !gl_info->supported[EXT_TEXTURE_SRGB_DECODE] && texture->baseTexture.is_srgb;
GLuint name = srgb_tex ? texture->baseTexture.texture_srgb.name : texture->baseTexture.texture_rgb.name;
UINT i;
IWineD3DBaseTextureImpl *texture = state->textures[sampler];
BOOL srgb = state->sampler_states[sampler][WINED3DSAMP_SRGBTEXTURE];
- texture->baseTexture.texture_ops->texture_bind(texture, srgb);
+ texture->baseTexture.texture_ops->texture_bind(texture, gl_info, srgb);
basetexture_apply_state_changes(texture,
state->sampler_states[sampler], gl_info);
if (surface->container.type == WINED3D_CONTAINER_TEXTURE)
{
IWineD3DBaseTextureImpl *texture = surface->container.u.texture;
+ const struct wined3d_gl_info *gl_info = &texture->resource.device->adapter->gl_info;
TRACE("Passing to container (%p).\n", texture);
- texture->baseTexture.texture_ops->texture_bind(texture, srgb);
+ texture->baseTexture.texture_ops->texture_bind(texture, gl_info, srgb);
}
else
{
WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture);
/* Context activation is done by the caller. */
-static HRESULT texture_bind(IWineD3DBaseTextureImpl *texture, BOOL srgb)
+static HRESULT texture_bind(IWineD3DBaseTextureImpl *texture,
+ const struct wined3d_gl_info *gl_info, BOOL srgb)
{
BOOL set_gl_texture_desc;
HRESULT hr;
- TRACE("texture %p, srgb %#x.\n", texture, srgb);
+ TRACE("texture %p, gl_info %p, srgb %#x.\n", texture, gl_info, srgb);
- hr = basetexture_bind(texture, srgb, &set_gl_texture_desc);
+ hr = basetexture_bind(texture, gl_info, srgb, &set_gl_texture_desc);
if (set_gl_texture_desc && SUCCEEDED(hr))
{
- const struct wined3d_gl_info *gl_info = &texture->resource.device->adapter->gl_info;
BOOL srgb_tex = !gl_info->supported[EXT_TEXTURE_SRGB_DECODE] && texture->baseTexture.is_srgb;
struct gl_texture *gl_tex;
UINT i;
IWineD3DDeviceImpl_MarkStateDirty(volume->resource.device, STATE_SAMPLER(active_sampler));
}
- container->baseTexture.texture_ops->texture_bind(container, FALSE);
+ container->baseTexture.texture_ops->texture_bind(container, gl_info, FALSE);
}
void volume_add_dirty_box(struct IWineD3DVolumeImpl *volume, const WINED3DBOX *dirty_box)
WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture);
/* Context activation is done by the caller. */
-static HRESULT volumetexture_bind(IWineD3DBaseTextureImpl *texture, BOOL srgb)
+static HRESULT volumetexture_bind(IWineD3DBaseTextureImpl *texture,
+ const struct wined3d_gl_info *gl_info, BOOL srgb)
{
BOOL dummy;
- TRACE("texture %p, srgb %#x.\n", texture, srgb);
+ TRACE("texture %p, gl_info %p, srgb %#x.\n", texture, gl_info, srgb);
- return basetexture_bind(texture, srgb, &dummy);
+ return basetexture_bind(texture, gl_info, srgb, &dummy);
}
/* Do not call while under the GL lock. */
struct wined3d_texture_ops
{
- HRESULT (*texture_bind)(struct IWineD3DBaseTextureImpl *texture, BOOL srgb);
+ HRESULT (*texture_bind)(struct IWineD3DBaseTextureImpl *texture,
+ const struct wined3d_gl_info *gl_info, BOOL srgb);
void (*texture_preload)(struct IWineD3DBaseTextureImpl *texture, enum WINED3DSRGB srgb);
};
void basetexture_apply_state_changes(IWineD3DBaseTextureImpl *texture,
const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1],
const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
-HRESULT basetexture_bind(IWineD3DBaseTextureImpl *texture, BOOL srgb, BOOL *set_surface_desc) DECLSPEC_HIDDEN;
+HRESULT basetexture_bind(IWineD3DBaseTextureImpl *texture,
+ const struct wined3d_gl_info *gl_info, BOOL srgb, BOOL *set_surface_desc) DECLSPEC_HIDDEN;
void basetexture_cleanup(IWineD3DBaseTextureImpl *texture) DECLSPEC_HIDDEN;
void basetexture_generate_mipmaps(IWineD3DBaseTextureImpl *texture) DECLSPEC_HIDDEN;
WINED3DTEXTUREFILTERTYPE basetexture_get_autogen_filter_type(IWineD3DBaseTextureImpl *texture) DECLSPEC_HIDDEN;