Commit 34ab198f authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Pass a wined3d_context_gl structure to context_load_tex_coords().

parent d76bf253
...@@ -5036,19 +5036,19 @@ void context_unload_tex_coords(const struct wined3d_context *context) ...@@ -5036,19 +5036,19 @@ void context_unload_tex_coords(const struct wined3d_context *context)
} }
} }
void context_load_tex_coords(const struct wined3d_context *context, const struct wined3d_stream_info *si, void wined3d_context_gl_load_tex_coords(const struct wined3d_context_gl *context_gl,
GLuint *current_bo, const struct wined3d_state *state) const struct wined3d_stream_info *si, GLuint *current_bo, const struct wined3d_state *state)
{ {
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
const struct wined3d_format_gl *format_gl; const struct wined3d_format_gl *format_gl;
unsigned int mapped_stage = 0; unsigned int mapped_stage = 0;
unsigned int texture_idx; unsigned int texture_idx;
for (texture_idx = 0; texture_idx < context->d3d_info->limits.ffp_blend_stages; ++texture_idx) for (texture_idx = 0; texture_idx < context_gl->c.d3d_info->limits.ffp_blend_stages; ++texture_idx)
{ {
unsigned int coord_idx = state->texture_states[texture_idx][WINED3D_TSS_TEXCOORD_INDEX]; unsigned int coord_idx = state->texture_states[texture_idx][WINED3D_TSS_TEXCOORD_INDEX];
if ((mapped_stage = context->tex_unit_map[texture_idx]) == WINED3D_UNMAPPED_STAGE) if ((mapped_stage = context_gl->c.tex_unit_map[texture_idx]) == WINED3D_UNMAPPED_STAGE)
continue; continue;
if (mapped_stage >= gl_info->limits.texture_coords) if (mapped_stage >= gl_info->limits.texture_coords)
...@@ -5116,6 +5116,7 @@ static void context_unload_vertex_data(struct wined3d_context *context) ...@@ -5116,6 +5116,7 @@ static void context_unload_vertex_data(struct wined3d_context *context)
static void context_load_vertex_data(struct wined3d_context *context, static void context_load_vertex_data(struct wined3d_context *context,
const struct wined3d_stream_info *si, const struct wined3d_state *state) const struct wined3d_stream_info *si, const struct wined3d_state *state)
{ {
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
const struct wined3d_stream_info_element *e; const struct wined3d_stream_info_element *e;
const struct wined3d_format_gl *format_gl; const struct wined3d_format_gl *format_gl;
...@@ -5305,7 +5306,7 @@ static void context_load_vertex_data(struct wined3d_context *context, ...@@ -5305,7 +5306,7 @@ static void context_load_vertex_data(struct wined3d_context *context,
} }
/* Texture coordinates */ /* Texture coordinates */
context_load_tex_coords(context, si, &current_bo, state); wined3d_context_gl_load_tex_coords(context_gl, si, &current_bo, state);
} }
static void context_unload_numbered_array(struct wined3d_context *context, unsigned int i) static void context_unload_numbered_array(struct wined3d_context *context, unsigned int i)
......
...@@ -3315,6 +3315,7 @@ static void transform_texture(struct wined3d_context *context, const struct wine ...@@ -3315,6 +3315,7 @@ static void transform_texture(struct wined3d_context *context, const struct wine
static void tex_coordindex(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) static void tex_coordindex(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{ {
DWORD stage = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1); DWORD stage = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
static const GLfloat s_plane[] = { 1.0f, 0.0f, 0.0f, 0.0f }; static const GLfloat s_plane[] = { 1.0f, 0.0f, 0.0f, 0.0f };
static const GLfloat t_plane[] = { 0.0f, 1.0f, 0.0f, 0.0f }; static const GLfloat t_plane[] = { 0.0f, 1.0f, 0.0f, 0.0f };
static const GLfloat r_plane[] = { 0.0f, 0.0f, 1.0f, 0.0f }; static const GLfloat r_plane[] = { 0.0f, 0.0f, 1.0f, 0.0f };
...@@ -3483,7 +3484,7 @@ static void tex_coordindex(struct wined3d_context *context, const struct wined3d ...@@ -3483,7 +3484,7 @@ static void tex_coordindex(struct wined3d_context *context, const struct wined3d
GLuint curVBO = gl_info->supported[ARB_VERTEX_BUFFER_OBJECT] ? ~0U : 0; GLuint curVBO = gl_info->supported[ARB_VERTEX_BUFFER_OBJECT] ? ~0U : 0;
context_unload_tex_coords(context); context_unload_tex_coords(context);
context_load_tex_coords(context, &context->stream_info, &curVBO, state); wined3d_context_gl_load_tex_coords(context_gl, &context->stream_info, &curVBO, state);
} }
} }
......
...@@ -2054,6 +2054,8 @@ void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, ...@@ -2054,6 +2054,8 @@ void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl,
void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN; void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl) DECLSPEC_HIDDEN;
HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl,
struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void wined3d_context_gl_load_tex_coords(const struct wined3d_context_gl *context_gl,
const struct wined3d_stream_info *si, GLuint *current_bo, const struct wined3d_state *state) DECLSPEC_HIDDEN;
struct wined3d_fb_state struct wined3d_fb_state
{ {
...@@ -2236,8 +2238,6 @@ void context_gl_resource_released(struct wined3d_device *device, ...@@ -2236,8 +2238,6 @@ void context_gl_resource_released(struct wined3d_device *device,
GLuint name, BOOL rb_namespace) DECLSPEC_HIDDEN; GLuint name, BOOL rb_namespace) DECLSPEC_HIDDEN;
void context_invalidate_compute_state(struct wined3d_context *context, DWORD state_id) DECLSPEC_HIDDEN; void context_invalidate_compute_state(struct wined3d_context *context, DWORD state_id) DECLSPEC_HIDDEN;
void context_invalidate_state(struct wined3d_context *context, DWORD state_id) DECLSPEC_HIDDEN; void context_invalidate_state(struct wined3d_context *context, DWORD state_id) DECLSPEC_HIDDEN;
void context_load_tex_coords(const struct wined3d_context *context, const struct wined3d_stream_info *si,
GLuint *current_bo, const struct wined3d_state *state) DECLSPEC_HIDDEN;
void *context_map_bo_address(struct wined3d_context *context, const struct wined3d_bo_address *data, void *context_map_bo_address(struct wined3d_context *context, const struct wined3d_bo_address *data,
size_t size, GLenum binding, DWORD flags) DECLSPEC_HIDDEN; size_t size, GLenum binding, DWORD flags) DECLSPEC_HIDDEN;
struct wined3d_context *context_reacquire(const struct wined3d_device *device, struct wined3d_context *context_reacquire(const struct wined3d_device *device,
......
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