Commit 5f974076 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Move the OpenGL textures from struct wined3d_texture to struct wined3d_texture_gl.

parent 3ebd2f0b
......@@ -7904,7 +7904,8 @@ static DWORD arbfp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bl
arbfp_blit_set(arbfp_blitter, context, src_texture, src_sub_resource_idx, color_key);
/* Draw a textured quad */
context_draw_textured_quad(context, src_texture, src_sub_resource_idx, src_rect, dst_rect, filter);
context_draw_textured_quad(context, wined3d_texture_gl(src_texture),
src_sub_resource_idx, src_rect, dst_rect, filter);
/* Leave the opengl state valid for blitting */
arbfp_blit_unset(context->gl_info);
......
......@@ -472,11 +472,11 @@ static inline void context_set_fbo_key_for_render_target(const struct wined3d_co
switch (location)
{
case WINED3D_LOCATION_TEXTURE_RGB:
key->objects[idx].object = wined3d_texture_get_texture_name(&texture_gl->t, context, FALSE);
key->objects[idx].object = wined3d_texture_gl_get_texture_name(texture_gl, context, FALSE);
break;
case WINED3D_LOCATION_TEXTURE_SRGB:
key->objects[idx].object = wined3d_texture_get_texture_name(&texture_gl->t, context, TRUE);
key->objects[idx].object = wined3d_texture_gl_get_texture_name(texture_gl, context, TRUE);
break;
case WINED3D_LOCATION_RB_MULTISAMPLE:
......@@ -1089,7 +1089,7 @@ void context_gl_resource_released(struct wined3d_device *device,
context_enum_fbo_entries(device, name, rb_namespace, context_queue_fbo_entry_destruction);
}
void context_texture_update(struct wined3d_context *context, const struct wined3d_texture *texture)
void context_texture_update(struct wined3d_context *context, const struct wined3d_texture_gl *texture_gl)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
struct fbo_entry *entry = context->current_fbo;
......@@ -1099,10 +1099,10 @@ void context_texture_update(struct wined3d_context *context, const struct wined3
for (i = 0; i < gl_info->limits.buffers + 1; ++i)
{
if (texture->texture_rgb.name == entry->key.objects[i].object
|| texture->texture_srgb.name == entry->key.objects[i].object)
if (texture_gl->texture_rgb.name == entry->key.objects[i].object
|| texture_gl->texture_srgb.name == entry->key.objects[i].object)
{
TRACE("Updated texture %p is bound as attachment %u to the current FBO.\n", texture, i);
TRACE("Updated texture %p is bound as attachment %u to the current FBO.\n", texture_gl, i);
context->rebind_fbo = TRUE;
return;
}
......@@ -3896,8 +3896,8 @@ static void context_bind_unordered_access_views(struct wined3d_context *context,
}
else if (view->resource->type != WINED3D_RTYPE_BUFFER)
{
struct wined3d_texture *texture = texture_from_resource(view->resource);
texture_name = wined3d_texture_get_texture_name(texture, context, FALSE);
struct wined3d_texture_gl *texture_gl = wined3d_texture_gl(texture_from_resource(view->resource));
texture_name = wined3d_texture_gl_get_texture_name(texture_gl, context, FALSE);
level = view->desc.u.texture.level_idx;
}
else
......@@ -4195,14 +4195,14 @@ static void context_setup_target(struct wined3d_context *context,
&& old_render_offscreen && (context->current_rt.texture != texture
|| context->current_rt.sub_resource_idx != sub_resource_idx))
{
struct wined3d_texture_gl *prev_texture = wined3d_texture_gl(context->current_rt.texture);
unsigned int prev_sub_resource_idx = context->current_rt.sub_resource_idx;
struct wined3d_texture *prev_texture = context->current_rt.texture;
/* Read the back buffer of the old drawable into the destination texture. */
if (prev_texture->texture_srgb.name)
wined3d_texture_load(prev_texture, context, TRUE);
wined3d_texture_load(prev_texture, context, FALSE);
wined3d_texture_invalidate_location(prev_texture, prev_sub_resource_idx, WINED3D_LOCATION_DRAWABLE);
wined3d_texture_load(&prev_texture->t, context, TRUE);
wined3d_texture_load(&prev_texture->t, context, FALSE);
wined3d_texture_invalidate_location(&prev_texture->t, prev_sub_resource_idx, WINED3D_LOCATION_DRAWABLE);
}
}
......@@ -5581,7 +5581,7 @@ static void apply_texture_blit_state(const struct wined3d_gl_info *gl_info, stru
}
/* Context activation is done by the caller. */
void context_draw_shaded_quad(struct wined3d_context *context, struct wined3d_texture *texture,
void context_draw_shaded_quad(struct wined3d_context *context, struct wined3d_texture_gl *texture_gl,
unsigned int sub_resource_idx, const RECT *src_rect, const RECT *dst_rect,
enum wined3d_texture_filter_type filter)
{
......@@ -5596,11 +5596,11 @@ void context_draw_shaded_quad(struct wined3d_context *context, struct wined3d_te
}
quad[4];
texture2d_get_blt_info(texture, sub_resource_idx, src_rect, &info);
texture2d_get_blt_info(&texture_gl->t, sub_resource_idx, src_rect, &info);
level = sub_resource_idx % texture->level_count;
context_bind_texture(context, info.bind_target, texture->texture_rgb.name);
apply_texture_blit_state(gl_info, &texture->texture_rgb, info.bind_target, level, filter);
level = sub_resource_idx % texture_gl->t.level_count;
context_bind_texture(context, info.bind_target, texture_gl->texture_rgb.name);
apply_texture_blit_state(gl_info, &texture_gl->texture_rgb, info.bind_target, level, filter);
gl_info->gl_ops.gl.p_glTexParameteri(info.bind_target, GL_TEXTURE_MAX_LEVEL, level);
context_get_rt_size(context, &dst_size);
......@@ -5661,12 +5661,12 @@ void context_draw_shaded_quad(struct wined3d_context *context, struct wined3d_te
}
checkGLcall("draw");
gl_info->gl_ops.gl.p_glTexParameteri(info.bind_target, GL_TEXTURE_MAX_LEVEL, texture->level_count - 1);
gl_info->gl_ops.gl.p_glTexParameteri(info.bind_target, GL_TEXTURE_MAX_LEVEL, texture_gl->t.level_count - 1);
context_bind_texture(context, info.bind_target, 0);
}
/* Context activation is done by the caller. */
void context_draw_textured_quad(struct wined3d_context *context, struct wined3d_texture *texture,
void context_draw_textured_quad(struct wined3d_context *context, struct wined3d_texture_gl *texture_gl,
unsigned int sub_resource_idx, const RECT *src_rect, const RECT *dst_rect,
enum wined3d_texture_filter_type filter)
{
......@@ -5674,14 +5674,14 @@ void context_draw_textured_quad(struct wined3d_context *context, struct wined3d_
struct wined3d_blt_info info;
unsigned int level;
texture2d_get_blt_info(texture, sub_resource_idx, src_rect, &info);
texture2d_get_blt_info(&texture_gl->t, sub_resource_idx, src_rect, &info);
gl_info->gl_ops.gl.p_glEnable(info.bind_target);
checkGLcall("glEnable(bind_target)");
level = sub_resource_idx % texture->level_count;
context_bind_texture(context, info.bind_target, texture->texture_rgb.name);
apply_texture_blit_state(gl_info, &texture->texture_rgb, info.bind_target, level, filter);
level = sub_resource_idx % texture_gl->t.level_count;
context_bind_texture(context, info.bind_target, texture_gl->texture_rgb.name);
apply_texture_blit_state(gl_info, &texture_gl->texture_rgb, info.bind_target, level, filter);
gl_info->gl_ops.gl.p_glTexParameteri(info.bind_target, GL_TEXTURE_MAX_LEVEL, level);
gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
checkGLcall("glTexEnvi");
......@@ -5701,6 +5701,6 @@ void context_draw_textured_quad(struct wined3d_context *context, struct wined3d_
gl_info->gl_ops.gl.p_glVertex2i(dst_rect->right, dst_rect->bottom);
gl_info->gl_ops.gl.p_glEnd();
gl_info->gl_ops.gl.p_glTexParameteri(info.bind_target, GL_TEXTURE_MAX_LEVEL, texture->level_count - 1);
gl_info->gl_ops.gl.p_glTexParameteri(info.bind_target, GL_TEXTURE_MAX_LEVEL, texture_gl->t.level_count - 1);
context_bind_texture(context, info.bind_target, 0);
}
......@@ -2227,7 +2227,7 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
wined3d_texture_get_pitch(src_texture, op->src_sub_resource_idx % src_texture->level_count,
&row_pitch, &slice_pitch);
wined3d_texture_bind_and_dirtify(dst_texture, context, FALSE);
wined3d_texture_gl_bind_and_dirtify(wined3d_texture_gl(dst_texture), context, FALSE);
wined3d_texture_upload_data(dst_texture, op->dst_sub_resource_idx, context,
dst_texture->resource.format, &op->src_box, wined3d_const_bo_address(&addr),
row_pitch, slice_pitch, op->dst_box.left, op->dst_box.top, op->dst_box.front, FALSE);
......@@ -2325,7 +2325,7 @@ static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const voi
wined3d_texture_prepare_texture(texture, context, FALSE);
else
wined3d_texture_load_location(texture, op->sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB);
wined3d_texture_bind_and_dirtify(texture, context, FALSE);
wined3d_texture_gl_bind_and_dirtify(wined3d_texture_gl(texture), context, FALSE);
wined3d_box_set(&src_box, 0, 0, box->right - box->left, box->bottom - box->top, 0, box->back - box->front);
wined3d_texture_upload_data(texture, op->sub_resource_idx, context, texture->resource.format, &src_box,
......
......@@ -13310,7 +13310,8 @@ static DWORD glsl_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bli
default:
break;
}
context_draw_shaded_quad(context, src_texture, src_sub_resource_idx, src_rect, dst_rect, filter);
context_draw_shaded_quad(context, wined3d_texture_gl(src_texture),
src_sub_resource_idx, src_rect, dst_rect, filter);
GL_EXTCALL(glUseProgram(0));
if (dst_texture->swapchain && (dst_texture->swapchain->front_buffer == dst_texture))
......
......@@ -155,34 +155,34 @@ HRESULT CDECL wined3d_sampler_create(struct wined3d_device *device, const struct
return WINED3D_OK;
}
static void texture_apply_base_level(struct wined3d_texture *texture,
static void texture_gl_apply_base_level(struct wined3d_texture_gl *texture_gl,
const struct wined3d_sampler_desc *desc, const struct wined3d_gl_info *gl_info)
{
struct gl_texture *gl_tex;
unsigned int base_level;
if (texture->flags & WINED3D_TEXTURE_COND_NP2)
if (texture_gl->t.flags & WINED3D_TEXTURE_COND_NP2)
base_level = 0;
else if (desc->mip_filter == WINED3D_TEXF_NONE)
base_level = texture->lod;
base_level = texture_gl->t.lod;
else
base_level = min(max(desc->mip_base_level, texture->lod), texture->level_count - 1);
base_level = min(max(desc->mip_base_level, texture_gl->t.lod), texture_gl->t.level_count - 1);
gl_tex = wined3d_texture_get_gl_texture(texture, texture->flags & WINED3D_TEXTURE_IS_SRGB);
gl_tex = wined3d_texture_gl_get_gl_texture(texture_gl, texture_gl->t.flags & WINED3D_TEXTURE_IS_SRGB);
if (base_level != gl_tex->base_level)
{
/* Note that WINED3D_SAMP_MAX_MIP_LEVEL specifies the largest mipmap
* (default 0), while GL_TEXTURE_MAX_LEVEL specifies the smallest
* mipmap used (default 1000). So WINED3D_SAMP_MAX_MIP_LEVEL
* corresponds to GL_TEXTURE_BASE_LEVEL. */
gl_info->gl_ops.gl.p_glTexParameteri(texture->target, GL_TEXTURE_BASE_LEVEL, base_level);
gl_info->gl_ops.gl.p_glTexParameteri(texture_gl->t.target, GL_TEXTURE_BASE_LEVEL, base_level);
gl_tex->base_level = base_level;
}
}
/* This function relies on the correct texture being bound and loaded. */
void wined3d_sampler_bind(struct wined3d_sampler *sampler, unsigned int unit,
struct wined3d_texture *texture, const struct wined3d_context *context)
struct wined3d_texture_gl *texture_gl, const struct wined3d_context *context)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
......@@ -191,15 +191,15 @@ void wined3d_sampler_bind(struct wined3d_sampler *sampler, unsigned int unit,
GL_EXTCALL(glBindSampler(unit, sampler->name));
checkGLcall("bind sampler");
}
else if (texture)
else if (texture_gl)
{
wined3d_texture_apply_sampler_desc(texture, &sampler->desc, context);
wined3d_texture_gl_apply_sampler_desc(texture_gl, &sampler->desc, context);
}
else
{
ERR("Could not apply sampler state.\n");
}
if (texture)
texture_apply_base_level(texture, &sampler->desc, gl_info);
if (texture_gl)
texture_gl_apply_base_level(texture_gl, &sampler->desc, gl_info);
}
......@@ -3612,17 +3612,17 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state
if (state->textures[sampler_idx])
{
struct wined3d_texture_gl *texture_gl = wined3d_texture_gl(state->textures[sampler_idx]);
BOOL srgb = state->sampler_states[sampler_idx][WINED3D_SAMP_SRGB_TEXTURE];
const DWORD *sampler_states = state->sampler_states[sampler_idx];
struct wined3d_texture *texture = state->textures[sampler_idx];
struct wined3d_device *device = context->device;
struct wined3d_sampler_desc desc;
struct wined3d_sampler *sampler;
struct wine_rb_entry *entry;
wined3d_sampler_desc_from_sampler_states(&desc, context, sampler_states, texture);
wined3d_sampler_desc_from_sampler_states(&desc, context, sampler_states, &texture_gl->t);
wined3d_texture_bind(texture, context, srgb);
wined3d_texture_gl_bind(texture_gl, context, srgb);
if ((entry = wine_rb_get(&device->samplers, &desc)))
{
......@@ -3643,10 +3643,10 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state
}
}
wined3d_sampler_bind(sampler, mapped_stage, texture, context);
wined3d_sampler_bind(sampler, mapped_stage, texture_gl, context);
/* Trigger shader constant reloading (for NP2 texcoord fixup) */
if (!(texture->flags & WINED3D_TEXTURE_POW2_MAT_IDENT))
if (!(texture_gl->t.flags & WINED3D_TEXTURE_POW2_MAT_IDENT))
context->constant_update_mask |= WINED3D_SHADER_CONST_PS_NP2_FIXUP;
}
else
......
......@@ -356,7 +356,7 @@ static void wined3d_swapchain_gl_rotate(struct wined3d_swapchain *swapchain, str
texture_prev = wined3d_texture_gl(swapchain->back_buffers[0]);
/* Back buffer 0 is already in the draw binding. */
tex0 = texture_prev->t.texture_rgb;
tex0 = texture_prev->texture_rgb;
rb0 = texture_prev->rb_multisample;
locations0 = texture_prev->t.sub_resources[0].locations;
......@@ -368,7 +368,7 @@ static void wined3d_swapchain_gl_rotate(struct wined3d_swapchain *swapchain, str
if (!(sub_resource->locations & supported_locations))
wined3d_texture_load_location(&texture->t, 0, context, texture->t.resource.draw_binding);
texture_prev->t.texture_rgb = texture->t.texture_rgb;
texture_prev->texture_rgb = texture->texture_rgb;
texture_prev->rb_multisample = texture->rb_multisample;
wined3d_texture_validate_location(&texture_prev->t, 0, sub_resource->locations & supported_locations);
......@@ -377,7 +377,7 @@ static void wined3d_swapchain_gl_rotate(struct wined3d_swapchain *swapchain, str
texture_prev = texture;
}
texture_prev->t.texture_rgb = tex0;
texture_prev->texture_rgb = tex0;
texture_prev->rb_multisample = rb0;
wined3d_texture_validate_location(&texture_prev->t, 0, locations0 & supported_locations);
......
......@@ -72,6 +72,12 @@
#define WINED3D_QUIRK_LIMITED_TEX_FILTERING 0x00000100
#define WINED3D_QUIRK_BROKEN_ARB_FOG 0x00000200
struct fragment_pipeline;
struct wined3d_context;
struct wined3d_state;
struct wined3d_texture_gl;
struct wined3d_vertex_pipe_ops;
enum wined3d_ffp_idx
{
WINED3D_FFP_POSITION = 0,
......@@ -1392,11 +1398,6 @@ struct gs_compile_args
DWORD interpolation_mode[WINED3D_PACKED_INTERPOLATION_SIZE];
};
struct wined3d_context;
struct wined3d_state;
struct fragment_pipeline;
struct wined3d_vertex_pipe_ops;
struct wined3d_shader_backend_ops
{
void (*shader_handle_instruction)(const struct wined3d_shader_instruction *);
......@@ -2166,10 +2167,10 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, stru
const struct wined3d_format *ds_format) DECLSPEC_HIDDEN;
HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc, HGLRC share_ctx) DECLSPEC_HIDDEN;
void context_destroy(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN;
void context_draw_shaded_quad(struct wined3d_context *context, struct wined3d_texture *texture,
void context_draw_shaded_quad(struct wined3d_context *context, struct wined3d_texture_gl *texture_gl,
unsigned int sub_resource_idx, const RECT *src_rect, const RECT *dst_rect,
enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
void context_draw_textured_quad(struct wined3d_context *context, struct wined3d_texture *texture,
void context_draw_textured_quad(struct wined3d_context *context, struct wined3d_texture_gl *texture_gl,
unsigned int sub_resource_idx, const RECT *src_rect, const RECT *dst_rect,
enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
void context_enable_clip_distances(struct wined3d_context *context, unsigned int mask) DECLSPEC_HIDDEN;
......@@ -2202,7 +2203,8 @@ void context_state_drawbuf(struct wined3d_context *context,
const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
void context_state_fb(struct wined3d_context *context,
const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN;
void context_texture_update(struct wined3d_context *context, const struct wined3d_texture *texture) DECLSPEC_HIDDEN;
void context_texture_update(struct wined3d_context *context,
const struct wined3d_texture_gl *texture_gl) DECLSPEC_HIDDEN;
void context_unload_tex_coords(const struct wined3d_context *context) DECLSPEC_HIDDEN;
void context_unmap_bo_address(struct wined3d_context *context,
const struct wined3d_bo_address *data, GLenum binding) DECLSPEC_HIDDEN;
......@@ -3169,13 +3171,6 @@ void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DEC
#define RESOURCE_ALIGNMENT 16
#define WINED3D_CONSTANT_BUFFER_ALIGNMENT 16
struct gl_texture
{
struct wined3d_sampler_desc sampler_desc;
unsigned int base_level;
GLuint name;
};
struct wined3d_blt_info
{
GLenum bind_target;
......@@ -3211,7 +3206,6 @@ struct wined3d_texture
{
struct wined3d_resource resource;
const struct wined3d_texture_ops *texture_ops;
struct gl_texture texture_rgb, texture_srgb;
struct wined3d_swapchain *swapchain;
unsigned int pow2_width;
unsigned int pow2_height;
......@@ -3296,12 +3290,6 @@ static inline GLenum wined3d_texture_get_sub_resource_target(const struct wined3
? cube_targets[sub_resource_idx / texture->level_count] : texture->target;
}
static inline struct gl_texture *wined3d_texture_get_gl_texture(struct wined3d_texture *texture,
BOOL srgb)
{
return srgb ? &texture->texture_srgb : &texture->texture_rgb;
}
static inline unsigned int wined3d_texture_get_level_width(const struct wined3d_texture *texture,
unsigned int level)
{
......@@ -3358,12 +3346,6 @@ BOOL texture2d_load_sysmem(struct wined3d_texture *texture, unsigned int sub_res
BOOL texture2d_load_texture(struct wined3d_texture *texture, unsigned int sub_resource_idx,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_apply_sampler_desc(struct wined3d_texture *texture,
const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_context *context) DECLSPEC_HIDDEN;
void wined3d_texture_bind(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
HRESULT wined3d_texture_check_box_dimensions(const struct wined3d_texture *texture,
unsigned int level, const struct wined3d_box *box) DECLSPEC_HIDDEN;
void wined3d_texture_download_data(struct wined3d_texture *texture, unsigned int sub_resource_idx,
......@@ -3400,10 +3382,19 @@ void wined3d_texture_validate_location(struct wined3d_texture *texture,
void wined3d_gl_texture_swizzle_from_color_fixup(GLint swizzle[4], struct color_fixup_desc fixup) DECLSPEC_HIDDEN;
struct gl_texture
{
struct wined3d_sampler_desc sampler_desc;
unsigned int base_level;
GLuint name;
};
struct wined3d_texture_gl
{
struct wined3d_texture t;
struct gl_texture texture_rgb, texture_srgb;
GLuint rb_multisample;
GLuint rb_resolved;
......@@ -3416,6 +3407,18 @@ static inline struct wined3d_texture_gl *wined3d_texture_gl(struct wined3d_textu
return CONTAINING_RECORD(texture, struct wined3d_texture_gl, t);
}
static inline struct gl_texture *wined3d_texture_gl_get_gl_texture(struct wined3d_texture_gl *texture_gl,
BOOL srgb)
{
return srgb ? &texture_gl->texture_srgb : &texture_gl->texture_rgb;
}
void wined3d_texture_gl_apply_sampler_desc(struct wined3d_texture_gl *texture_gl,
const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_context *context) DECLSPEC_HIDDEN;
void wined3d_texture_gl_bind(struct wined3d_texture_gl *texture_gl,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_gl_bind_and_dirtify(struct wined3d_texture_gl *texture_gl,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_gl_set_compatible_renderbuffer(struct wined3d_texture_gl *texture_gl,
struct wined3d_context *context, unsigned int level,
const struct wined3d_rendertarget_info *rt) DECLSPEC_HIDDEN;
......@@ -3476,7 +3479,7 @@ struct wined3d_sampler
};
void wined3d_sampler_bind(struct wined3d_sampler *sampler, unsigned int unit,
struct wined3d_texture *texture, const struct wined3d_context *context) DECLSPEC_HIDDEN;
struct wined3d_texture_gl *texture_gl, const struct wined3d_context *context) DECLSPEC_HIDDEN;
struct wined3d_vertex_declaration_element
{
......@@ -4506,11 +4509,11 @@ static inline BOOL needs_srgb_write(const struct wined3d_context *context,
&& fb->render_targets[0] && fb->render_targets[0]->format_flags & WINED3DFMT_FLAG_SRGB_WRITE;
}
static inline GLuint wined3d_texture_get_texture_name(const struct wined3d_texture *texture,
static inline GLuint wined3d_texture_gl_get_texture_name(const struct wined3d_texture_gl *texture_gl,
const struct wined3d_context *context, BOOL srgb)
{
return srgb && needs_separate_srgb_gl_texture(context, texture)
? texture->texture_srgb.name : texture->texture_rgb.name;
return srgb && needs_separate_srgb_gl_texture(context, &texture_gl->t)
? texture_gl->texture_srgb.name : texture_gl->texture_rgb.name;
}
static inline BOOL can_use_texture_swizzle(const struct wined3d_gl_info *gl_info, const struct wined3d_format *format)
......
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