Commit 0649adc3 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Move the depth renderbuffers from struct wined3d_texture to struct wined3d_texture_gl.

parent 81f577e1
......@@ -431,7 +431,7 @@ static inline void context_set_fbo_key_for_render_target(const struct wined3d_co
{
unsigned int sub_resource_idx = render_target->sub_resource_idx;
struct wined3d_resource *resource = render_target->resource;
struct wined3d_texture *texture;
struct wined3d_texture_gl *texture_gl;
if (!resource || resource->format->id == WINED3DFMT_NULL || resource->type == WINED3D_RTYPE_BUFFER)
{
......@@ -452,19 +452,19 @@ static inline void context_set_fbo_key_for_render_target(const struct wined3d_co
return;
}
texture = wined3d_texture_from_resource(resource);
if (texture->current_renderbuffer)
texture_gl = wined3d_texture_gl(wined3d_texture_from_resource(resource));
if (texture_gl->current_renderbuffer)
{
key->objects[idx].object = texture->current_renderbuffer->id;
key->objects[idx].object = texture_gl->current_renderbuffer->id;
key->objects[idx].target = 0;
key->objects[idx].level = key->objects[idx].layer = 0;
key->rb_namespace |= 1 << idx;
return;
}
key->objects[idx].target = wined3d_texture_get_sub_resource_target(texture, sub_resource_idx);
key->objects[idx].level = sub_resource_idx % texture->level_count;
key->objects[idx].layer = sub_resource_idx / texture->level_count;
key->objects[idx].target = wined3d_texture_get_sub_resource_target(&texture_gl->t, sub_resource_idx);
key->objects[idx].level = sub_resource_idx % texture_gl->t.level_count;
key->objects[idx].layer = sub_resource_idx / texture_gl->t.level_count;
if (render_target->layer_count != 1)
key->objects[idx].layer = WINED3D_ALL_LAYERS;
......@@ -472,22 +472,22 @@ 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, context, FALSE);
key->objects[idx].object = wined3d_texture_get_texture_name(&texture_gl->t, context, FALSE);
break;
case WINED3D_LOCATION_TEXTURE_SRGB:
key->objects[idx].object = wined3d_texture_get_texture_name(texture, context, TRUE);
key->objects[idx].object = wined3d_texture_get_texture_name(&texture_gl->t, context, TRUE);
break;
case WINED3D_LOCATION_RB_MULTISAMPLE:
key->objects[idx].object = texture->rb_multisample;
key->objects[idx].object = texture_gl->t.rb_multisample;
key->objects[idx].target = 0;
key->objects[idx].level = key->objects[idx].layer = 0;
key->rb_namespace |= 1 << idx;
break;
case WINED3D_LOCATION_RB_RESOLVED:
key->objects[idx].object = texture->rb_resolved;
key->objects[idx].object = texture_gl->t.rb_resolved;
key->objects[idx].target = 0;
key->objects[idx].level = key->objects[idx].layer = 0;
key->rb_namespace |= 1 << idx;
......@@ -608,7 +608,8 @@ static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context,
}
else if (depth_stencil->resource->type == WINED3D_RTYPE_TEXTURE_2D)
{
wined3d_texture_set_compatible_renderbuffer(ds_texture, context, ds_level, &render_targets[0]);
wined3d_texture_gl_set_compatible_renderbuffer(wined3d_texture_gl(ds_texture),
context, ds_level, &render_targets[0]);
}
}
......
......@@ -3263,9 +3263,6 @@ struct wined3d_texture
HDC dc;
} *dc_info;
struct list renderbuffers;
const struct wined3d_renderbuffer_entry *current_renderbuffer;
struct wined3d_texture_sub_resource
{
void *parent;
......@@ -3389,8 +3386,6 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
void wined3d_texture_prepare_texture(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_set_compatible_renderbuffer(struct wined3d_texture *texture, struct wined3d_context *context,
unsigned int level, const struct wined3d_rendertarget_info *rt) DECLSPEC_HIDDEN;
void wined3d_texture_set_map_binding(struct wined3d_texture *texture, DWORD map_binding) DECLSPEC_HIDDEN;
void wined3d_texture_set_swapchain(struct wined3d_texture *texture,
struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
......@@ -3411,6 +3406,9 @@ void wined3d_gl_texture_swizzle_from_color_fixup(GLint swizzle[4], struct color_
struct wined3d_texture_gl
{
struct wined3d_texture t;
struct list renderbuffers;
const struct wined3d_renderbuffer_entry *current_renderbuffer;
};
static inline struct wined3d_texture_gl *wined3d_texture_gl(struct wined3d_texture *texture)
......@@ -3418,6 +3416,10 @@ static inline struct wined3d_texture_gl *wined3d_texture_gl(struct wined3d_textu
return CONTAINING_RECORD(texture, struct wined3d_texture_gl, t);
}
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;
#define WINED3D_LOCATION_DISCARDED 0x00000001
#define WINED3D_LOCATION_SYSMEM 0x00000002
#define WINED3D_LOCATION_USER_MEMORY 0x00000004
......
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