Commit 26b7baa0 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Store render target info instead of surfaces in "blit_targets".

In preparation for extending render target views support. Signed-off-by: 's avatarJózef Kucia <jkucia@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 90bf175f
......@@ -980,18 +980,29 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
* render target dimensions. With FBOs, the dimensions have to be an exact match. */
/* TODO: We should synchronize the renderbuffer's content with the texture's content. */
/* Context activation is done by the caller. */
void surface_set_compatible_renderbuffer(struct wined3d_surface *surface, const struct wined3d_surface *rt)
void surface_set_compatible_renderbuffer(struct wined3d_surface *surface, const struct wined3d_rendertarget_info *rt)
{
const struct wined3d_gl_info *gl_info = &surface->container->resource.device->adapter->gl_info;
struct wined3d_renderbuffer_entry *entry;
GLuint renderbuffer = 0;
unsigned int src_width, src_height;
unsigned int width, height;
GLuint renderbuffer = 0;
if (rt && rt->container->resource.format->id != WINED3DFMT_NULL)
if (rt && rt->resource->format->id != WINED3DFMT_NULL)
{
width = wined3d_texture_get_level_pow2_width(rt->container, rt->texture_level);
height = wined3d_texture_get_level_pow2_height(rt->container, rt->texture_level);
struct wined3d_texture *texture;
unsigned int level;
if (rt->resource->type == WINED3D_RTYPE_BUFFER)
{
FIXME("Unsupported resource type %s.\n", debug_d3dresourcetype(rt->resource->type));
return;
}
texture = wined3d_texture_from_resource(rt->resource);
level = rt->sub_resource_idx % texture->level_count;
width = wined3d_texture_get_level_pow2_width(texture, level);
height = wined3d_texture_get_level_pow2_height(texture, level);
}
else
{
......
......@@ -1632,6 +1632,12 @@ struct wined3d_timestamp_query
void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN;
void context_free_timestamp_query(struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN;
struct wined3d_rendertarget_info
{
struct wined3d_resource *resource;
unsigned int sub_resource_idx;
};
#define MAX_GL_FRAGMENT_SAMPLERS 32
struct wined3d_context
......@@ -1728,7 +1734,7 @@ struct wined3d_context
struct fbo_entry *current_fbo;
GLuint fbo_read_binding;
GLuint fbo_draw_binding;
struct wined3d_surface **blit_targets;
struct wined3d_rendertarget_info *blit_targets;
struct wined3d_fbo_entry_key *fbo_key;
GLenum *draw_buffers;
DWORD draw_buffers_mask; /* Enabled draw buffers, 31 max. */
......@@ -1858,6 +1864,8 @@ HRESULT compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_
const struct wined3d_vertex_pipe_ops *vertex, const struct fragment_pipeline *fragment,
const struct StateEntryTemplate *misc) DECLSPEC_HIDDEN;
struct wined3d_surface;
enum wined3d_blit_op
{
WINED3D_BLIT_OP_COLOR_BLIT,
......@@ -3064,7 +3072,7 @@ void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb,
BOOL surface_load_location(struct wined3d_surface *surface,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
void surface_set_compatible_renderbuffer(struct wined3d_surface *surface,
const struct wined3d_surface *rt) DECLSPEC_HIDDEN;
const struct wined3d_rendertarget_info *rt) DECLSPEC_HIDDEN;
void surface_translate_drawable_coords(const struct wined3d_surface *surface, HWND window, RECT *rect) DECLSPEC_HIDDEN;
HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point,
struct wined3d_surface *src_surface, const RECT *src_rect) DECLSPEC_HIDDEN;
......
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