wined3d: Pass a wined3d_context_gl structure to context_get_offscreen_gl_buffer().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f2506fc778
commit
74ed5d722f
|
@ -2724,7 +2724,7 @@ static void context_set_render_offscreen(struct wined3d_context *context, BOOL o
|
|||
context->render_offscreen = offscreen;
|
||||
}
|
||||
|
||||
GLenum context_get_offscreen_gl_buffer(const struct wined3d_context *context)
|
||||
GLenum wined3d_context_gl_get_offscreen_gl_buffer(const struct wined3d_context_gl *context_gl)
|
||||
{
|
||||
switch (wined3d_settings.offscreen_rendering_mode)
|
||||
{
|
||||
|
@ -2732,7 +2732,7 @@ GLenum context_get_offscreen_gl_buffer(const struct wined3d_context *context)
|
|||
return GL_COLOR_ATTACHMENT0;
|
||||
|
||||
case ORM_BACKBUFFER:
|
||||
return context->aux_buffers > 0 ? GL_AUX0 : GL_BACK;
|
||||
return context_gl->c.aux_buffers > 0 ? GL_AUX0 : GL_BACK;
|
||||
|
||||
default:
|
||||
FIXME("Unhandled offscreen rendering mode %#x.\n", wined3d_settings.offscreen_rendering_mode);
|
||||
|
@ -2742,12 +2742,14 @@ GLenum context_get_offscreen_gl_buffer(const struct wined3d_context *context)
|
|||
|
||||
static DWORD context_generate_rt_mask_no_fbo(const struct wined3d_context *context, struct wined3d_resource *rt)
|
||||
{
|
||||
const struct wined3d_context_gl *context_gl = wined3d_context_gl_const(context);
|
||||
|
||||
if (!rt || rt->format->id == WINED3DFMT_NULL)
|
||||
return 0;
|
||||
else if (rt->type != WINED3D_RTYPE_BUFFER && texture_from_resource(rt)->swapchain)
|
||||
return context_generate_rt_mask_from_resource(rt);
|
||||
else
|
||||
return context_generate_rt_mask(context_get_offscreen_gl_buffer(context));
|
||||
return context_generate_rt_mask(wined3d_context_gl_get_offscreen_gl_buffer(context_gl));
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
|
|
|
@ -754,7 +754,7 @@ static void texture2d_read_from_framebuffer(struct wined3d_texture *texture, uns
|
|||
/* Mapping the primary render target which is not on a swapchain.
|
||||
* Read from the back buffer. */
|
||||
TRACE("Mapping offscreen render target.\n");
|
||||
gl_info->gl_ops.gl.p_glReadBuffer(context_get_offscreen_gl_buffer(context));
|
||||
gl_info->gl_ops.gl.p_glReadBuffer(wined3d_context_gl_get_offscreen_gl_buffer(context_gl));
|
||||
src_is_upside_down = TRUE;
|
||||
}
|
||||
else
|
||||
|
@ -845,6 +845,7 @@ void texture2d_load_fb_texture(struct wined3d_texture_gl *texture_gl,
|
|||
{
|
||||
struct wined3d_texture *restore_texture;
|
||||
const struct wined3d_gl_info *gl_info;
|
||||
struct wined3d_context_gl *context_gl;
|
||||
struct wined3d_resource *resource;
|
||||
unsigned int restore_idx, level;
|
||||
struct wined3d_device *device;
|
||||
|
@ -858,17 +859,18 @@ void texture2d_load_fb_texture(struct wined3d_texture_gl *texture_gl,
|
|||
context = context_acquire(device, &texture_gl->t, sub_resource_idx);
|
||||
else
|
||||
restore_texture = NULL;
|
||||
context_gl = wined3d_context_gl(context);
|
||||
|
||||
gl_info = context->gl_info;
|
||||
device_invalidate_state(device, STATE_FRAMEBUFFER);
|
||||
|
||||
wined3d_texture_prepare_texture(&texture_gl->t, context, srgb);
|
||||
wined3d_texture_gl_bind_and_dirtify(texture_gl, wined3d_context_gl(context), srgb);
|
||||
wined3d_texture_gl_bind_and_dirtify(texture_gl, context_gl, srgb);
|
||||
|
||||
TRACE("Reading back offscreen render target %p, %u.\n", texture_gl, sub_resource_idx);
|
||||
|
||||
if (wined3d_resource_is_offscreen(resource))
|
||||
gl_info->gl_ops.gl.p_glReadBuffer(context_get_offscreen_gl_buffer(context));
|
||||
gl_info->gl_ops.gl.p_glReadBuffer(wined3d_context_gl_get_offscreen_gl_buffer(context_gl));
|
||||
else
|
||||
gl_info->gl_ops.gl.p_glReadBuffer(wined3d_texture_get_gl_buffer(&texture_gl->t));
|
||||
checkGLcall("glReadBuffer");
|
||||
|
@ -922,7 +924,7 @@ static void fb_copy_to_texture_direct(struct wined3d_texture_gl *dst_texture, un
|
|||
{
|
||||
TRACE("Reading from an offscreen target\n");
|
||||
upsidedown = !upsidedown;
|
||||
gl_info->gl_ops.gl.p_glReadBuffer(context_get_offscreen_gl_buffer(context));
|
||||
gl_info->gl_ops.gl.p_glReadBuffer(wined3d_context_gl_get_offscreen_gl_buffer(context_gl));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1036,7 +1038,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_texture_gl *dst_texture,
|
|||
wined3d_context_gl_apply_ffp_blit_state(context_gl, device);
|
||||
wined3d_texture_load(&dst_texture->t, context, FALSE);
|
||||
|
||||
offscreen_buffer = context_get_offscreen_gl_buffer(context);
|
||||
offscreen_buffer = wined3d_context_gl_get_offscreen_gl_buffer(context_gl);
|
||||
src_level = src_sub_resource_idx % src_texture->t.level_count;
|
||||
src_width = wined3d_texture_get_level_width(&src_texture->t, src_level);
|
||||
src_height = wined3d_texture_get_level_height(&src_texture->t, src_level);
|
||||
|
|
|
@ -2081,6 +2081,7 @@ void wined3d_context_gl_free_occlusion_query(struct wined3d_occlusion_query *que
|
|||
void wined3d_context_gl_free_pipeline_statistics_query(struct wined3d_pipeline_statistics_query *query) DECLSPEC_HIDDEN;
|
||||
void wined3d_context_gl_free_so_statistics_query(struct wined3d_so_statistics_query *query) DECLSPEC_HIDDEN;
|
||||
void wined3d_context_gl_free_timestamp_query(struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN;
|
||||
GLenum wined3d_context_gl_get_offscreen_gl_buffer(const struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN;
|
||||
const unsigned int *wined3d_context_gl_get_tex_unit_mapping(const struct wined3d_context_gl *context_gl,
|
||||
const struct wined3d_shader_version *shader_version, unsigned int *base, unsigned int *count) DECLSPEC_HIDDEN;
|
||||
HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl,
|
||||
|
@ -2246,7 +2247,6 @@ void context_draw_textured_quad(struct wined3d_context *context, struct wined3d_
|
|||
void context_enable_clip_distances(struct wined3d_context *context, unsigned int mask) DECLSPEC_HIDDEN;
|
||||
void context_end_transform_feedback(struct wined3d_context *context) DECLSPEC_HIDDEN;
|
||||
struct wined3d_context *context_get_current(void) DECLSPEC_HIDDEN;
|
||||
GLenum context_get_offscreen_gl_buffer(const struct wined3d_context *context) DECLSPEC_HIDDEN;
|
||||
DWORD context_get_tls_idx(void) DECLSPEC_HIDDEN;
|
||||
void context_gl_resource_released(struct wined3d_device *device,
|
||||
GLuint name, BOOL rb_namespace) DECLSPEC_HIDDEN;
|
||||
|
|
Loading…
Reference in New Issue