wined3d: Move the "gl_info" field from struct wined3d_context to struct wined3d_context_gl.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
844a5ad74f
commit
74b9ef2c1d
|
@ -3989,7 +3989,7 @@ static void WINE_GLAPI invalid_generic_attrib_func(GLuint idx, const void *data)
|
||||||
* draw_primitive_immediate_mode(). */
|
* draw_primitive_immediate_mode(). */
|
||||||
static void WINE_GLAPI position_d3dcolor(const void *data)
|
static void WINE_GLAPI position_d3dcolor(const void *data)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->c.gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->gl_info;
|
||||||
DWORD pos = *((const DWORD *)data);
|
DWORD pos = *((const DWORD *)data);
|
||||||
|
|
||||||
FIXME("Add a test for fixed function position from d3dcolor type.\n");
|
FIXME("Add a test for fixed function position from d3dcolor type.\n");
|
||||||
|
@ -4001,7 +4001,7 @@ static void WINE_GLAPI position_d3dcolor(const void *data)
|
||||||
|
|
||||||
static void WINE_GLAPI position_float4(const void *data)
|
static void WINE_GLAPI position_float4(const void *data)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->c.gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->gl_info;
|
||||||
const GLfloat *pos = data;
|
const GLfloat *pos = data;
|
||||||
|
|
||||||
if (pos[3] != 0.0f && pos[3] != 1.0f)
|
if (pos[3] != 0.0f && pos[3] != 1.0f)
|
||||||
|
@ -4018,7 +4018,7 @@ static void WINE_GLAPI position_float4(const void *data)
|
||||||
|
|
||||||
static void WINE_GLAPI diffuse_d3dcolor(const void *data)
|
static void WINE_GLAPI diffuse_d3dcolor(const void *data)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->c.gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->gl_info;
|
||||||
DWORD diffuseColor = *((const DWORD *)data);
|
DWORD diffuseColor = *((const DWORD *)data);
|
||||||
|
|
||||||
gl_info->gl_ops.gl.p_glColor4ub(D3DCOLOR_B_R(diffuseColor),
|
gl_info->gl_ops.gl.p_glColor4ub(D3DCOLOR_B_R(diffuseColor),
|
||||||
|
@ -4029,7 +4029,7 @@ static void WINE_GLAPI diffuse_d3dcolor(const void *data)
|
||||||
|
|
||||||
static void WINE_GLAPI specular_d3dcolor(const void *data)
|
static void WINE_GLAPI specular_d3dcolor(const void *data)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->c.gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->gl_info;
|
||||||
DWORD specularColor = *((const DWORD *)data);
|
DWORD specularColor = *((const DWORD *)data);
|
||||||
GLubyte d[] =
|
GLubyte d[] =
|
||||||
{
|
{
|
||||||
|
@ -4048,7 +4048,7 @@ static void WINE_GLAPI warn_no_specular_func(const void *data)
|
||||||
|
|
||||||
static void WINE_GLAPI generic_d3dcolor(GLuint idx, const void *data)
|
static void WINE_GLAPI generic_d3dcolor(GLuint idx, const void *data)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->c.gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->gl_info;
|
||||||
DWORD color = *((const DWORD *)data);
|
DWORD color = *((const DWORD *)data);
|
||||||
|
|
||||||
gl_info->gl_ops.ext.p_glVertexAttrib4Nub(idx,
|
gl_info->gl_ops.ext.p_glVertexAttrib4Nub(idx,
|
||||||
|
@ -4058,7 +4058,7 @@ static void WINE_GLAPI generic_d3dcolor(GLuint idx, const void *data)
|
||||||
|
|
||||||
static void WINE_GLAPI generic_short2n(GLuint idx, const void *data)
|
static void WINE_GLAPI generic_short2n(GLuint idx, const void *data)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->c.gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->gl_info;
|
||||||
const GLshort s[] = {((const GLshort *)data)[0], ((const GLshort *)data)[1], 0, 1};
|
const GLshort s[] = {((const GLshort *)data)[0], ((const GLshort *)data)[1], 0, 1};
|
||||||
|
|
||||||
gl_info->gl_ops.ext.p_glVertexAttrib4Nsv(idx, s);
|
gl_info->gl_ops.ext.p_glVertexAttrib4Nsv(idx, s);
|
||||||
|
@ -4067,14 +4067,14 @@ static void WINE_GLAPI generic_short2n(GLuint idx, const void *data)
|
||||||
static void WINE_GLAPI generic_ushort2n(GLuint idx, const void *data)
|
static void WINE_GLAPI generic_ushort2n(GLuint idx, const void *data)
|
||||||
{
|
{
|
||||||
const GLushort s[] = {((const GLushort *)data)[0], ((const GLushort *)data)[1], 0, 1};
|
const GLushort s[] = {((const GLushort *)data)[0], ((const GLushort *)data)[1], 0, 1};
|
||||||
const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->c.gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->gl_info;
|
||||||
|
|
||||||
gl_info->gl_ops.ext.p_glVertexAttrib4Nusv(idx, s);
|
gl_info->gl_ops.ext.p_glVertexAttrib4Nusv(idx, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WINE_GLAPI generic_float16_2(GLuint idx, const void *data)
|
static void WINE_GLAPI generic_float16_2(GLuint idx, const void *data)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->c.gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->gl_info;
|
||||||
float x = float_16_to_32(((const unsigned short *)data) + 0);
|
float x = float_16_to_32(((const unsigned short *)data) + 0);
|
||||||
float y = float_16_to_32(((const unsigned short *)data) + 1);
|
float y = float_16_to_32(((const unsigned short *)data) + 1);
|
||||||
|
|
||||||
|
@ -4083,7 +4083,7 @@ static void WINE_GLAPI generic_float16_2(GLuint idx, const void *data)
|
||||||
|
|
||||||
static void WINE_GLAPI generic_float16_4(GLuint idx, const void *data)
|
static void WINE_GLAPI generic_float16_4(GLuint idx, const void *data)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->c.gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl_get_current()->gl_info;
|
||||||
float x = float_16_to_32(((const unsigned short *)data) + 0);
|
float x = float_16_to_32(((const unsigned short *)data) + 0);
|
||||||
float y = float_16_to_32(((const unsigned short *)data) + 1);
|
float y = float_16_to_32(((const unsigned short *)data) + 1);
|
||||||
float z = float_16_to_32(((const unsigned short *)data) + 2);
|
float z = float_16_to_32(((const unsigned short *)data) + 2);
|
||||||
|
|
|
@ -542,7 +542,7 @@ static void shader_arb_load_np2fixup_constants(const struct arb_ps_np2fixup_info
|
||||||
static void shader_arb_ps_local_constants(const struct arb_ps_compiled_shader *gl_shader,
|
static void shader_arb_ps_local_constants(const struct arb_ps_compiled_shader *gl_shader,
|
||||||
const struct wined3d_context_gl *context_gl, const struct wined3d_state *state, unsigned int rt_height)
|
const struct wined3d_context_gl *context_gl, const struct wined3d_state *state, unsigned int rt_height)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
unsigned char i;
|
unsigned char i;
|
||||||
|
|
||||||
for(i = 0; i < gl_shader->numbumpenvmatconsts; i++)
|
for(i = 0; i < gl_shader->numbumpenvmatconsts; i++)
|
||||||
|
@ -606,7 +606,7 @@ static void shader_arb_ps_local_constants(const struct arb_ps_compiled_shader *g
|
||||||
static void shader_arb_vs_local_constants(const struct arb_vs_compiled_shader *gl_shader,
|
static void shader_arb_vs_local_constants(const struct arb_vs_compiled_shader *gl_shader,
|
||||||
const struct wined3d_context_gl *context_gl, const struct wined3d_state *state)
|
const struct wined3d_context_gl *context_gl, const struct wined3d_state *state)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
float position_fixup[4];
|
float position_fixup[4];
|
||||||
unsigned char i;
|
unsigned char i;
|
||||||
|
|
||||||
|
@ -646,7 +646,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv, str
|
||||||
const struct wined3d_state *state, BOOL use_ps, BOOL use_vs, BOOL from_shader_select)
|
const struct wined3d_state *state, BOOL use_ps, BOOL use_vs, BOOL from_shader_select)
|
||||||
{
|
{
|
||||||
const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info;
|
const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (!from_shader_select)
|
if (!from_shader_select)
|
||||||
{
|
{
|
||||||
|
@ -4242,7 +4242,7 @@ static struct arb_ps_compiled_shader *find_arb_pshader(struct wined3d_context_gl
|
||||||
struct wined3d_shader *shader, const struct arb_ps_compile_args *args)
|
struct wined3d_shader *shader, const struct arb_ps_compile_args *args)
|
||||||
{
|
{
|
||||||
const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info;
|
const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_device *device = shader->device;
|
struct wined3d_device *device = shader->device;
|
||||||
UINT i;
|
UINT i;
|
||||||
DWORD new_size;
|
DWORD new_size;
|
||||||
|
@ -4427,7 +4427,7 @@ static void find_arb_ps_compile_args(const struct wined3d_state *state,
|
||||||
struct arb_ps_compile_args *args)
|
struct arb_ps_compile_args *args)
|
||||||
{
|
{
|
||||||
const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info;
|
const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
int i;
|
int i;
|
||||||
WORD int_skip;
|
WORD int_skip;
|
||||||
|
|
||||||
|
@ -4483,7 +4483,7 @@ static void find_arb_vs_compile_args(const struct wined3d_state *state,
|
||||||
struct arb_vs_compile_args *args)
|
struct arb_vs_compile_args *args)
|
||||||
{
|
{
|
||||||
const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info;
|
const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
const struct wined3d_device *device = shader->device;
|
const struct wined3d_device *device = shader->device;
|
||||||
const struct wined3d_adapter *adapter = device->adapter;
|
const struct wined3d_adapter *adapter = device->adapter;
|
||||||
int i;
|
int i;
|
||||||
|
@ -4560,7 +4560,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context
|
||||||
const struct wined3d_state *state)
|
const struct wined3d_state *state)
|
||||||
{
|
{
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
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->gl_info;
|
||||||
struct shader_arb_priv *priv = shader_priv;
|
struct shader_arb_priv *priv = shader_priv;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -4650,7 +4650,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context
|
||||||
else
|
else
|
||||||
ps_input_sig = &state->shader[WINED3D_SHADER_TYPE_PIXEL]->input_signature;
|
ps_input_sig = &state->shader[WINED3D_SHADER_TYPE_PIXEL]->input_signature;
|
||||||
|
|
||||||
compiled = find_arb_vshader(vs, context->gl_info, context->stream_info.use_map,
|
compiled = find_arb_vshader(vs, gl_info, context->stream_info.use_map,
|
||||||
&compile_args, ps_input_sig);
|
&compile_args, ps_input_sig);
|
||||||
priv->current_vprogram_id = compiled->prgId;
|
priv->current_vprogram_id = compiled->prgId;
|
||||||
priv->compiled_vprog = compiled;
|
priv->compiled_vprog = compiled;
|
||||||
|
@ -4703,7 +4703,8 @@ static void shader_arb_select_compute(void *shader_priv, struct wined3d_context
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
static void shader_arb_disable(void *shader_priv, struct wined3d_context *context)
|
static void shader_arb_disable(void *shader_priv, struct wined3d_context *context)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct shader_arb_priv *priv = shader_priv;
|
struct shader_arb_priv *priv = shader_priv;
|
||||||
|
|
||||||
if (gl_info->supported[ARB_FRAGMENT_PROGRAM])
|
if (gl_info->supported[ARB_FRAGMENT_PROGRAM])
|
||||||
|
@ -4749,7 +4750,7 @@ static void shader_arb_destroy(struct wined3d_shader *shader)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
context = context_acquire(device, NULL, 0);
|
context = context_acquire(device, NULL, 0);
|
||||||
gl_info = context->gl_info;
|
gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
if (shader_is_pshader_version(shader->reg_maps.shader_version.type))
|
if (shader_is_pshader_version(shader->reg_maps.shader_version.type))
|
||||||
{
|
{
|
||||||
|
@ -5688,7 +5689,7 @@ struct arbfp_ffp_desc
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
static void arbfp_enable(const struct wined3d_context *context, BOOL enable)
|
static void arbfp_enable(const struct wined3d_context *context, BOOL enable)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl_const(context)->gl_info;
|
||||||
|
|
||||||
if (enable)
|
if (enable)
|
||||||
{
|
{
|
||||||
|
@ -5728,7 +5729,7 @@ static void arbfp_free_ffpshader(struct wine_rb_entry *entry, void *param)
|
||||||
struct wined3d_context_gl *context_gl = param;
|
struct wined3d_context_gl *context_gl = param;
|
||||||
const struct wined3d_gl_info *gl_info;
|
const struct wined3d_gl_info *gl_info;
|
||||||
|
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
GL_EXTCALL(glDeleteProgramsARB(1, &entry_arb->shader));
|
GL_EXTCALL(glDeleteProgramsARB(1, &entry_arb->shader));
|
||||||
checkGLcall("delete ffp program");
|
checkGLcall("delete ffp program");
|
||||||
heap_free(entry_arb);
|
heap_free(entry_arb);
|
||||||
|
@ -5795,7 +5796,8 @@ static DWORD arbfp_get_emul_mask(const struct wined3d_gl_info *gl_info)
|
||||||
static void state_texfactor_arbfp(struct wined3d_context *context,
|
static void state_texfactor_arbfp(struct wined3d_context *context,
|
||||||
const struct wined3d_state *state, DWORD state_id)
|
const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_device *device = context->device;
|
struct wined3d_device *device = context->device;
|
||||||
struct wined3d_color color;
|
struct wined3d_color color;
|
||||||
|
|
||||||
|
@ -5822,7 +5824,8 @@ static void state_tss_constant_arbfp(struct wined3d_context *context,
|
||||||
const struct wined3d_state *state, DWORD state_id)
|
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);
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_device *device = context->device;
|
struct wined3d_device *device = context->device;
|
||||||
struct wined3d_color color;
|
struct wined3d_color color;
|
||||||
|
|
||||||
|
@ -5849,7 +5852,8 @@ static void state_tss_constant_arbfp(struct wined3d_context *context,
|
||||||
static void state_arb_specularenable(struct wined3d_context *context,
|
static void state_arb_specularenable(struct wined3d_context *context,
|
||||||
const struct wined3d_state *state, DWORD state_id)
|
const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_device *device = context->device;
|
struct wined3d_device *device = context->device;
|
||||||
float col[4];
|
float col[4];
|
||||||
|
|
||||||
|
@ -5884,7 +5888,8 @@ static void state_arb_specularenable(struct wined3d_context *context,
|
||||||
static void set_bumpmat_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void set_bumpmat_arbfp(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);
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_device *device = context->device;
|
struct wined3d_device *device = context->device;
|
||||||
float mat[2][2];
|
float mat[2][2];
|
||||||
|
|
||||||
|
@ -5915,7 +5920,8 @@ static void tex_bumpenvlum_arbfp(struct wined3d_context *context,
|
||||||
const struct wined3d_state *state, DWORD state_id)
|
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);
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_device *device = context->device;
|
struct wined3d_device *device = context->device;
|
||||||
float param[4];
|
float param[4];
|
||||||
|
|
||||||
|
@ -5944,7 +5950,8 @@ static void tex_bumpenvlum_arbfp(struct wined3d_context *context,
|
||||||
|
|
||||||
static void alpha_test_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void alpha_test_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
int glParm;
|
int glParm;
|
||||||
float ref;
|
float ref;
|
||||||
|
|
||||||
|
@ -5974,8 +5981,9 @@ static void alpha_test_arbfp(struct wined3d_context *context, const struct wined
|
||||||
|
|
||||||
static void color_key_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void color_key_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
const struct wined3d_texture *texture = state->textures[0];
|
const struct wined3d_texture *texture = state->textures[0];
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
|
||||||
struct wined3d_device *device = context->device;
|
struct wined3d_device *device = context->device;
|
||||||
struct wined3d_color float_key[2];
|
struct wined3d_color float_key[2];
|
||||||
|
|
||||||
|
@ -6549,7 +6557,8 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, con
|
||||||
|
|
||||||
static void fragment_prog_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void fragment_prog_arbfp(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
const struct wined3d_device *device = context->device;
|
const struct wined3d_device *device = context->device;
|
||||||
struct shader_arb_priv *priv = device->fragment_priv;
|
struct shader_arb_priv *priv = device->fragment_priv;
|
||||||
BOOL use_pshader = use_ps(state);
|
BOOL use_pshader = use_ps(state);
|
||||||
|
@ -6913,7 +6922,7 @@ static void arbfp_free_blit_shader(struct wine_rb_entry *entry, void *ctx)
|
||||||
struct wined3d_context_gl *context_gl;
|
struct wined3d_context_gl *context_gl;
|
||||||
|
|
||||||
context_gl = ctx;
|
context_gl = ctx;
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
GL_EXTCALL(glDeleteProgramsARB(1, &entry_arb->shader));
|
GL_EXTCALL(glDeleteProgramsARB(1, &entry_arb->shader));
|
||||||
checkGLcall("glDeleteProgramsARB(1, &entry_arb->shader)");
|
checkGLcall("glDeleteProgramsARB(1, &entry_arb->shader)");
|
||||||
|
@ -6924,12 +6933,12 @@ static void arbfp_free_blit_shader(struct wine_rb_entry *entry, void *ctx)
|
||||||
static void arbfp_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_context *context)
|
static void arbfp_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_context *context)
|
||||||
{
|
{
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
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->gl_info;
|
||||||
struct wined3d_arbfp_blitter *arbfp_blitter;
|
struct wined3d_arbfp_blitter *arbfp_blitter;
|
||||||
struct wined3d_blitter *next;
|
struct wined3d_blitter *next;
|
||||||
|
|
||||||
if ((next = blitter->next))
|
if ((next = blitter->next))
|
||||||
next->ops->blitter_destroy(next, context);
|
next->ops->blitter_destroy(next, &context_gl->c);
|
||||||
|
|
||||||
arbfp_blitter = CONTAINING_RECORD(blitter, struct wined3d_arbfp_blitter, blitter);
|
arbfp_blitter = CONTAINING_RECORD(blitter, struct wined3d_arbfp_blitter, blitter);
|
||||||
|
|
||||||
|
@ -7362,7 +7371,7 @@ static void arbfp_blitter_upload_palette(struct wined3d_arbfp_blitter *blitter,
|
||||||
const struct wined3d_texture_gl *texture_gl, struct wined3d_context_gl *context_gl)
|
const struct wined3d_texture_gl *texture_gl, struct wined3d_context_gl *context_gl)
|
||||||
{
|
{
|
||||||
const struct wined3d_palette *palette = texture_gl->t.swapchain ? texture_gl->t.swapchain->palette : NULL;
|
const struct wined3d_palette *palette = texture_gl->t.swapchain ? texture_gl->t.swapchain->palette : NULL;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (!blitter->palette_texture)
|
if (!blitter->palette_texture)
|
||||||
gl_info->gl_ops.gl.p_glGenTextures(1, &blitter->palette_texture);
|
gl_info->gl_ops.gl.p_glGenTextures(1, &blitter->palette_texture);
|
||||||
|
@ -7564,7 +7573,7 @@ static HRESULT arbfp_blit_set(struct wined3d_arbfp_blitter *blitter, struct wine
|
||||||
const struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx,
|
const struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx,
|
||||||
const struct wined3d_color_key *color_key)
|
const struct wined3d_color_key *color_key)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
enum complex_fixup fixup;
|
enum complex_fixup fixup;
|
||||||
struct wine_rb_entry *entry;
|
struct wine_rb_entry *entry;
|
||||||
struct arbfp_blit_type type;
|
struct arbfp_blit_type type;
|
||||||
|
@ -7931,10 +7940,10 @@ static DWORD arbfp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bl
|
||||||
src_sub_resource_idx, src_rect, dst_rect, filter);
|
src_sub_resource_idx, src_rect, dst_rect, filter);
|
||||||
|
|
||||||
/* Leave the opengl state valid for blitting */
|
/* Leave the opengl state valid for blitting */
|
||||||
arbfp_blit_unset(context->gl_info);
|
arbfp_blit_unset(context_gl->gl_info);
|
||||||
|
|
||||||
if (dst_texture->swapchain && (dst_texture->swapchain->front_buffer == dst_texture))
|
if (dst_texture->swapchain && (dst_texture->swapchain->front_buffer == dst_texture))
|
||||||
context->gl_info->gl_ops.gl.p_glFlush();
|
context_gl->gl_info->gl_ops.gl.p_glFlush();
|
||||||
|
|
||||||
if (staging_texture)
|
if (staging_texture)
|
||||||
wined3d_texture_decref(staging_texture);
|
wined3d_texture_decref(staging_texture);
|
||||||
|
|
|
@ -950,8 +950,9 @@ static GLuint gen_ati_shader(const struct texture_stage_op op[WINED3D_MAX_TEXTUR
|
||||||
|
|
||||||
static void atifs_tfactor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void atifs_tfactor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
|
||||||
struct atifs_context_private_data *ctx_priv = context->fragment_pipe_data;
|
struct atifs_context_private_data *ctx_priv = context->fragment_pipe_data;
|
||||||
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_color color;
|
struct wined3d_color color;
|
||||||
|
|
||||||
if (!ctx_priv->last_shader
|
if (!ctx_priv->last_shader
|
||||||
|
@ -966,7 +967,8 @@ static void atifs_tfactor(struct wined3d_context *context, const struct wined3d_
|
||||||
static void set_bumpmat(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void set_bumpmat(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);
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
float mat[2][2];
|
float mat[2][2];
|
||||||
struct atifs_context_private_data *ctx_priv = context->fragment_pipe_data;
|
struct atifs_context_private_data *ctx_priv = context->fragment_pipe_data;
|
||||||
|
|
||||||
|
@ -995,8 +997,9 @@ static void set_bumpmat(struct wined3d_context *context, const struct wined3d_st
|
||||||
static void atifs_stage_constant(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void atifs_stage_constant(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);
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
|
||||||
struct atifs_context_private_data *ctx_priv = context->fragment_pipe_data;
|
struct atifs_context_private_data *ctx_priv = context->fragment_pipe_data;
|
||||||
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_color color;
|
struct wined3d_color color;
|
||||||
|
|
||||||
if (!ctx_priv->last_shader
|
if (!ctx_priv->last_shader
|
||||||
|
@ -1014,7 +1017,7 @@ static void set_tex_op_atifs(struct wined3d_context *context, const struct wined
|
||||||
const struct atifs_ffp_desc *desc, *last_shader = ctx_priv->last_shader;
|
const struct atifs_ffp_desc *desc, *last_shader = ctx_priv->last_shader;
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
const struct wined3d_d3d_info *d3d_info = context->d3d_info;
|
const struct wined3d_d3d_info *d3d_info = context->d3d_info;
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
const struct wined3d_device *device = context->device;
|
const struct wined3d_device *device = context->device;
|
||||||
struct atifs_private_data *priv = device->fragment_priv;
|
struct atifs_private_data *priv = device->fragment_priv;
|
||||||
struct ffp_frag_settings settings;
|
struct ffp_frag_settings settings;
|
||||||
|
@ -1252,7 +1255,7 @@ static const struct wined3d_state_entry_template atifs_fragmentstate_template[]
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
static void atifs_enable(const struct wined3d_context *context, BOOL enable)
|
static void atifs_enable(const struct wined3d_context *context, BOOL enable)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl_const(context)->gl_info;
|
||||||
|
|
||||||
if (enable)
|
if (enable)
|
||||||
{
|
{
|
||||||
|
@ -1338,7 +1341,7 @@ static void atifs_free_ffpshader(struct wine_rb_entry *entry, void *param)
|
||||||
struct wined3d_context_gl *context_gl = param;
|
struct wined3d_context_gl *context_gl = param;
|
||||||
const struct wined3d_gl_info *gl_info;
|
const struct wined3d_gl_info *gl_info;
|
||||||
|
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
GL_EXTCALL(glDeleteFragmentShaderATI(entry_ati->shader));
|
GL_EXTCALL(glDeleteFragmentShaderATI(entry_ati->shader));
|
||||||
checkGLcall("glDeleteFragmentShaderATI(entry->shader)");
|
checkGLcall("glDeleteFragmentShaderATI(entry->shader)");
|
||||||
heap_free(entry_ati);
|
heap_free(entry_ati);
|
||||||
|
|
|
@ -142,7 +142,7 @@ static void wined3d_buffer_gl_bind(struct wined3d_buffer_gl *buffer_gl, struct w
|
||||||
static void wined3d_buffer_gl_destroy_buffer_object(struct wined3d_buffer_gl *buffer_gl,
|
static void wined3d_buffer_gl_destroy_buffer_object(struct wined3d_buffer_gl *buffer_gl,
|
||||||
struct wined3d_context_gl *context_gl)
|
struct wined3d_context_gl *context_gl)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_resource *resource = &buffer_gl->b.resource;
|
struct wined3d_resource *resource = &buffer_gl->b.resource;
|
||||||
|
|
||||||
if (!buffer_gl->buffer_object)
|
if (!buffer_gl->buffer_object)
|
||||||
|
@ -198,7 +198,7 @@ static void wined3d_buffer_gl_destroy_buffer_object(struct wined3d_buffer_gl *bu
|
||||||
static BOOL wined3d_buffer_gl_create_buffer_object(struct wined3d_buffer_gl *buffer_gl,
|
static BOOL wined3d_buffer_gl_create_buffer_object(struct wined3d_buffer_gl *buffer_gl,
|
||||||
struct wined3d_context_gl *context_gl)
|
struct wined3d_context_gl *context_gl)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
GLenum gl_usage = GL_STATIC_DRAW;
|
GLenum gl_usage = GL_STATIC_DRAW;
|
||||||
GLenum error;
|
GLenum error;
|
||||||
|
|
||||||
|
@ -540,7 +540,7 @@ static void wined3d_buffer_gl_upload_ranges(struct wined3d_buffer_gl *buffer_gl,
|
||||||
const void *data, unsigned int data_offset, unsigned int range_count, const struct wined3d_map_range *ranges)
|
const void *data, unsigned int data_offset, unsigned int range_count, const struct wined3d_map_range *ranges)
|
||||||
{
|
{
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
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->gl_info;
|
||||||
const struct wined3d_map_range *range;
|
const struct wined3d_map_range *range;
|
||||||
|
|
||||||
wined3d_buffer_gl_bind(buffer_gl, context_gl);
|
wined3d_buffer_gl_bind(buffer_gl, context_gl);
|
||||||
|
@ -649,7 +649,7 @@ BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer,
|
||||||
{
|
{
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
struct wined3d_buffer_gl *buffer_gl = wined3d_buffer_gl(buffer);
|
struct wined3d_buffer_gl *buffer_gl = wined3d_buffer_gl(buffer);
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
TRACE("buffer %p, context %p, location %s.\n",
|
TRACE("buffer %p, context %p, location %s.\n",
|
||||||
buffer, context, wined3d_debug_location(location));
|
buffer, context, wined3d_debug_location(location));
|
||||||
|
@ -1057,7 +1057,7 @@ static HRESULT wined3d_buffer_gl_map(struct wined3d_buffer_gl *buffer_gl,
|
||||||
|
|
||||||
context = context_acquire(device, NULL, 0);
|
context = context_acquire(device, NULL, 0);
|
||||||
context_gl = wined3d_context_gl(context);
|
context_gl = wined3d_context_gl(context);
|
||||||
gl_info = context->gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (flags & WINED3D_MAP_DISCARD)
|
if (flags & WINED3D_MAP_DISCARD)
|
||||||
wined3d_buffer_validate_location(&buffer_gl->b, WINED3D_LOCATION_BUFFER);
|
wined3d_buffer_validate_location(&buffer_gl->b, WINED3D_LOCATION_BUFFER);
|
||||||
|
@ -1178,7 +1178,7 @@ static void wined3d_buffer_gl_unmap(struct wined3d_buffer_gl *buffer_gl)
|
||||||
|
|
||||||
context = context_acquire(device, NULL, 0);
|
context = context_acquire(device, NULL, 0);
|
||||||
context_gl = wined3d_context_gl(context);
|
context_gl = wined3d_context_gl(context);
|
||||||
gl_info = context->gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
wined3d_buffer_gl_bind(buffer_gl, context_gl);
|
wined3d_buffer_gl_bind(buffer_gl, context_gl);
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ static DWORD wined3d_context_tls_idx;
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
static void wined3d_context_gl_bind_fbo(struct wined3d_context_gl *context_gl, GLenum target, GLuint fbo)
|
static void wined3d_context_gl_bind_fbo(struct wined3d_context_gl *context_gl, GLenum target, GLuint fbo)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
switch (target)
|
switch (target)
|
||||||
{
|
{
|
||||||
|
@ -101,7 +101,7 @@ static void context_clean_fbo_attachments(const struct wined3d_gl_info *gl_info,
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
static void wined3d_context_gl_destroy_fbo(struct wined3d_context_gl *context_gl, GLuint fbo)
|
static void wined3d_context_gl_destroy_fbo(struct wined3d_context_gl *context_gl, GLuint fbo)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
wined3d_context_gl_bind_fbo(context_gl, GL_FRAMEBUFFER, fbo);
|
wined3d_context_gl_bind_fbo(context_gl, GL_FRAMEBUFFER, fbo);
|
||||||
context_clean_fbo_attachments(gl_info, GL_FRAMEBUFFER);
|
context_clean_fbo_attachments(gl_info, GL_FRAMEBUFFER);
|
||||||
|
@ -130,7 +130,7 @@ static void context_attach_depth_stencil_rb(const struct wined3d_gl_info *gl_inf
|
||||||
static void wined3d_context_gl_attach_gl_texture_fbo(struct wined3d_context_gl *context_gl,
|
static void wined3d_context_gl_attach_gl_texture_fbo(struct wined3d_context_gl *context_gl,
|
||||||
GLenum fbo_target, GLenum attachment, const struct wined3d_fbo_resource *resource)
|
GLenum fbo_target, GLenum attachment, const struct wined3d_fbo_resource *resource)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (!resource)
|
if (!resource)
|
||||||
{
|
{
|
||||||
|
@ -177,7 +177,7 @@ static void wined3d_context_gl_attach_depth_stencil_fbo(struct wined3d_context_g
|
||||||
GLenum fbo_target, const struct wined3d_fbo_resource *resource, BOOL rb_namespace,
|
GLenum fbo_target, const struct wined3d_fbo_resource *resource, BOOL rb_namespace,
|
||||||
uint32_t flags)
|
uint32_t flags)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (resource->object)
|
if (resource->object)
|
||||||
{
|
{
|
||||||
|
@ -216,7 +216,7 @@ static void wined3d_context_gl_attach_depth_stencil_fbo(struct wined3d_context_g
|
||||||
static void wined3d_context_gl_attach_surface_fbo(struct wined3d_context_gl *context_gl,
|
static void wined3d_context_gl_attach_surface_fbo(struct wined3d_context_gl *context_gl,
|
||||||
GLenum fbo_target, unsigned int idx, const struct wined3d_fbo_resource *resource, BOOL rb_namespace)
|
GLenum fbo_target, unsigned int idx, const struct wined3d_fbo_resource *resource, BOOL rb_namespace)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
TRACE("Attach GL object %u to %u.\n", resource->object, idx);
|
TRACE("Attach GL object %u to %u.\n", resource->object, idx);
|
||||||
|
|
||||||
|
@ -380,7 +380,7 @@ static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info, G
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
void wined3d_context_gl_check_fbo_status(const struct wined3d_context_gl *context_gl, GLenum target)
|
void wined3d_context_gl_check_fbo_status(const struct wined3d_context_gl *context_gl, GLenum target)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
GLenum status;
|
GLenum status;
|
||||||
|
|
||||||
if (!FIXME_ON(d3d))
|
if (!FIXME_ON(d3d))
|
||||||
|
@ -502,7 +502,7 @@ static void wined3d_context_gl_generate_fbo_key(const struct wined3d_context_gl
|
||||||
struct wined3d_fbo_entry_key *key, const struct wined3d_rendertarget_info *render_targets,
|
struct wined3d_fbo_entry_key *key, const struct wined3d_rendertarget_info *render_targets,
|
||||||
const struct wined3d_rendertarget_info *depth_stencil, DWORD color_location, DWORD ds_location)
|
const struct wined3d_rendertarget_info *depth_stencil, DWORD color_location, DWORD ds_location)
|
||||||
{
|
{
|
||||||
unsigned int buffers = context_gl->c.gl_info->limits.buffers;
|
unsigned int buffers = context_gl->gl_info->limits.buffers;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
key->rb_namespace = 0;
|
key->rb_namespace = 0;
|
||||||
|
@ -518,7 +518,7 @@ static struct fbo_entry *wined3d_context_gl_create_fbo_entry(const struct wined3
|
||||||
const struct wined3d_rendertarget_info *render_targets, const struct wined3d_rendertarget_info *depth_stencil,
|
const struct wined3d_rendertarget_info *render_targets, const struct wined3d_rendertarget_info *depth_stencil,
|
||||||
DWORD color_location, DWORD ds_location)
|
DWORD color_location, DWORD ds_location)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct fbo_entry *entry;
|
struct fbo_entry *entry;
|
||||||
|
|
||||||
entry = heap_alloc(sizeof(*entry));
|
entry = heap_alloc(sizeof(*entry));
|
||||||
|
@ -545,7 +545,7 @@ static void wined3d_context_gl_reuse_fbo_entry(struct wined3d_context_gl *contex
|
||||||
const struct wined3d_rendertarget_info *render_targets, const struct wined3d_rendertarget_info *depth_stencil,
|
const struct wined3d_rendertarget_info *render_targets, const struct wined3d_rendertarget_info *depth_stencil,
|
||||||
DWORD color_location, DWORD ds_location, struct fbo_entry *entry)
|
DWORD color_location, DWORD ds_location, struct fbo_entry *entry)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
wined3d_context_gl_bind_fbo(context_gl, target, entry->id);
|
wined3d_context_gl_bind_fbo(context_gl, target, entry->id);
|
||||||
context_clean_fbo_attachments(gl_info, target);
|
context_clean_fbo_attachments(gl_info, target);
|
||||||
|
@ -581,7 +581,7 @@ static struct fbo_entry *wined3d_context_gl_find_fbo_entry(struct wined3d_contex
|
||||||
DWORD color_location, DWORD ds_location)
|
DWORD color_location, DWORD ds_location)
|
||||||
{
|
{
|
||||||
static const struct wined3d_rendertarget_info ds_null = {{0}};
|
static const struct wined3d_rendertarget_info ds_null = {{0}};
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_texture *rt_texture, *ds_texture;
|
struct wined3d_texture *rt_texture, *ds_texture;
|
||||||
struct wined3d_fbo_entry_key fbo_key;
|
struct wined3d_fbo_entry_key fbo_key;
|
||||||
unsigned int i, ds_level, rt_level;
|
unsigned int i, ds_level, rt_level;
|
||||||
|
@ -711,7 +711,7 @@ static struct fbo_entry *wined3d_context_gl_find_fbo_entry(struct wined3d_contex
|
||||||
static void wined3d_context_gl_apply_fbo_entry(struct wined3d_context_gl *context_gl,
|
static void wined3d_context_gl_apply_fbo_entry(struct wined3d_context_gl *context_gl,
|
||||||
GLenum target, struct fbo_entry *entry)
|
GLenum target, struct fbo_entry *entry)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
GLuint read_binding, draw_binding;
|
GLuint read_binding, draw_binding;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
@ -820,7 +820,7 @@ void wined3d_context_gl_apply_fbo_state_blit(struct wined3d_context_gl *context_
|
||||||
void wined3d_context_gl_alloc_occlusion_query(struct wined3d_context_gl *context_gl,
|
void wined3d_context_gl_alloc_occlusion_query(struct wined3d_context_gl *context_gl,
|
||||||
struct wined3d_occlusion_query *query)
|
struct wined3d_occlusion_query *query)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (context_gl->free_occlusion_query_count)
|
if (context_gl->free_occlusion_query_count)
|
||||||
{
|
{
|
||||||
|
@ -867,7 +867,7 @@ void wined3d_context_gl_free_occlusion_query(struct wined3d_occlusion_query *que
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
void wined3d_context_gl_alloc_fence(struct wined3d_context_gl *context_gl, struct wined3d_fence *fence)
|
void wined3d_context_gl_alloc_fence(struct wined3d_context_gl *context_gl, struct wined3d_fence *fence)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (context_gl->free_fence_count)
|
if (context_gl->free_fence_count)
|
||||||
{
|
{
|
||||||
|
@ -928,7 +928,7 @@ void wined3d_context_gl_free_fence(struct wined3d_fence *fence)
|
||||||
void wined3d_context_gl_alloc_timestamp_query(struct wined3d_context_gl *context_gl,
|
void wined3d_context_gl_alloc_timestamp_query(struct wined3d_context_gl *context_gl,
|
||||||
struct wined3d_timestamp_query *query)
|
struct wined3d_timestamp_query *query)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (context_gl->free_timestamp_query_count)
|
if (context_gl->free_timestamp_query_count)
|
||||||
{
|
{
|
||||||
|
@ -967,7 +967,7 @@ void wined3d_context_gl_free_timestamp_query(struct wined3d_timestamp_query *que
|
||||||
void wined3d_context_gl_alloc_so_statistics_query(struct wined3d_context_gl *context_gl,
|
void wined3d_context_gl_alloc_so_statistics_query(struct wined3d_context_gl *context_gl,
|
||||||
struct wined3d_so_statistics_query *query)
|
struct wined3d_so_statistics_query *query)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (context_gl->free_so_statistics_query_count)
|
if (context_gl->free_so_statistics_query_count)
|
||||||
{
|
{
|
||||||
|
@ -1008,7 +1008,7 @@ void wined3d_context_gl_free_so_statistics_query(struct wined3d_so_statistics_qu
|
||||||
void wined3d_context_gl_alloc_pipeline_statistics_query(struct wined3d_context_gl *context_gl,
|
void wined3d_context_gl_alloc_pipeline_statistics_query(struct wined3d_context_gl *context_gl,
|
||||||
struct wined3d_pipeline_statistics_query *query)
|
struct wined3d_pipeline_statistics_query *query)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (context_gl->free_pipeline_statistics_query_count)
|
if (context_gl->free_pipeline_statistics_query_count)
|
||||||
{
|
{
|
||||||
|
@ -1052,7 +1052,7 @@ static void wined3d_context_gl_enum_fbo_entries(const struct wined3d_device *dev
|
||||||
for (i = 0; i < device->context_count; ++i)
|
for (i = 0; i < device->context_count; ++i)
|
||||||
{
|
{
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(device->contexts[i]);
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(device->contexts[i]);
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct fbo_entry *entry, *entry2;
|
struct fbo_entry *entry, *entry2;
|
||||||
|
|
||||||
LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &context_gl->fbo_list, struct fbo_entry, entry)
|
LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &context_gl->fbo_list, struct fbo_entry, entry)
|
||||||
|
@ -1105,7 +1105,7 @@ void context_gl_resource_released(struct wined3d_device *device, GLuint name, BO
|
||||||
void wined3d_context_gl_texture_update(struct wined3d_context_gl *context_gl,
|
void wined3d_context_gl_texture_update(struct wined3d_context_gl *context_gl,
|
||||||
const struct wined3d_texture_gl *texture_gl)
|
const struct wined3d_texture_gl *texture_gl)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct fbo_entry *entry = context_gl->current_fbo;
|
struct fbo_entry *entry = context_gl->current_fbo;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
@ -1126,12 +1126,12 @@ void wined3d_context_gl_texture_update(struct wined3d_context_gl *context_gl,
|
||||||
|
|
||||||
static BOOL wined3d_context_gl_restore_pixel_format(struct wined3d_context_gl *context_gl)
|
static BOOL wined3d_context_gl_restore_pixel_format(struct wined3d_context_gl *context_gl)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
BOOL ret = FALSE;
|
BOOL ret = FALSE;
|
||||||
|
|
||||||
if (context_gl->restore_pf && IsWindow(context_gl->restore_pf_win))
|
if (context_gl->restore_pf && IsWindow(context_gl->restore_pf_win))
|
||||||
{
|
{
|
||||||
if (context_gl->c.gl_info->supported[WGL_WINE_PIXEL_FORMAT_PASSTHROUGH])
|
if (gl_info->supported[WGL_WINE_PIXEL_FORMAT_PASSTHROUGH])
|
||||||
{
|
{
|
||||||
HDC dc = GetDCEx(context_gl->restore_pf_win, 0, DCX_USESTYLE | DCX_CACHE);
|
HDC dc = GetDCEx(context_gl->restore_pf_win, 0, DCX_USESTYLE | DCX_CACHE);
|
||||||
if (dc)
|
if (dc)
|
||||||
|
@ -1158,7 +1158,7 @@ static BOOL wined3d_context_gl_restore_pixel_format(struct wined3d_context_gl *c
|
||||||
|
|
||||||
static BOOL wined3d_context_gl_set_pixel_format(struct wined3d_context_gl *context_gl)
|
static BOOL wined3d_context_gl_set_pixel_format(struct wined3d_context_gl *context_gl)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
BOOL private = context_gl->dc_is_private;
|
BOOL private = context_gl->dc_is_private;
|
||||||
int format = context_gl->pixel_format;
|
int format = context_gl->pixel_format;
|
||||||
HDC dc = context_gl->dc;
|
HDC dc = context_gl->dc;
|
||||||
|
@ -1335,7 +1335,7 @@ void wined3d_context_cleanup(struct wined3d_context *context)
|
||||||
static void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl)
|
static void wined3d_context_gl_cleanup(struct wined3d_context_gl *context_gl)
|
||||||
{
|
{
|
||||||
struct wined3d_pipeline_statistics_query *pipeline_statistics_query;
|
struct wined3d_pipeline_statistics_query *pipeline_statistics_query;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_so_statistics_query *so_statistics_query;
|
struct wined3d_so_statistics_query *so_statistics_query;
|
||||||
struct wined3d_timestamp_query *timestamp_query;
|
struct wined3d_timestamp_query *timestamp_query;
|
||||||
struct wined3d_occlusion_query *occlusion_query;
|
struct wined3d_occlusion_query *occlusion_query;
|
||||||
|
@ -1524,14 +1524,14 @@ BOOL wined3d_context_gl_set_current(struct wined3d_context_gl *context_gl)
|
||||||
{
|
{
|
||||||
TRACE("Switching away from destroyed context %p.\n", old);
|
TRACE("Switching away from destroyed context %p.\n", old);
|
||||||
wined3d_context_gl_cleanup(old);
|
wined3d_context_gl_cleanup(old);
|
||||||
heap_free((void *)old->c.gl_info);
|
heap_free((void *)old->gl_info);
|
||||||
heap_free(old);
|
heap_free(old);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (wglGetCurrentContext())
|
if (wglGetCurrentContext())
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = old->c.gl_info;
|
const struct wined3d_gl_info *gl_info = old->gl_info;
|
||||||
TRACE("Flushing context %p before switching to %p.\n", old, context_gl);
|
TRACE("Flushing context %p before switching to %p.\n", old, context_gl);
|
||||||
gl_info->gl_ops.gl.p_glFlush();
|
gl_info->gl_ops.gl.p_glFlush();
|
||||||
}
|
}
|
||||||
|
@ -1589,7 +1589,7 @@ void wined3d_context_gl_release(struct wined3d_context_gl *context_gl)
|
||||||
if (context_gl->restore_ctx)
|
if (context_gl->restore_ctx)
|
||||||
{
|
{
|
||||||
TRACE("Restoring GL context %p on device context %p.\n", context_gl->restore_ctx, context_gl->restore_dc);
|
TRACE("Restoring GL context %p on device context %p.\n", context_gl->restore_ctx, context_gl->restore_dc);
|
||||||
context_restore_gl_context(context_gl->c.gl_info, context_gl->restore_dc, context_gl->restore_ctx);
|
context_restore_gl_context(context_gl->gl_info, context_gl->restore_dc, context_gl->restore_ctx);
|
||||||
context_gl->restore_ctx = NULL;
|
context_gl->restore_ctx = NULL;
|
||||||
context_gl->restore_dc = NULL;
|
context_gl->restore_dc = NULL;
|
||||||
}
|
}
|
||||||
|
@ -1634,7 +1634,7 @@ static void wined3d_context_gl_enter(struct wined3d_context_gl *context_gl)
|
||||||
context_gl->needs_set = 1;
|
context_gl->needs_set = 1;
|
||||||
}
|
}
|
||||||
else if (!context_gl->needs_set && !(context_gl->dc_is_private && context_gl->dc_has_format)
|
else if (!context_gl->needs_set && !(context_gl->dc_is_private && context_gl->dc_has_format)
|
||||||
&& context_gl->pixel_format != context_gl->c.gl_info->gl_ops.wgl.p_wglGetPixelFormat(context_gl->dc))
|
&& context_gl->pixel_format != context_gl->gl_info->gl_ops.wgl.p_wglGetPixelFormat(context_gl->dc))
|
||||||
context_gl->needs_set = 1;
|
context_gl->needs_set = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1764,7 +1764,7 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC
|
||||||
void wined3d_context_gl_bind_dummy_textures(const struct wined3d_context_gl *context_gl)
|
void wined3d_context_gl_bind_dummy_textures(const struct wined3d_context_gl *context_gl)
|
||||||
{
|
{
|
||||||
const struct wined3d_dummy_textures *textures = &wined3d_device_gl(context_gl->c.device)->dummy_textures;
|
const struct wined3d_dummy_textures *textures = &wined3d_device_gl(context_gl->c.device)->dummy_textures;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < gl_info->limits.combined_samplers; ++i)
|
for (i = 0; i < gl_info->limits.combined_samplers; ++i)
|
||||||
|
@ -1903,7 +1903,6 @@ static void wined3d_context_init(struct wined3d_context *context, struct wined3d
|
||||||
struct wined3d_device *device = swapchain->device;
|
struct wined3d_device *device = swapchain->device;
|
||||||
DWORD state;
|
DWORD state;
|
||||||
|
|
||||||
context->gl_info = &device->adapter->gl_info;
|
|
||||||
context->d3d_info = &device->adapter->d3d_info;
|
context->d3d_info = &device->adapter->d3d_info;
|
||||||
context->state_table = device->state_table;
|
context->state_table = device->state_table;
|
||||||
|
|
||||||
|
@ -1954,7 +1953,8 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi
|
||||||
wined3d_context_init(&context_gl->c, swapchain);
|
wined3d_context_init(&context_gl->c, swapchain);
|
||||||
|
|
||||||
device = context->device;
|
device = context->device;
|
||||||
gl_info = context->gl_info;
|
gl_info = &device->adapter->gl_info;
|
||||||
|
context_gl->gl_info = gl_info;
|
||||||
d3d_info = context->d3d_info;
|
d3d_info = context->d3d_info;
|
||||||
|
|
||||||
context_gl->tid = GetCurrentThreadId();
|
context_gl->tid = GetCurrentThreadId();
|
||||||
|
@ -2339,8 +2339,8 @@ void wined3d_context_gl_destroy(struct wined3d_context_gl *context_gl)
|
||||||
/* Make a copy of gl_info for wined3d_context_gl_cleanup() use, the
|
/* Make a copy of gl_info for wined3d_context_gl_cleanup() use, the
|
||||||
* one in wined3d_adapter may go away in the meantime. */
|
* one in wined3d_adapter may go away in the meantime. */
|
||||||
gl_info = heap_alloc(sizeof(*gl_info));
|
gl_info = heap_alloc(sizeof(*gl_info));
|
||||||
*gl_info = *context_gl->c.gl_info;
|
*gl_info = *context_gl->gl_info;
|
||||||
context_gl->c.gl_info = gl_info;
|
context_gl->gl_info = gl_info;
|
||||||
context_gl->c.destroyed = 1;
|
context_gl->c.destroyed = 1;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -2354,7 +2354,7 @@ void wined3d_context_gl_destroy(struct wined3d_context_gl *context_gl)
|
||||||
const unsigned int *wined3d_context_gl_get_tex_unit_mapping(const struct wined3d_context_gl *context_gl,
|
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)
|
const struct wined3d_shader_version *shader_version, unsigned int *base, unsigned int *count)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (!shader_version)
|
if (!shader_version)
|
||||||
{
|
{
|
||||||
|
@ -2411,7 +2411,7 @@ static void wined3d_context_gl_get_rt_size(const struct wined3d_context_gl *cont
|
||||||
|
|
||||||
void wined3d_context_gl_enable_clip_distances(struct wined3d_context_gl *context_gl, uint32_t enable_mask)
|
void wined3d_context_gl_enable_clip_distances(struct wined3d_context_gl *context_gl, uint32_t enable_mask)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
unsigned int clip_distance_count, i;
|
unsigned int clip_distance_count, i;
|
||||||
uint32_t disable_mask, current_mask;
|
uint32_t disable_mask, current_mask;
|
||||||
|
|
||||||
|
@ -2450,7 +2450,7 @@ static inline GLenum draw_buffer_from_rt_mask(DWORD rt_mask)
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
static void wined3d_context_gl_apply_draw_buffers(struct wined3d_context_gl *context_gl, uint32_t rt_mask)
|
static void wined3d_context_gl_apply_draw_buffers(struct wined3d_context_gl *context_gl, uint32_t rt_mask)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
GLenum draw_buffers[MAX_RENDER_TARGET_VIEWS];
|
GLenum draw_buffers[MAX_RENDER_TARGET_VIEWS];
|
||||||
|
|
||||||
if (!rt_mask)
|
if (!rt_mask)
|
||||||
|
@ -2499,7 +2499,7 @@ static void wined3d_context_gl_apply_draw_buffers(struct wined3d_context_gl *con
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
void wined3d_context_gl_set_draw_buffer(struct wined3d_context_gl *context_gl, GLenum buffer)
|
void wined3d_context_gl_set_draw_buffer(struct wined3d_context_gl *context_gl, GLenum buffer)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct fbo_entry *current_fbo = context_gl->current_fbo;
|
struct fbo_entry *current_fbo = context_gl->current_fbo;
|
||||||
uint32_t new_mask = context_generate_rt_mask(buffer);
|
uint32_t new_mask = context_generate_rt_mask(buffer);
|
||||||
uint32_t *current_mask;
|
uint32_t *current_mask;
|
||||||
|
@ -2525,7 +2525,7 @@ void wined3d_context_gl_active_texture(struct wined3d_context_gl *context_gl,
|
||||||
|
|
||||||
void wined3d_context_gl_bind_bo(struct wined3d_context_gl *context_gl, GLenum binding, GLuint name)
|
void wined3d_context_gl_bind_bo(struct wined3d_context_gl *context_gl, GLenum binding, GLuint name)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (binding == GL_ELEMENT_ARRAY_BUFFER)
|
if (binding == GL_ELEMENT_ARRAY_BUFFER)
|
||||||
context_invalidate_state(&context_gl->c, STATE_INDEXBUFFER);
|
context_invalidate_state(&context_gl->c, STATE_INDEXBUFFER);
|
||||||
|
@ -2536,7 +2536,7 @@ void wined3d_context_gl_bind_bo(struct wined3d_context_gl *context_gl, GLenum bi
|
||||||
void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, GLenum target, GLuint name)
|
void wined3d_context_gl_bind_texture(struct wined3d_context_gl *context_gl, GLenum target, GLuint name)
|
||||||
{
|
{
|
||||||
const struct wined3d_dummy_textures *textures = &wined3d_device_gl(context_gl->c.device)->dummy_textures;
|
const struct wined3d_dummy_textures *textures = &wined3d_device_gl(context_gl->c.device)->dummy_textures;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
GLenum old_texture_type;
|
GLenum old_texture_type;
|
||||||
unsigned int unit;
|
unsigned int unit;
|
||||||
|
|
||||||
|
@ -2606,7 +2606,7 @@ void *wined3d_context_gl_map_bo_address(struct wined3d_context_gl *context_gl,
|
||||||
if (!data->buffer_object)
|
if (!data->buffer_object)
|
||||||
return data->addr;
|
return data->addr;
|
||||||
|
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
wined3d_context_gl_bind_bo(context_gl, binding, data->buffer_object);
|
wined3d_context_gl_bind_bo(context_gl, binding, data->buffer_object);
|
||||||
|
|
||||||
if (gl_info->supported[ARB_MAP_BUFFER_RANGE])
|
if (gl_info->supported[ARB_MAP_BUFFER_RANGE])
|
||||||
|
@ -2634,7 +2634,7 @@ void wined3d_context_gl_unmap_bo_address(struct wined3d_context_gl *context_gl,
|
||||||
if (!data->buffer_object)
|
if (!data->buffer_object)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
wined3d_context_gl_bind_bo(context_gl, binding, data->buffer_object);
|
wined3d_context_gl_bind_bo(context_gl, binding, data->buffer_object);
|
||||||
GL_EXTCALL(glUnmapBuffer(binding));
|
GL_EXTCALL(glUnmapBuffer(binding));
|
||||||
wined3d_context_gl_bind_bo(context_gl, binding, 0);
|
wined3d_context_gl_bind_bo(context_gl, binding, 0);
|
||||||
|
@ -2648,7 +2648,7 @@ void wined3d_context_gl_copy_bo_address(struct wined3d_context_gl *context_gl,
|
||||||
const struct wined3d_gl_info *gl_info;
|
const struct wined3d_gl_info *gl_info;
|
||||||
BYTE *dst_ptr, *src_ptr;
|
BYTE *dst_ptr, *src_ptr;
|
||||||
|
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (dst->buffer_object && src->buffer_object)
|
if (dst->buffer_object && src->buffer_object)
|
||||||
{
|
{
|
||||||
|
@ -2696,14 +2696,14 @@ static void wined3d_context_gl_set_render_offscreen(struct wined3d_context_gl *c
|
||||||
|
|
||||||
context_invalidate_state(&context_gl->c, STATE_VIEWPORT);
|
context_invalidate_state(&context_gl->c, STATE_VIEWPORT);
|
||||||
context_invalidate_state(&context_gl->c, STATE_SCISSORRECT);
|
context_invalidate_state(&context_gl->c, STATE_SCISSORRECT);
|
||||||
if (!context_gl->c.gl_info->supported[ARB_CLIP_CONTROL])
|
if (!context_gl->gl_info->supported[ARB_CLIP_CONTROL])
|
||||||
{
|
{
|
||||||
context_invalidate_state(&context_gl->c, STATE_RASTERIZER);
|
context_invalidate_state(&context_gl->c, STATE_RASTERIZER);
|
||||||
context_invalidate_state(&context_gl->c, STATE_POINTSPRITECOORDORIGIN);
|
context_invalidate_state(&context_gl->c, STATE_POINTSPRITECOORDORIGIN);
|
||||||
context_invalidate_state(&context_gl->c, STATE_TRANSFORM(WINED3D_TS_PROJECTION));
|
context_invalidate_state(&context_gl->c, STATE_TRANSFORM(WINED3D_TS_PROJECTION));
|
||||||
}
|
}
|
||||||
context_invalidate_state(&context_gl->c, STATE_SHADER(WINED3D_SHADER_TYPE_DOMAIN));
|
context_invalidate_state(&context_gl->c, STATE_SHADER(WINED3D_SHADER_TYPE_DOMAIN));
|
||||||
if (context_gl->c.gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS])
|
if (context_gl->gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS])
|
||||||
context_invalidate_state(&context_gl->c, STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL));
|
context_invalidate_state(&context_gl->c, STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL));
|
||||||
context_gl->c.render_offscreen = offscreen;
|
context_gl->c.render_offscreen = offscreen;
|
||||||
}
|
}
|
||||||
|
@ -2747,7 +2747,7 @@ void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl,
|
||||||
|
|
||||||
TRACE("Setting up context %p for blitting.\n", context);
|
TRACE("Setting up context %p for blitting.\n", context);
|
||||||
|
|
||||||
gl_info = context->gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
rt = context->current_rt.texture;
|
rt = context->current_rt.texture;
|
||||||
|
|
||||||
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO)
|
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO)
|
||||||
|
@ -2877,7 +2877,7 @@ void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl,
|
||||||
static void wined3d_context_gl_apply_blit_projection(const struct wined3d_context_gl *context_gl,
|
static void wined3d_context_gl_apply_blit_projection(const struct wined3d_context_gl *context_gl,
|
||||||
unsigned int w, unsigned int h)
|
unsigned int w, unsigned int h)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
const GLdouble projection[] =
|
const GLdouble projection[] =
|
||||||
{
|
{
|
||||||
2.0 / w, 0.0, 0.0, 0.0,
|
2.0 / w, 0.0, 0.0, 0.0,
|
||||||
|
@ -2899,7 +2899,7 @@ void wined3d_context_gl_apply_ffp_blit_state(struct wined3d_context_gl *context_
|
||||||
const struct wined3d_gl_info *gl_info;
|
const struct wined3d_gl_info *gl_info;
|
||||||
unsigned int i, sampler;
|
unsigned int i, sampler;
|
||||||
|
|
||||||
gl_info = context->gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
|
if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
|
||||||
ERR("Applying fixed-function state without legacy context support.\n");
|
ERR("Applying fixed-function state without legacy context support.\n");
|
||||||
|
|
||||||
|
@ -3002,7 +3002,7 @@ BOOL wined3d_context_gl_apply_clear_state(struct wined3d_context_gl *context_gl,
|
||||||
const struct wined3d_state *state, unsigned int rt_count, const struct wined3d_fb_state *fb)
|
const struct wined3d_state *state, unsigned int rt_count, const struct wined3d_fb_state *fb)
|
||||||
{
|
{
|
||||||
struct wined3d_rendertarget_view * const *rts = fb->render_targets;
|
struct wined3d_rendertarget_view * const *rts = fb->render_targets;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_rendertarget_view *dsv = fb->depth_stencil;
|
struct wined3d_rendertarget_view *dsv = fb->depth_stencil;
|
||||||
uint32_t rt_mask = 0, *cur_mask;
|
uint32_t rt_mask = 0, *cur_mask;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
@ -3121,7 +3121,7 @@ static uint32_t find_draw_buffers_mask(const struct wined3d_context_gl *context_
|
||||||
{
|
{
|
||||||
struct wined3d_rendertarget_view * const *rts = state->fb->render_targets;
|
struct wined3d_rendertarget_view * const *rts = state->fb->render_targets;
|
||||||
struct wined3d_shader *ps = state->shader[WINED3D_SHADER_TYPE_PIXEL];
|
struct wined3d_shader *ps = state->shader[WINED3D_SHADER_TYPE_PIXEL];
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
unsigned int rt_mask, mask;
|
unsigned int rt_mask, mask;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
@ -3168,7 +3168,7 @@ void context_state_fb(struct wined3d_context *context, const struct wined3d_stat
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
memset(context_gl->blit_targets, 0, sizeof(context_gl->blit_targets));
|
memset(context_gl->blit_targets, 0, sizeof(context_gl->blit_targets));
|
||||||
for (i = 0; i < context->gl_info->limits.buffers; ++i)
|
for (i = 0; i < context_gl->gl_info->limits.buffers; ++i)
|
||||||
{
|
{
|
||||||
if (!fb->render_targets[i])
|
if (!fb->render_targets[i])
|
||||||
continue;
|
continue;
|
||||||
|
@ -3380,7 +3380,7 @@ static void wined3d_context_gl_map_vsamplers(struct wined3d_context_gl *context_
|
||||||
const struct wined3d_shader_resource_info *vs_resource_info =
|
const struct wined3d_shader_resource_info *vs_resource_info =
|
||||||
state->shader[WINED3D_SHADER_TYPE_VERTEX]->reg_maps.resource_info;
|
state->shader[WINED3D_SHADER_TYPE_VERTEX]->reg_maps.resource_info;
|
||||||
const struct wined3d_shader_resource_info *ps_resource_info = NULL;
|
const struct wined3d_shader_resource_info *ps_resource_info = NULL;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
int start = min(WINED3D_MAX_COMBINED_SAMPLERS, gl_info->limits.graphics_samplers) - 1;
|
int start = min(WINED3D_MAX_COMBINED_SAMPLERS, gl_info->limits.graphics_samplers) - 1;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -3420,7 +3420,7 @@ static void wined3d_context_gl_map_vsamplers(struct wined3d_context_gl *context_
|
||||||
static void wined3d_context_gl_update_tex_unit_map(struct wined3d_context_gl *context_gl,
|
static void wined3d_context_gl_update_tex_unit_map(struct wined3d_context_gl *context_gl,
|
||||||
const struct wined3d_state *state)
|
const struct wined3d_state *state)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
BOOL vs = use_vs(state);
|
BOOL vs = use_vs(state);
|
||||||
BOOL ps = use_ps(state);
|
BOOL ps = use_ps(state);
|
||||||
|
|
||||||
|
@ -3840,7 +3840,7 @@ static void context_load_unordered_access_resources(struct wined3d_context *cont
|
||||||
static void wined3d_context_gl_bind_unordered_access_views(struct wined3d_context_gl *context_gl,
|
static void wined3d_context_gl_bind_unordered_access_views(struct wined3d_context_gl *context_gl,
|
||||||
const struct wined3d_shader *shader, struct wined3d_unordered_access_view * const *views)
|
const struct wined3d_shader *shader, struct wined3d_unordered_access_view * const *views)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_unordered_access_view_gl *view_gl;
|
struct wined3d_unordered_access_view_gl *view_gl;
|
||||||
const struct wined3d_format_gl *format_gl;
|
const struct wined3d_format_gl *format_gl;
|
||||||
GLuint texture_name;
|
GLuint texture_name;
|
||||||
|
@ -3911,7 +3911,7 @@ static BOOL context_apply_draw_state(struct wined3d_context *context,
|
||||||
{
|
{
|
||||||
const struct wined3d_state_entry *state_table = context->state_table;
|
const struct wined3d_state_entry *state_table = context->state_table;
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
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->gl_info;
|
||||||
const struct wined3d_fb_state *fb = state->fb;
|
const struct wined3d_fb_state *fb = state->fb;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
WORD map;
|
WORD map;
|
||||||
|
@ -4018,7 +4018,7 @@ static void wined3d_context_gl_apply_compute_state(struct wined3d_context_gl *co
|
||||||
const struct wined3d_device *device, const struct wined3d_state *state)
|
const struct wined3d_device *device, const struct wined3d_state *state)
|
||||||
{
|
{
|
||||||
const struct wined3d_state_entry *state_table = context_gl->c.state_table;
|
const struct wined3d_state_entry *state_table = context_gl->c.state_table;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
unsigned int state_id, i;
|
unsigned int state_id, i;
|
||||||
|
|
||||||
context_load_shader_resources(&context_gl->c, state, 1u << WINED3D_SHADER_TYPE_COMPUTE);
|
context_load_shader_resources(&context_gl->c, state, 1u << WINED3D_SHADER_TYPE_COMPUTE);
|
||||||
|
@ -4085,7 +4085,7 @@ static BOOL use_transform_feedback(const struct wined3d_state *state)
|
||||||
|
|
||||||
void wined3d_context_gl_end_transform_feedback(struct wined3d_context_gl *context_gl)
|
void wined3d_context_gl_end_transform_feedback(struct wined3d_context_gl *context_gl)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (context_gl->c.transform_feedback_active)
|
if (context_gl->c.transform_feedback_active)
|
||||||
{
|
{
|
||||||
|
@ -4098,7 +4098,7 @@ void wined3d_context_gl_end_transform_feedback(struct wined3d_context_gl *contex
|
||||||
|
|
||||||
static void wined3d_context_gl_pause_transform_feedback(struct wined3d_context_gl *context_gl, BOOL force)
|
static void wined3d_context_gl_pause_transform_feedback(struct wined3d_context_gl *context_gl, BOOL force)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (!context_gl->c.transform_feedback_active || context_gl->c.transform_feedback_paused)
|
if (!context_gl->c.transform_feedback_active || context_gl->c.transform_feedback_paused)
|
||||||
return;
|
return;
|
||||||
|
@ -4296,7 +4296,7 @@ void dispatch_compute(struct wined3d_device *device, const struct wined3d_state
|
||||||
WARN("Invalid context, skipping dispatch.\n");
|
WARN("Invalid context, skipping dispatch.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (!gl_info->supported[ARB_COMPUTE_SHADER])
|
if (!gl_info->supported[ARB_COMPUTE_SHADER])
|
||||||
{
|
{
|
||||||
|
@ -4347,7 +4347,7 @@ static void wined3d_context_gl_draw_primitive_arrays(struct wined3d_context_gl *
|
||||||
const struct wined3d_ffp_attrib_ops *ops = &context_gl->c.d3d_info->ffp_attrib_ops;
|
const struct wined3d_ffp_attrib_ops *ops = &context_gl->c.d3d_info->ffp_attrib_ops;
|
||||||
GLenum idx_type = idx_size == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT;
|
GLenum idx_type = idx_size == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT;
|
||||||
const struct wined3d_stream_info *si = &context_gl->c.stream_info;
|
const struct wined3d_stream_info *si = &context_gl->c.stream_info;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
unsigned int instanced_elements[ARRAY_SIZE(si->elements)];
|
unsigned int instanced_elements[ARRAY_SIZE(si->elements)];
|
||||||
unsigned int instanced_element_count = 0;
|
unsigned int instanced_element_count = 0;
|
||||||
GLenum mode = state->gl_primitive_type;
|
GLenum mode = state->gl_primitive_type;
|
||||||
|
@ -4488,7 +4488,7 @@ static void draw_primitive_immediate_mode(struct wined3d_context_gl *context_gl,
|
||||||
{
|
{
|
||||||
const BYTE *position = NULL, *normal = NULL, *diffuse = NULL, *specular = NULL;
|
const BYTE *position = NULL, *normal = NULL, *diffuse = NULL, *specular = NULL;
|
||||||
const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info;
|
const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
unsigned int coord_idx, stride_idx, texture_idx, vertex_idx;
|
unsigned int coord_idx, stride_idx, texture_idx, vertex_idx;
|
||||||
const struct wined3d_stream_info_element *element;
|
const struct wined3d_stream_info_element *element;
|
||||||
const BYTE *tex_coords[WINED3DDP_MAXTEXCOORD];
|
const BYTE *tex_coords[WINED3DDP_MAXTEXCOORD];
|
||||||
|
@ -4705,7 +4705,7 @@ static void draw_primitive_immediate_mode(struct wined3d_context_gl *context_gl,
|
||||||
static void wined3d_context_gl_draw_indirect(struct wined3d_context_gl *context_gl, const struct wined3d_state *state,
|
static void wined3d_context_gl_draw_indirect(struct wined3d_context_gl *context_gl, const struct wined3d_state *state,
|
||||||
const struct wined3d_indirect_draw_parameters *parameters, unsigned int idx_size)
|
const struct wined3d_indirect_draw_parameters *parameters, unsigned int idx_size)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_buffer *buffer = parameters->buffer;
|
struct wined3d_buffer *buffer = parameters->buffer;
|
||||||
const void *offset;
|
const void *offset;
|
||||||
|
|
||||||
|
@ -4822,7 +4822,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
|
||||||
WARN("Invalid context, skipping draw.\n");
|
WARN("Invalid context, skipping draw.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gl_info = context->gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (!use_transform_feedback(state))
|
if (!use_transform_feedback(state))
|
||||||
wined3d_context_gl_pause_transform_feedback(context_gl, TRUE);
|
wined3d_context_gl_pause_transform_feedback(context_gl, TRUE);
|
||||||
|
@ -5014,7 +5014,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
|
||||||
|
|
||||||
void wined3d_context_gl_unload_tex_coords(const struct wined3d_context_gl *context_gl)
|
void wined3d_context_gl_unload_tex_coords(const struct wined3d_context_gl *context_gl)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
unsigned int texture_idx;
|
unsigned int texture_idx;
|
||||||
|
|
||||||
for (texture_idx = 0; texture_idx < gl_info->limits.texture_coords; ++texture_idx)
|
for (texture_idx = 0; texture_idx < gl_info->limits.texture_coords; ++texture_idx)
|
||||||
|
@ -5027,7 +5027,7 @@ void wined3d_context_gl_unload_tex_coords(const struct wined3d_context_gl *conte
|
||||||
void wined3d_context_gl_load_tex_coords(const struct wined3d_context_gl *context_gl,
|
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)
|
const struct wined3d_stream_info *si, GLuint *current_bo, const struct wined3d_state *state)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->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;
|
||||||
|
@ -5088,7 +5088,7 @@ void wined3d_context_gl_load_tex_coords(const struct wined3d_context_gl *context
|
||||||
/* This should match any arrays loaded in wined3d_context_gl_load_vertex_data(). */
|
/* This should match any arrays loaded in wined3d_context_gl_load_vertex_data(). */
|
||||||
static void wined3d_context_gl_unload_vertex_data(struct wined3d_context_gl *context_gl)
|
static void wined3d_context_gl_unload_vertex_data(struct wined3d_context_gl *context_gl)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (!context_gl->c.namedArraysLoaded)
|
if (!context_gl->c.namedArraysLoaded)
|
||||||
return;
|
return;
|
||||||
|
@ -5104,7 +5104,7 @@ static void wined3d_context_gl_unload_vertex_data(struct wined3d_context_gl *con
|
||||||
static void wined3d_context_gl_load_vertex_data(struct wined3d_context_gl *context_gl,
|
static void wined3d_context_gl_load_vertex_data(struct wined3d_context_gl *context_gl,
|
||||||
const struct wined3d_stream_info *si, const struct wined3d_state *state)
|
const struct wined3d_stream_info *si, const struct wined3d_state *state)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->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;
|
||||||
GLuint current_bo;
|
GLuint current_bo;
|
||||||
|
@ -5298,7 +5298,7 @@ static void wined3d_context_gl_load_vertex_data(struct wined3d_context_gl *conte
|
||||||
|
|
||||||
static void wined3d_context_gl_unload_numbered_array(struct wined3d_context_gl *context_gl, unsigned int i)
|
static void wined3d_context_gl_unload_numbered_array(struct wined3d_context_gl *context_gl, unsigned int i)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
GL_EXTCALL(glDisableVertexAttribArray(i));
|
GL_EXTCALL(glDisableVertexAttribArray(i));
|
||||||
checkGLcall("glDisableVertexAttribArray");
|
checkGLcall("glDisableVertexAttribArray");
|
||||||
|
@ -5325,7 +5325,7 @@ static void wined3d_context_gl_load_numbered_arrays(struct wined3d_context_gl *c
|
||||||
{
|
{
|
||||||
struct wined3d_context *context = &context_gl->c;
|
struct wined3d_context *context = &context_gl->c;
|
||||||
const struct wined3d_shader *vs = state->shader[WINED3D_SHADER_TYPE_VERTEX];
|
const struct wined3d_shader *vs = state->shader[WINED3D_SHADER_TYPE_VERTEX];
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
GLuint current_bo;
|
GLuint current_bo;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
@ -5581,7 +5581,7 @@ void wined3d_context_gl_draw_shaded_quad(struct wined3d_context_gl *context_gl,
|
||||||
unsigned int sub_resource_idx, const RECT *src_rect, const RECT *dst_rect,
|
unsigned int sub_resource_idx, const RECT *src_rect, const RECT *dst_rect,
|
||||||
enum wined3d_texture_filter_type filter)
|
enum wined3d_texture_filter_type filter)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_blt_info info;
|
struct wined3d_blt_info info;
|
||||||
unsigned int level, w, h, i;
|
unsigned int level, w, h, i;
|
||||||
SIZE dst_size;
|
SIZE dst_size;
|
||||||
|
@ -5666,7 +5666,7 @@ void wined3d_context_gl_draw_textured_quad(struct wined3d_context_gl *context_gl
|
||||||
struct wined3d_texture_gl *texture_gl, unsigned int sub_resource_idx,
|
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)
|
const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_blt_info info;
|
struct wined3d_blt_info info;
|
||||||
unsigned int level;
|
unsigned int level;
|
||||||
|
|
||||||
|
|
|
@ -1012,7 +1012,7 @@ static void wined3d_cs_exec_flush(struct wined3d_cs *cs, const void *data)
|
||||||
|
|
||||||
context_gl = wined3d_context_gl(context_acquire(cs->device, NULL, 0));
|
context_gl = wined3d_context_gl(context_acquire(cs->device, NULL, 0));
|
||||||
if (context_gl->valid)
|
if (context_gl->valid)
|
||||||
context_gl->c.gl_info->gl_ops.gl.p_glFlush();
|
context_gl->gl_info->gl_ops.gl.p_glFlush();
|
||||||
context_release(&context_gl->c);
|
context_release(&context_gl->c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -317,7 +317,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
|
||||||
WARN("Invalid context, skipping clear.\n");
|
WARN("Invalid context, skipping clear.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gl_info = context->gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
/* When we're clearing parts of the drawable, make sure that the target surface is well up to date in the
|
/* When we're clearing parts of the drawable, make sure that the target surface is well up to date in the
|
||||||
* drawable. After the clear we'll mark the drawable up to date, so we have to make sure that this is true
|
* drawable. After the clear we'll mark the drawable up to date, so we have to make sure that this is true
|
||||||
|
@ -682,7 +682,7 @@ static void wined3d_device_gl_create_dummy_textures(struct wined3d_device_gl *de
|
||||||
{
|
{
|
||||||
struct wined3d_dummy_textures *textures = &device_gl->dummy_textures;
|
struct wined3d_dummy_textures *textures = &device_gl->dummy_textures;
|
||||||
const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info;
|
const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
DWORD color;
|
DWORD color;
|
||||||
|
|
||||||
|
@ -816,7 +816,7 @@ static void wined3d_device_gl_destroy_dummy_textures(struct wined3d_device_gl *d
|
||||||
struct wined3d_context_gl *context_gl)
|
struct wined3d_context_gl *context_gl)
|
||||||
{
|
{
|
||||||
struct wined3d_dummy_textures *dummy_textures = &device_gl->dummy_textures;
|
struct wined3d_dummy_textures *dummy_textures = &device_gl->dummy_textures;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE])
|
if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE])
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,7 +39,7 @@ static void WINE_GLAPI wine_glMultiTexCoord1fARB(GLenum target, GLfloat s)
|
||||||
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wined3d_context_gl_get_current()->c.gl_info->gl_ops.gl.p_glTexCoord1f(s);
|
wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord1f(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WINE_GLAPI wine_glMultiTexCoord1fvARB(GLenum target, const GLfloat *v)
|
static void WINE_GLAPI wine_glMultiTexCoord1fvARB(GLenum target, const GLfloat *v)
|
||||||
|
@ -49,7 +49,7 @@ static void WINE_GLAPI wine_glMultiTexCoord1fvARB(GLenum target, const GLfloat *
|
||||||
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wined3d_context_gl_get_current()->c.gl_info->gl_ops.gl.p_glTexCoord1fv(v);
|
wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord1fv(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WINE_GLAPI wine_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t)
|
static void WINE_GLAPI wine_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t)
|
||||||
|
@ -59,7 +59,7 @@ static void WINE_GLAPI wine_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLflo
|
||||||
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wined3d_context_gl_get_current()->c.gl_info->gl_ops.gl.p_glTexCoord2f(s, t);
|
wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord2f(s, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WINE_GLAPI wine_glMultiTexCoord2fvARB(GLenum target, const GLfloat *v)
|
static void WINE_GLAPI wine_glMultiTexCoord2fvARB(GLenum target, const GLfloat *v)
|
||||||
|
@ -69,7 +69,7 @@ static void WINE_GLAPI wine_glMultiTexCoord2fvARB(GLenum target, const GLfloat *
|
||||||
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wined3d_context_gl_get_current()->c.gl_info->gl_ops.gl.p_glTexCoord2fv(v);
|
wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord2fv(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WINE_GLAPI wine_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r)
|
static void WINE_GLAPI wine_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r)
|
||||||
|
@ -79,7 +79,7 @@ static void WINE_GLAPI wine_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLflo
|
||||||
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wined3d_context_gl_get_current()->c.gl_info->gl_ops.gl.p_glTexCoord3f(s, t, r);
|
wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord3f(s, t, r);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WINE_GLAPI wine_glMultiTexCoord3fvARB(GLenum target, const GLfloat *v)
|
static void WINE_GLAPI wine_glMultiTexCoord3fvARB(GLenum target, const GLfloat *v)
|
||||||
|
@ -89,7 +89,7 @@ static void WINE_GLAPI wine_glMultiTexCoord3fvARB(GLenum target, const GLfloat *
|
||||||
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wined3d_context_gl_get_current()->c.gl_info->gl_ops.gl.p_glTexCoord3fv(v);
|
wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord3fv(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WINE_GLAPI wine_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
|
static void WINE_GLAPI wine_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
|
||||||
|
@ -99,7 +99,7 @@ static void WINE_GLAPI wine_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLflo
|
||||||
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wined3d_context_gl_get_current()->c.gl_info->gl_ops.gl.p_glTexCoord4f(s, t, r, q);
|
wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord4f(s, t, r, q);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WINE_GLAPI wine_glMultiTexCoord4fvARB(GLenum target, const GLfloat *v)
|
static void WINE_GLAPI wine_glMultiTexCoord4fvARB(GLenum target, const GLfloat *v)
|
||||||
|
@ -109,7 +109,7 @@ static void WINE_GLAPI wine_glMultiTexCoord4fvARB(GLenum target, const GLfloat *
|
||||||
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wined3d_context_gl_get_current()->c.gl_info->gl_ops.gl.p_glTexCoord4fv(v);
|
wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord4fv(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WINE_GLAPI wine_glMultiTexCoord2svARB(GLenum target, const GLshort *v)
|
static void WINE_GLAPI wine_glMultiTexCoord2svARB(GLenum target, const GLshort *v)
|
||||||
|
@ -119,7 +119,7 @@ static void WINE_GLAPI wine_glMultiTexCoord2svARB(GLenum target, const GLshort *
|
||||||
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wined3d_context_gl_get_current()->c.gl_info->gl_ops.gl.p_glTexCoord2sv(v);
|
wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord2sv(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WINE_GLAPI wine_glMultiTexCoord4svARB(GLenum target, const GLshort *v)
|
static void WINE_GLAPI wine_glMultiTexCoord4svARB(GLenum target, const GLshort *v)
|
||||||
|
@ -129,7 +129,7 @@ static void WINE_GLAPI wine_glMultiTexCoord4svARB(GLenum target, const GLshort *
|
||||||
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wined3d_context_gl_get_current()->c.gl_info->gl_ops.gl.p_glTexCoord4sv(v);
|
wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord4sv(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WINE_GLAPI wine_glActiveTexture(GLenum texture)
|
static void WINE_GLAPI wine_glActiveTexture(GLenum texture)
|
||||||
|
|
|
@ -742,7 +742,7 @@ static void shader_glsl_load_samplers(const struct wined3d_context *context,
|
||||||
struct shader_glsl_priv *priv, GLuint program_id, const struct wined3d_shader_reg_maps *reg_maps)
|
struct shader_glsl_priv *priv, GLuint program_id, const struct wined3d_shader_reg_maps *reg_maps)
|
||||||
{
|
{
|
||||||
const struct wined3d_context_gl *context_gl = wined3d_context_gl_const(context);
|
const struct wined3d_context_gl *context_gl = wined3d_context_gl_const(context);
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
const struct wined3d_shader_version *shader_version;
|
const struct wined3d_shader_version *shader_version;
|
||||||
const unsigned int *tex_unit_map;
|
const unsigned int *tex_unit_map;
|
||||||
unsigned int base, count;
|
unsigned int base, count;
|
||||||
|
@ -813,8 +813,8 @@ static void shader_glsl_load_program_resources(const struct wined3d_context_gl *
|
||||||
{
|
{
|
||||||
const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
|
const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
|
||||||
|
|
||||||
shader_glsl_init_uniform_block_bindings(context_gl->c.gl_info, priv, program_id, reg_maps);
|
shader_glsl_init_uniform_block_bindings(context_gl->gl_info, priv, program_id, reg_maps);
|
||||||
shader_glsl_load_icb(context_gl->c.gl_info, priv, program_id, reg_maps);
|
shader_glsl_load_icb(context_gl->gl_info, priv, program_id, reg_maps);
|
||||||
/* Texture unit mapping is set up to be the same each time the shader
|
/* Texture unit mapping is set up to be the same each time the shader
|
||||||
* program is used so we can hardcode the sampler uniform values. */
|
* program is used so we can hardcode the sampler uniform values. */
|
||||||
shader_glsl_load_samplers(&context_gl->c, priv, program_id, reg_maps);
|
shader_glsl_load_samplers(&context_gl->c, priv, program_id, reg_maps);
|
||||||
|
@ -951,7 +951,7 @@ static void shader_glsl_init_transform_feedback(const struct wined3d_context_gl
|
||||||
struct shader_glsl_priv *priv, GLuint program_id, struct wined3d_shader *shader)
|
struct shader_glsl_priv *priv, GLuint program_id, struct wined3d_shader *shader)
|
||||||
{
|
{
|
||||||
const struct wined3d_stream_output_desc *so_desc = &shader->u.gs.so_desc;
|
const struct wined3d_stream_output_desc *so_desc = &shader->u.gs.so_desc;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_string_buffer *buffer;
|
struct wined3d_string_buffer *buffer;
|
||||||
unsigned int i, count, length;
|
unsigned int i, count, length;
|
||||||
const char **varyings;
|
const char **varyings;
|
||||||
|
@ -1320,7 +1320,7 @@ static void transpose_matrix(struct wined3d_matrix *out, const struct wined3d_ma
|
||||||
static void shader_glsl_ffp_vertex_normalmatrix_uniform(const struct wined3d_context_gl *context_gl,
|
static void shader_glsl_ffp_vertex_normalmatrix_uniform(const struct wined3d_context_gl *context_gl,
|
||||||
const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
|
const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_matrix mv;
|
struct wined3d_matrix mv;
|
||||||
float mat[3 * 3];
|
float mat[3 * 3];
|
||||||
|
|
||||||
|
@ -1337,7 +1337,7 @@ static void shader_glsl_ffp_vertex_normalmatrix_uniform(const struct wined3d_con
|
||||||
static void shader_glsl_ffp_vertex_texmatrix_uniform(const struct wined3d_context_gl *context_gl,
|
static void shader_glsl_ffp_vertex_texmatrix_uniform(const struct wined3d_context_gl *context_gl,
|
||||||
const struct wined3d_state *state, unsigned int tex, struct glsl_shader_prog_link *prog)
|
const struct wined3d_state *state, unsigned int tex, struct glsl_shader_prog_link *prog)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_matrix mat;
|
struct wined3d_matrix mat;
|
||||||
|
|
||||||
if (tex >= WINED3D_MAX_TEXTURES)
|
if (tex >= WINED3D_MAX_TEXTURES)
|
||||||
|
@ -1353,7 +1353,7 @@ static void shader_glsl_ffp_vertex_texmatrix_uniform(const struct wined3d_contex
|
||||||
static void shader_glsl_ffp_vertex_material_uniform(const struct wined3d_context_gl *context_gl,
|
static void shader_glsl_ffp_vertex_material_uniform(const struct wined3d_context_gl *context_gl,
|
||||||
const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
|
const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (state->render_states[WINED3D_RS_SPECULARENABLE])
|
if (state->render_states[WINED3D_RS_SPECULARENABLE])
|
||||||
{
|
{
|
||||||
|
@ -1375,7 +1375,7 @@ static void shader_glsl_ffp_vertex_material_uniform(const struct wined3d_context
|
||||||
static void shader_glsl_ffp_vertex_lightambient_uniform(const struct wined3d_context_gl *context_gl,
|
static void shader_glsl_ffp_vertex_lightambient_uniform(const struct wined3d_context_gl *context_gl,
|
||||||
const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
|
const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_color color;
|
struct wined3d_color color;
|
||||||
|
|
||||||
wined3d_color_from_d3dcolor(&color, state->render_states[WINED3D_RS_AMBIENT]);
|
wined3d_color_from_d3dcolor(&color, state->render_states[WINED3D_RS_AMBIENT]);
|
||||||
|
@ -1388,7 +1388,7 @@ static void shader_glsl_ffp_vertex_light_uniform(const struct wined3d_context_gl
|
||||||
struct glsl_shader_prog_link *prog)
|
struct glsl_shader_prog_link *prog)
|
||||||
{
|
{
|
||||||
const struct wined3d_matrix *view = &state->transforms[WINED3D_TS_VIEW];
|
const struct wined3d_matrix *view = &state->transforms[WINED3D_TS_VIEW];
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_vec4 vec4;
|
struct wined3d_vec4 vec4;
|
||||||
|
|
||||||
GL_EXTCALL(glUniform4fv(prog->vs.light_location[light].diffuse, 1, &light_info->OriginalParms.diffuse.r));
|
GL_EXTCALL(glUniform4fv(prog->vs.light_location[light].diffuse, 1, &light_info->OriginalParms.diffuse.r));
|
||||||
|
@ -1441,9 +1441,9 @@ static void shader_glsl_ffp_vertex_light_uniform(const struct wined3d_context_gl
|
||||||
static void shader_glsl_pointsize_uniform(const struct wined3d_context_gl *context_gl,
|
static void shader_glsl_pointsize_uniform(const struct wined3d_context_gl *context_gl,
|
||||||
const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
|
const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
float min, max;
|
|
||||||
float size, att[3];
|
float size, att[3];
|
||||||
|
float min, max;
|
||||||
|
|
||||||
get_pointsize_minmax(&context_gl->c, state, &min, &max);
|
get_pointsize_minmax(&context_gl->c, state, &min, &max);
|
||||||
|
|
||||||
|
@ -1467,7 +1467,7 @@ static void shader_glsl_pointsize_uniform(const struct wined3d_context_gl *conte
|
||||||
static void shader_glsl_load_fog_uniform(const struct wined3d_context_gl *context_gl,
|
static void shader_glsl_load_fog_uniform(const struct wined3d_context_gl *context_gl,
|
||||||
const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
|
const struct wined3d_state *state, struct glsl_shader_prog_link *prog)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_color color;
|
struct wined3d_color color;
|
||||||
float start, end, scale;
|
float start, end, scale;
|
||||||
union
|
union
|
||||||
|
@ -1490,7 +1490,7 @@ static void shader_glsl_load_fog_uniform(const struct wined3d_context_gl *contex
|
||||||
static void shader_glsl_clip_plane_uniform(const struct wined3d_context_gl *context_gl,
|
static void shader_glsl_clip_plane_uniform(const struct wined3d_context_gl *context_gl,
|
||||||
const struct wined3d_state *state, unsigned int index, struct glsl_shader_prog_link *prog)
|
const struct wined3d_state *state, unsigned int index, struct glsl_shader_prog_link *prog)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_matrix matrix;
|
struct wined3d_matrix matrix;
|
||||||
struct wined3d_vec4 plane;
|
struct wined3d_vec4 plane;
|
||||||
|
|
||||||
|
@ -1527,7 +1527,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
|
||||||
const struct glsl_context_data *ctx_data = context->shader_backend_data;
|
const struct glsl_context_data *ctx_data = context->shader_backend_data;
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
struct glsl_shader_prog_link *prog = ctx_data->glsl_program;
|
struct glsl_shader_prog_link *prog = ctx_data->glsl_program;
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
float position_fixup[4 * WINED3D_MAX_VIEWPORTS];
|
float position_fixup[4 * WINED3D_MAX_VIEWPORTS];
|
||||||
struct shader_glsl_priv *priv = shader_priv;
|
struct shader_glsl_priv *priv = shader_priv;
|
||||||
unsigned int constant_version;
|
unsigned int constant_version;
|
||||||
|
@ -2158,7 +2158,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
||||||
const struct wined3d_shader_version *version = ®_maps->shader_version;
|
const struct wined3d_shader_version *version = ®_maps->shader_version;
|
||||||
const struct vs_compile_args *vs_args = ctx_priv->cur_vs_args;
|
const struct vs_compile_args *vs_args = ctx_priv->cur_vs_args;
|
||||||
const struct ps_compile_args *ps_args = ctx_priv->cur_ps_args;
|
const struct ps_compile_args *ps_args = ctx_priv->cur_ps_args;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
const struct wined3d_shader_indexable_temp *idx_temp_reg;
|
const struct wined3d_shader_indexable_temp *idx_temp_reg;
|
||||||
unsigned int uniform_block_base, uniform_block_count;
|
unsigned int uniform_block_base, uniform_block_count;
|
||||||
enum wined3d_shader_resource_type resource_type;
|
enum wined3d_shader_resource_type resource_type;
|
||||||
|
@ -7559,9 +7559,9 @@ static GLuint shader_glsl_generate_fragment_shader(const struct wined3d_context_
|
||||||
{
|
{
|
||||||
const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
|
const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
|
||||||
const struct wined3d_shader_version *version = ®_maps->shader_version;
|
const struct wined3d_shader_version *version = ®_maps->shader_version;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
const BOOL legacy_syntax = needs_legacy_glsl_syntax(gl_info);
|
|
||||||
const char *prefix = shader_glsl_get_prefix(version->type);
|
const char *prefix = shader_glsl_get_prefix(version->type);
|
||||||
|
BOOL legacy_syntax = needs_legacy_glsl_syntax(gl_info);
|
||||||
unsigned int i, extra_constants_needed = 0;
|
unsigned int i, extra_constants_needed = 0;
|
||||||
struct shader_glsl_ctx_priv priv_ctx;
|
struct shader_glsl_ctx_priv priv_ctx;
|
||||||
GLuint shader_id;
|
GLuint shader_id;
|
||||||
|
@ -7914,7 +7914,7 @@ static GLuint shader_glsl_generate_vertex_shader(const struct wined3d_context_gl
|
||||||
struct wined3d_string_buffer_list *string_buffers = &priv->string_buffers;
|
struct wined3d_string_buffer_list *string_buffers = &priv->string_buffers;
|
||||||
const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
|
const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
|
||||||
const struct wined3d_shader_version *version = ®_maps->shader_version;
|
const struct wined3d_shader_version *version = ®_maps->shader_version;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_string_buffer *buffer = &priv->shader_buffer;
|
struct wined3d_string_buffer *buffer = &priv->shader_buffer;
|
||||||
struct shader_glsl_ctx_priv priv_ctx;
|
struct shader_glsl_ctx_priv priv_ctx;
|
||||||
GLuint shader_id;
|
GLuint shader_id;
|
||||||
|
@ -8056,7 +8056,7 @@ static GLuint shader_glsl_generate_hull_shader(const struct wined3d_context_gl *
|
||||||
{
|
{
|
||||||
struct wined3d_string_buffer_list *string_buffers = &priv->string_buffers;
|
struct wined3d_string_buffer_list *string_buffers = &priv->string_buffers;
|
||||||
const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
|
const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_string_buffer *buffer = &priv->shader_buffer;
|
struct wined3d_string_buffer *buffer = &priv->shader_buffer;
|
||||||
const struct wined3d_hull_shader *hs = &shader->u.hs;
|
const struct wined3d_hull_shader *hs = &shader->u.hs;
|
||||||
const struct wined3d_shader_phase *phase;
|
const struct wined3d_shader_phase *phase;
|
||||||
|
@ -8152,7 +8152,7 @@ static GLuint shader_glsl_generate_domain_shader(const struct wined3d_context_gl
|
||||||
{
|
{
|
||||||
struct wined3d_string_buffer_list *string_buffers = &priv->string_buffers;
|
struct wined3d_string_buffer_list *string_buffers = &priv->string_buffers;
|
||||||
const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
|
const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_string_buffer *buffer = &priv->shader_buffer;
|
struct wined3d_string_buffer *buffer = &priv->shader_buffer;
|
||||||
struct shader_glsl_ctx_priv priv_ctx;
|
struct shader_glsl_ctx_priv priv_ctx;
|
||||||
GLuint shader_id;
|
GLuint shader_id;
|
||||||
|
@ -8246,7 +8246,7 @@ static GLuint shader_glsl_generate_geometry_shader(const struct wined3d_context_
|
||||||
{
|
{
|
||||||
struct wined3d_string_buffer_list *string_buffers = &priv->string_buffers;
|
struct wined3d_string_buffer_list *string_buffers = &priv->string_buffers;
|
||||||
const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
|
const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_string_buffer *buffer = &priv->shader_buffer;
|
struct wined3d_string_buffer *buffer = &priv->shader_buffer;
|
||||||
const struct wined3d_shader_signature_element *output;
|
const struct wined3d_shader_signature_element *output;
|
||||||
enum wined3d_primitive_type primitive_type;
|
enum wined3d_primitive_type primitive_type;
|
||||||
|
@ -8376,7 +8376,7 @@ static GLuint shader_glsl_generate_compute_shader(const struct wined3d_context_g
|
||||||
{
|
{
|
||||||
const struct wined3d_shader_thread_group_size *thread_group_size = &shader->u.cs.thread_group_size;
|
const struct wined3d_shader_thread_group_size *thread_group_size = &shader->u.cs.thread_group_size;
|
||||||
const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
|
const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct shader_glsl_ctx_priv priv_ctx;
|
struct shader_glsl_ctx_priv priv_ctx;
|
||||||
GLuint shader_id;
|
GLuint shader_id;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
@ -9404,7 +9404,7 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv *
|
||||||
enum wined3d_cmp_func alpha_test_func = settings->alpha_test_func + 1;
|
enum wined3d_cmp_func alpha_test_func = settings->alpha_test_func + 1;
|
||||||
struct wined3d_string_buffer *buffer = &priv->shader_buffer;
|
struct wined3d_string_buffer *buffer = &priv->shader_buffer;
|
||||||
BYTE lum_map = 0, bump_map = 0, tex_map = 0, tss_const_map = 0;
|
BYTE lum_map = 0, bump_map = 0, tex_map = 0, tss_const_map = 0;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
const BOOL legacy_syntax = needs_legacy_glsl_syntax(gl_info);
|
const BOOL legacy_syntax = needs_legacy_glsl_syntax(gl_info);
|
||||||
BOOL tempreg_used = FALSE, tfactor_used = FALSE;
|
BOOL tempreg_used = FALSE, tfactor_used = FALSE;
|
||||||
UINT lowest_disabled_stage;
|
UINT lowest_disabled_stage;
|
||||||
|
@ -10003,7 +10003,7 @@ static HRESULT shader_glsl_compile_compute_shader(struct shader_glsl_priv *priv,
|
||||||
const struct wined3d_context_gl *context_gl, struct wined3d_shader *shader)
|
const struct wined3d_context_gl *context_gl, struct wined3d_shader *shader)
|
||||||
{
|
{
|
||||||
struct glsl_context_data *ctx_data = context_gl->c.shader_backend_data;
|
struct glsl_context_data *ctx_data = context_gl->c.shader_backend_data;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_string_buffer *buffer = &priv->shader_buffer;
|
struct wined3d_string_buffer *buffer = &priv->shader_buffer;
|
||||||
struct glsl_cs_compiled_shader *gl_shaders;
|
struct glsl_cs_compiled_shader *gl_shaders;
|
||||||
struct glsl_shader_private *shader_data;
|
struct glsl_shader_private *shader_data;
|
||||||
|
@ -10129,7 +10129,7 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl,
|
||||||
struct shader_glsl_priv *priv, struct glsl_context_data *ctx_data)
|
struct shader_glsl_priv *priv, struct glsl_context_data *ctx_data)
|
||||||
{
|
{
|
||||||
const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info;
|
const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
const struct wined3d_shader *pre_rasterization_shader;
|
const struct wined3d_shader *pre_rasterization_shader;
|
||||||
const struct ps_np2fixup_info *np2fixup_info = NULL;
|
const struct ps_np2fixup_info *np2fixup_info = NULL;
|
||||||
struct wined3d_shader *hshader, *dshader, *gshader;
|
struct wined3d_shader *hshader, *dshader, *gshader;
|
||||||
|
@ -10568,7 +10568,7 @@ static void shader_glsl_select(void *shader_priv, struct wined3d_context *contex
|
||||||
{
|
{
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
struct glsl_context_data *ctx_data = context->shader_backend_data;
|
struct glsl_context_data *ctx_data = context->shader_backend_data;
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct shader_glsl_priv *priv = shader_priv;
|
struct shader_glsl_priv *priv = shader_priv;
|
||||||
struct glsl_shader_prog_link *glsl_program;
|
struct glsl_shader_prog_link *glsl_program;
|
||||||
GLenum current_vertex_color_clamp;
|
GLenum current_vertex_color_clamp;
|
||||||
|
@ -10628,7 +10628,7 @@ static void shader_glsl_select_compute(void *shader_priv, struct wined3d_context
|
||||||
{
|
{
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
struct glsl_context_data *ctx_data = context->shader_backend_data;
|
struct glsl_context_data *ctx_data = context->shader_backend_data;
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct shader_glsl_priv *priv = shader_priv;
|
struct shader_glsl_priv *priv = shader_priv;
|
||||||
GLuint program_id, prev_id;
|
GLuint program_id, prev_id;
|
||||||
|
|
||||||
|
@ -10668,8 +10668,9 @@ static void shader_glsl_invalidate_current_program(struct wined3d_context *conte
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
static void shader_glsl_disable(void *shader_priv, struct wined3d_context *context)
|
static void shader_glsl_disable(void *shader_priv, struct wined3d_context *context)
|
||||||
{
|
{
|
||||||
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
struct glsl_context_data *ctx_data = context->shader_backend_data;
|
struct glsl_context_data *ctx_data = context->shader_backend_data;
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct shader_glsl_priv *priv = shader_priv;
|
struct shader_glsl_priv *priv = shader_priv;
|
||||||
|
|
||||||
shader_glsl_invalidate_current_program(context);
|
shader_glsl_invalidate_current_program(context);
|
||||||
|
@ -10721,7 +10722,7 @@ static void shader_glsl_destroy(struct wined3d_shader *shader)
|
||||||
}
|
}
|
||||||
|
|
||||||
context = context_acquire(device, NULL, 0);
|
context = context_acquire(device, NULL, 0);
|
||||||
gl_info = context->gl_info;
|
gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
TRACE("Deleting linked programs.\n");
|
TRACE("Deleting linked programs.\n");
|
||||||
linked_programs = &shader->linked_programs;
|
linked_programs = &shader->linked_programs;
|
||||||
|
@ -11045,7 +11046,8 @@ static void shader_glsl_free_context_data(struct wined3d_context *context)
|
||||||
|
|
||||||
static void shader_glsl_init_context_state(struct wined3d_context *context)
|
static void shader_glsl_init_context_state(struct wined3d_context *context)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
gl_info->gl_ops.gl.p_glEnable(GL_PROGRAM_POINT_SIZE);
|
gl_info->gl_ops.gl.p_glEnable(GL_PROGRAM_POINT_SIZE);
|
||||||
checkGLcall("GL_PROGRAM_POINT_SIZE");
|
checkGLcall("GL_PROGRAM_POINT_SIZE");
|
||||||
|
@ -11478,7 +11480,7 @@ static void shader_glsl_free_ffp_vertex_shader(struct wine_rb_entry *entry, void
|
||||||
struct glsl_ffp_destroy_ctx *ctx = param;
|
struct glsl_ffp_destroy_ctx *ctx = param;
|
||||||
const struct wined3d_gl_info *gl_info;
|
const struct wined3d_gl_info *gl_info;
|
||||||
|
|
||||||
gl_info = ctx->context_gl->c.gl_info;
|
gl_info = ctx->context_gl->gl_info;
|
||||||
LIST_FOR_EACH_ENTRY_SAFE(program, program2, &shader->linked_programs,
|
LIST_FOR_EACH_ENTRY_SAFE(program, program2, &shader->linked_programs,
|
||||||
struct glsl_shader_prog_link, vs.shader_entry)
|
struct glsl_shader_prog_link, vs.shader_entry)
|
||||||
{
|
{
|
||||||
|
@ -11512,7 +11514,8 @@ static void glsl_vertex_pipe_shader(struct wined3d_context *context,
|
||||||
static void glsl_vertex_pipe_vdecl(struct wined3d_context *context,
|
static void glsl_vertex_pipe_vdecl(struct wined3d_context *context,
|
||||||
const struct wined3d_state *state, DWORD state_id)
|
const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
BOOL specular = !!(context->stream_info.use_map & (1u << WINED3D_FFP_SPECULAR));
|
BOOL specular = !!(context->stream_info.use_map & (1u << WINED3D_FFP_SPECULAR));
|
||||||
BOOL diffuse = !!(context->stream_info.use_map & (1u << WINED3D_FFP_DIFFUSE));
|
BOOL diffuse = !!(context->stream_info.use_map & (1u << WINED3D_FFP_DIFFUSE));
|
||||||
BOOL normal = !!(context->stream_info.use_map & (1u << WINED3D_FFP_NORMAL));
|
BOOL normal = !!(context->stream_info.use_map & (1u << WINED3D_FFP_NORMAL));
|
||||||
|
@ -11647,7 +11650,8 @@ static void glsl_vertex_pipe_vertexblend(struct wined3d_context *context,
|
||||||
|
|
||||||
static void glsl_vertex_pipe_view(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void glsl_vertex_pipe_view(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
unsigned int k;
|
unsigned int k;
|
||||||
|
|
||||||
context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_MODELVIEW
|
context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_MODELVIEW
|
||||||
|
@ -11763,7 +11767,8 @@ static void glsl_vertex_pipe_shademode(struct wined3d_context *context,
|
||||||
static void glsl_vertex_pipe_clip_plane(struct wined3d_context *context,
|
static void glsl_vertex_pipe_clip_plane(struct wined3d_context *context,
|
||||||
const struct wined3d_state *state, DWORD state_id)
|
const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
UINT index = state_id - STATE_CLIPPLANE(0);
|
UINT index = state_id - STATE_CLIPPLANE(0);
|
||||||
|
|
||||||
if (index >= gl_info->limits.user_clip_distances)
|
if (index >= gl_info->limits.user_clip_distances)
|
||||||
|
@ -11990,7 +11995,7 @@ static void shader_glsl_free_ffp_fragment_shader(struct wine_rb_entry *entry, vo
|
||||||
struct glsl_ffp_destroy_ctx *ctx = param;
|
struct glsl_ffp_destroy_ctx *ctx = param;
|
||||||
const struct wined3d_gl_info *gl_info;
|
const struct wined3d_gl_info *gl_info;
|
||||||
|
|
||||||
gl_info = ctx->context_gl->c.gl_info;
|
gl_info = ctx->context_gl->gl_info;
|
||||||
LIST_FOR_EACH_ENTRY_SAFE(program, program2, &shader->linked_programs,
|
LIST_FOR_EACH_ENTRY_SAFE(program, program2, &shader->linked_programs,
|
||||||
struct glsl_shader_prog_link, ps.shader_entry)
|
struct glsl_shader_prog_link, ps.shader_entry)
|
||||||
{
|
{
|
||||||
|
@ -12063,8 +12068,10 @@ static void glsl_fragment_pipe_fog(struct wined3d_context *context,
|
||||||
static void glsl_fragment_pipe_vdecl(struct wined3d_context *context,
|
static void glsl_fragment_pipe_vdecl(struct wined3d_context *context,
|
||||||
const struct wined3d_state *state, DWORD state_id)
|
const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
/* Because of settings->texcoords_initialized and args->texcoords_initialized. */
|
/* Because of settings->texcoords_initialized and args->texcoords_initialized. */
|
||||||
if (context->gl_info->limits.glsl_varyings < shader_glsl_max_compat_varyings(context->gl_info))
|
if (gl_info->limits.glsl_varyings < shader_glsl_max_compat_varyings(gl_info))
|
||||||
context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
|
context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
|
||||||
|
|
||||||
if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_FOGENABLE)))
|
if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_FOGENABLE)))
|
||||||
|
@ -12074,8 +12081,10 @@ static void glsl_fragment_pipe_vdecl(struct wined3d_context *context,
|
||||||
static void glsl_fragment_pipe_vs(struct wined3d_context *context,
|
static void glsl_fragment_pipe_vs(struct wined3d_context *context,
|
||||||
const struct wined3d_state *state, DWORD state_id)
|
const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
/* Because of settings->texcoords_initialized and args->texcoords_initialized. */
|
/* Because of settings->texcoords_initialized and args->texcoords_initialized. */
|
||||||
if (context->gl_info->limits.glsl_varyings < shader_glsl_max_compat_varyings(context->gl_info))
|
if (gl_info->limits.glsl_varyings < shader_glsl_max_compat_varyings(gl_info))
|
||||||
context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
|
context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12094,7 +12103,7 @@ static void glsl_fragment_pipe_invalidate_constants(struct wined3d_context *cont
|
||||||
static void glsl_fragment_pipe_alpha_test_func(struct wined3d_context *context,
|
static void glsl_fragment_pipe_alpha_test_func(struct wined3d_context *context,
|
||||||
const struct wined3d_state *state, DWORD state_id)
|
const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
GLint func = wined3d_gl_compare_func(state->render_states[WINED3D_RS_ALPHAFUNC]);
|
GLint func = wined3d_gl_compare_func(state->render_states[WINED3D_RS_ALPHAFUNC]);
|
||||||
float ref = wined3d_alpha_ref(state);
|
float ref = wined3d_alpha_ref(state);
|
||||||
|
|
||||||
|
@ -12114,7 +12123,7 @@ static void glsl_fragment_pipe_core_alpha_test(struct wined3d_context *context,
|
||||||
static void glsl_fragment_pipe_alpha_test(struct wined3d_context *context,
|
static void glsl_fragment_pipe_alpha_test(struct wined3d_context *context,
|
||||||
const struct wined3d_state *state, DWORD state_id)
|
const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
if (state->render_states[WINED3D_RS_ALPHATESTENABLE])
|
if (state->render_states[WINED3D_RS_ALPHATESTENABLE])
|
||||||
{
|
{
|
||||||
|
@ -12325,7 +12334,7 @@ static void glsl_free_blitter_program(struct wine_rb_entry *entry, void *ctx)
|
||||||
struct wined3d_context_gl *context_gl = ctx;
|
struct wined3d_context_gl *context_gl = ctx;
|
||||||
const struct wined3d_gl_info *gl_info;
|
const struct wined3d_gl_info *gl_info;
|
||||||
|
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
GL_EXTCALL(glDeleteProgram(program->id));
|
GL_EXTCALL(glDeleteProgram(program->id));
|
||||||
checkGLcall("glDeleteProgram()");
|
checkGLcall("glDeleteProgram()");
|
||||||
heap_free(program);
|
heap_free(program);
|
||||||
|
@ -12335,7 +12344,7 @@ static void glsl_free_blitter_program(struct wine_rb_entry *entry, void *ctx)
|
||||||
static void glsl_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_context *context)
|
static void glsl_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_context *context)
|
||||||
{
|
{
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
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->gl_info;
|
||||||
struct wined3d_glsl_blitter *glsl_blitter;
|
struct wined3d_glsl_blitter *glsl_blitter;
|
||||||
struct wined3d_blitter *next;
|
struct wined3d_blitter *next;
|
||||||
|
|
||||||
|
@ -12815,7 +12824,7 @@ static GLuint glsl_blitter_generate_program(struct wined3d_glsl_blitter *blitter
|
||||||
static void glsl_blitter_upload_palette(struct wined3d_glsl_blitter *blitter,
|
static void glsl_blitter_upload_palette(struct wined3d_glsl_blitter *blitter,
|
||||||
struct wined3d_context_gl *context_gl, const struct wined3d_texture_gl *texture_gl)
|
struct wined3d_context_gl *context_gl, const struct wined3d_texture_gl *texture_gl)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
const struct wined3d_palette *palette;
|
const struct wined3d_palette *palette;
|
||||||
|
|
||||||
palette = texture_gl->t.swapchain ? texture_gl->t.swapchain->palette : NULL;
|
palette = texture_gl->t.swapchain ? texture_gl->t.swapchain->palette : NULL;
|
||||||
|
@ -12850,7 +12859,7 @@ static void glsl_blitter_upload_palette(struct wined3d_glsl_blitter *blitter,
|
||||||
static struct glsl_blitter_program *glsl_blitter_get_program(struct wined3d_glsl_blitter *blitter,
|
static struct glsl_blitter_program *glsl_blitter_get_program(struct wined3d_glsl_blitter *blitter,
|
||||||
struct wined3d_context_gl *context_gl, const struct wined3d_texture_gl *texture_gl, BOOL use_colour_key)
|
struct wined3d_context_gl *context_gl, const struct wined3d_texture_gl *texture_gl, BOOL use_colour_key)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct glsl_blitter_program *program;
|
struct glsl_blitter_program *program;
|
||||||
struct glsl_blitter_args args;
|
struct glsl_blitter_args args;
|
||||||
struct wine_rb_entry *entry;
|
struct wine_rb_entry *entry;
|
||||||
|
@ -12963,7 +12972,7 @@ static DWORD glsl_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bli
|
||||||
struct wined3d_texture_gl *dst_texture_gl = wined3d_texture_gl(dst_texture);
|
struct wined3d_texture_gl *dst_texture_gl = wined3d_texture_gl(dst_texture);
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
struct wined3d_device *device = dst_texture->resource.device;
|
struct wined3d_device *device = dst_texture->resource.device;
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_texture *staging_texture = NULL;
|
struct wined3d_texture *staging_texture = NULL;
|
||||||
struct wined3d_glsl_blitter *glsl_blitter;
|
struct wined3d_glsl_blitter *glsl_blitter;
|
||||||
struct wined3d_color_key alpha_test_key;
|
struct wined3d_color_key alpha_test_key;
|
||||||
|
|
|
@ -33,7 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||||
static void nvts_activate_dimensions(const struct wined3d_state *state,
|
static void nvts_activate_dimensions(const struct wined3d_state *state,
|
||||||
unsigned int stage, struct wined3d_context_gl *context_gl)
|
unsigned int stage, struct wined3d_context_gl *context_gl)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_texture *texture;
|
struct wined3d_texture *texture;
|
||||||
BOOL bumpmap = FALSE;
|
BOOL bumpmap = FALSE;
|
||||||
|
|
||||||
|
@ -485,8 +485,8 @@ static void nvrc_colorop(struct wined3d_context *context, const struct wined3d_s
|
||||||
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);
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
BOOL tex_used = context->fixed_function_usage_map & (1u << stage);
|
BOOL tex_used = context->fixed_function_usage_map & (1u << stage);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
unsigned int mapped_stage = context_gl->tex_unit_map[stage];
|
unsigned int mapped_stage = context_gl->tex_unit_map[stage];
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
|
||||||
|
|
||||||
TRACE("Setting color op for stage %u.\n", stage);
|
TRACE("Setting color op for stage %u.\n", stage);
|
||||||
|
|
||||||
|
@ -610,7 +610,7 @@ static void nvts_texdim(struct wined3d_context *context, const struct wined3d_st
|
||||||
/* No need to enable / disable anything here for unused samplers. The tex_colorop
|
/* No need to enable / disable anything here for unused samplers. The tex_colorop
|
||||||
* handler takes care. Also no action is needed with pixel shaders, or if tex_colorop
|
* handler takes care. Also no action is needed with pixel shaders, or if tex_colorop
|
||||||
* will take care of this business. */
|
* will take care of this business. */
|
||||||
if (mapped_stage == WINED3D_UNMAPPED_STAGE || mapped_stage >= context->gl_info->limits.textures)
|
if (mapped_stage == WINED3D_UNMAPPED_STAGE || mapped_stage >= context_gl->gl_info->limits.textures)
|
||||||
return;
|
return;
|
||||||
if (sampler >= context->lowest_disabled_stage)
|
if (sampler >= context->lowest_disabled_stage)
|
||||||
return;
|
return;
|
||||||
|
@ -625,7 +625,7 @@ static void nvts_bumpenvmat(struct wined3d_context *context, const struct wined3
|
||||||
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);
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
unsigned int mapped_stage = context_gl->tex_unit_map[stage + 1];
|
unsigned int mapped_stage = context_gl->tex_unit_map[stage + 1];
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
float mat[2][2];
|
float mat[2][2];
|
||||||
|
|
||||||
/* Direct3D sets the matrix in the stage reading the perturbation map. The result is used to
|
/* Direct3D sets the matrix in the stage reading the perturbation map. The result is used to
|
||||||
|
@ -651,7 +651,8 @@ static void nvts_bumpenvmat(struct wined3d_context *context, const struct wined3
|
||||||
|
|
||||||
static void nvrc_texfactor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void nvrc_texfactor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_color color;
|
struct wined3d_color color;
|
||||||
|
|
||||||
wined3d_color_from_d3dcolor(&color, state->render_states[WINED3D_RS_TEXTUREFACTOR]);
|
wined3d_color_from_d3dcolor(&color, state->render_states[WINED3D_RS_TEXTUREFACTOR]);
|
||||||
|
@ -661,7 +662,7 @@ static void nvrc_texfactor(struct wined3d_context *context, const struct wined3d
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
static void nvrc_enable(const struct wined3d_context *context, BOOL enable)
|
static void nvrc_enable(const struct wined3d_context *context, BOOL enable)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl_const(context)->gl_info;
|
||||||
|
|
||||||
if (enable)
|
if (enable)
|
||||||
{
|
{
|
||||||
|
@ -678,7 +679,7 @@ static void nvrc_enable(const struct wined3d_context *context, BOOL enable)
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
static void nvts_enable(const struct wined3d_context *context, BOOL enable)
|
static void nvts_enable(const struct wined3d_context *context, BOOL enable)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl_const(context)->gl_info;
|
||||||
|
|
||||||
nvrc_enable(context, enable);
|
nvrc_enable(context, enable);
|
||||||
if (enable)
|
if (enable)
|
||||||
|
|
|
@ -40,7 +40,7 @@ static BOOL wined3d_query_buffer_is_valid(struct wined3d_query *query)
|
||||||
static void wined3d_query_create_buffer_object(struct wined3d_context_gl *context_gl, struct wined3d_query *query)
|
static void wined3d_query_create_buffer_object(struct wined3d_context_gl *context_gl, struct wined3d_query *query)
|
||||||
{
|
{
|
||||||
const GLuint map_flags = GL_MAP_READ_BIT | GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT;
|
const GLuint map_flags = GL_MAP_READ_BIT | GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
GLuint buffer_object;
|
GLuint buffer_object;
|
||||||
|
|
||||||
GL_EXTCALL(glGenBuffers(1, &buffer_object));
|
GL_EXTCALL(glGenBuffers(1, &buffer_object));
|
||||||
|
@ -56,7 +56,7 @@ static void wined3d_query_create_buffer_object(struct wined3d_context_gl *contex
|
||||||
|
|
||||||
static void wined3d_query_destroy_buffer_object(struct wined3d_context_gl *context_gl, struct wined3d_query *query)
|
static void wined3d_query_destroy_buffer_object(struct wined3d_context_gl *context_gl, struct wined3d_query *query)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
GL_EXTCALL(glDeleteBuffers(1, &query->buffer_object));
|
GL_EXTCALL(glDeleteBuffers(1, &query->buffer_object));
|
||||||
checkGLcall("query buffer object destruction");
|
checkGLcall("query buffer object destruction");
|
||||||
|
@ -76,7 +76,7 @@ static void wined3d_query_destroy_buffer_object(struct wined3d_context_gl *conte
|
||||||
static BOOL wined3d_query_buffer_queue_result(struct wined3d_context_gl *context_gl,
|
static BOOL wined3d_query_buffer_queue_result(struct wined3d_context_gl *context_gl,
|
||||||
struct wined3d_query *query, GLuint id)
|
struct wined3d_query *query, GLuint id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
GLsync tmp_sync;
|
GLsync tmp_sync;
|
||||||
|
|
||||||
if (!gl_info->supported[ARB_QUERY_BUFFER_OBJECT] || !gl_info->supported[ARB_BUFFER_STORAGE])
|
if (!gl_info->supported[ARB_QUERY_BUFFER_OBJECT] || !gl_info->supported[ARB_BUFFER_STORAGE])
|
||||||
|
@ -198,14 +198,14 @@ static enum wined3d_fence_result wined3d_fence_test(const struct wined3d_fence *
|
||||||
|
|
||||||
if (!(context_gl = wined3d_context_gl_reacquire(fence->context_gl)))
|
if (!(context_gl = wined3d_context_gl_reacquire(fence->context_gl)))
|
||||||
{
|
{
|
||||||
if (!fence->context_gl->c.gl_info->supported[ARB_SYNC])
|
if (!fence->context_gl->gl_info->supported[ARB_SYNC])
|
||||||
{
|
{
|
||||||
WARN("Fence tested from wrong thread.\n");
|
WARN("Fence tested from wrong thread.\n");
|
||||||
return WINED3D_FENCE_WRONG_THREAD;
|
return WINED3D_FENCE_WRONG_THREAD;
|
||||||
}
|
}
|
||||||
context_gl = wined3d_context_gl(context_acquire(device, NULL, 0));
|
context_gl = wined3d_context_gl(context_acquire(device, NULL, 0));
|
||||||
}
|
}
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (gl_info->supported[ARB_SYNC])
|
if (gl_info->supported[ARB_SYNC])
|
||||||
{
|
{
|
||||||
|
@ -272,7 +272,7 @@ enum wined3d_fence_result wined3d_fence_wait(const struct wined3d_fence *fence,
|
||||||
TRACE("Fence not issued.\n");
|
TRACE("Fence not issued.\n");
|
||||||
return WINED3D_FENCE_NOT_STARTED;
|
return WINED3D_FENCE_NOT_STARTED;
|
||||||
}
|
}
|
||||||
gl_info = fence->context_gl->c.gl_info;
|
gl_info = fence->context_gl->gl_info;
|
||||||
|
|
||||||
if (!(context_gl = wined3d_context_gl_reacquire(fence->context_gl)))
|
if (!(context_gl = wined3d_context_gl_reacquire(fence->context_gl)))
|
||||||
{
|
{
|
||||||
|
@ -286,7 +286,7 @@ enum wined3d_fence_result wined3d_fence_wait(const struct wined3d_fence *fence,
|
||||||
}
|
}
|
||||||
context_gl = wined3d_context_gl(context_acquire(device, NULL, 0));
|
context_gl = wined3d_context_gl(context_acquire(device, NULL, 0));
|
||||||
}
|
}
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (gl_info->supported[ARB_SYNC])
|
if (gl_info->supported[ARB_SYNC])
|
||||||
{
|
{
|
||||||
|
@ -339,11 +339,11 @@ void wined3d_fence_issue(struct wined3d_fence *fence, struct wined3d_device *dev
|
||||||
const struct wined3d_gl_info *gl_info;
|
const struct wined3d_gl_info *gl_info;
|
||||||
|
|
||||||
if (fence->context_gl && !(context_gl = wined3d_context_gl_reacquire(fence->context_gl))
|
if (fence->context_gl && !(context_gl = wined3d_context_gl_reacquire(fence->context_gl))
|
||||||
&& !fence->context_gl->c.gl_info->supported[ARB_SYNC])
|
&& !fence->context_gl->gl_info->supported[ARB_SYNC])
|
||||||
wined3d_context_gl_free_fence(fence);
|
wined3d_context_gl_free_fence(fence);
|
||||||
if (!context_gl)
|
if (!context_gl)
|
||||||
context_gl = wined3d_context_gl(context_acquire(device, NULL, 0));
|
context_gl = wined3d_context_gl(context_acquire(device, NULL, 0));
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
if (!fence->context_gl)
|
if (!fence->context_gl)
|
||||||
wined3d_context_gl_alloc_fence(context_gl, fence);
|
wined3d_context_gl_alloc_fence(context_gl, fence);
|
||||||
|
|
||||||
|
@ -545,7 +545,7 @@ static BOOL wined3d_occlusion_query_ops_poll(struct wined3d_query *query, DWORD
|
||||||
oq->samples = 1;
|
oq->samples = 1;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT_AVAILABLE, &available));
|
GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT_AVAILABLE, &available));
|
||||||
TRACE("Available %#x.\n", available);
|
TRACE("Available %#x.\n", available);
|
||||||
|
@ -645,7 +645,7 @@ static BOOL wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD
|
||||||
{
|
{
|
||||||
if ((context_gl = wined3d_context_gl_reacquire(oq->context_gl)))
|
if ((context_gl = wined3d_context_gl_reacquire(oq->context_gl)))
|
||||||
{
|
{
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
GL_EXTCALL(glEndQuery(GL_SAMPLES_PASSED));
|
GL_EXTCALL(glEndQuery(GL_SAMPLES_PASSED));
|
||||||
checkGLcall("glEndQuery()");
|
checkGLcall("glEndQuery()");
|
||||||
}
|
}
|
||||||
|
@ -664,7 +664,7 @@ static BOOL wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD
|
||||||
context_gl = wined3d_context_gl(context_acquire(device, NULL, 0));
|
context_gl = wined3d_context_gl(context_acquire(device, NULL, 0));
|
||||||
wined3d_context_gl_alloc_occlusion_query(context_gl, oq);
|
wined3d_context_gl_alloc_occlusion_query(context_gl, oq);
|
||||||
}
|
}
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
GL_EXTCALL(glBeginQuery(GL_SAMPLES_PASSED, oq->id));
|
GL_EXTCALL(glBeginQuery(GL_SAMPLES_PASSED, oq->id));
|
||||||
checkGLcall("glBeginQuery()");
|
checkGLcall("glBeginQuery()");
|
||||||
|
@ -681,7 +681,7 @@ static BOOL wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD
|
||||||
{
|
{
|
||||||
if ((context_gl = wined3d_context_gl_reacquire(oq->context_gl)))
|
if ((context_gl = wined3d_context_gl_reacquire(oq->context_gl)))
|
||||||
{
|
{
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
GL_EXTCALL(glEndQuery(GL_SAMPLES_PASSED));
|
GL_EXTCALL(glEndQuery(GL_SAMPLES_PASSED));
|
||||||
checkGLcall("glEndQuery()");
|
checkGLcall("glEndQuery()");
|
||||||
wined3d_query_buffer_queue_result(context_gl, query, oq->id);
|
wined3d_query_buffer_queue_result(context_gl, query, oq->id);
|
||||||
|
@ -716,7 +716,7 @@ static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query, DWORD
|
||||||
tq->timestamp = 1;
|
tq->timestamp = 1;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
GL_EXTCALL(glGetQueryObjectuiv(tq->id, GL_QUERY_RESULT_AVAILABLE, &available));
|
GL_EXTCALL(glGetQueryObjectuiv(tq->id, GL_QUERY_RESULT_AVAILABLE, &available));
|
||||||
checkGLcall("glGetQueryObjectuiv(GL_QUERY_RESULT_AVAILABLE)");
|
checkGLcall("glGetQueryObjectuiv(GL_QUERY_RESULT_AVAILABLE)");
|
||||||
|
@ -739,7 +739,7 @@ static BOOL wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD
|
||||||
{
|
{
|
||||||
struct wined3d_timestamp_query *tq = wined3d_timestamp_query_from_query(query);
|
struct wined3d_timestamp_query *tq = wined3d_timestamp_query_from_query(query);
|
||||||
const struct wined3d_gl_info *gl_info;
|
const struct wined3d_gl_info *gl_info;
|
||||||
struct wined3d_context *context;
|
struct wined3d_context_gl *context_gl;
|
||||||
|
|
||||||
TRACE("query %p, flags %#x.\n", query, flags);
|
TRACE("query %p, flags %#x.\n", query, flags);
|
||||||
|
|
||||||
|
@ -751,12 +751,12 @@ static BOOL wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD
|
||||||
{
|
{
|
||||||
if (tq->context_gl)
|
if (tq->context_gl)
|
||||||
wined3d_context_gl_free_timestamp_query(tq);
|
wined3d_context_gl_free_timestamp_query(tq);
|
||||||
context = context_acquire(query->device, NULL, 0);
|
context_gl = wined3d_context_gl(context_acquire(query->device, NULL, 0));
|
||||||
gl_info = context->gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
wined3d_context_gl_alloc_timestamp_query(wined3d_context_gl(context), tq);
|
wined3d_context_gl_alloc_timestamp_query(context_gl, tq);
|
||||||
GL_EXTCALL(glQueryCounter(tq->id, GL_TIMESTAMP));
|
GL_EXTCALL(glQueryCounter(tq->id, GL_TIMESTAMP));
|
||||||
checkGLcall("glQueryCounter()");
|
checkGLcall("glQueryCounter()");
|
||||||
context_release(context);
|
context_release(&context_gl->c);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -793,7 +793,7 @@ static BOOL wined3d_so_statistics_query_ops_poll(struct wined3d_query *query, DW
|
||||||
memset(&pq->statistics, 0, sizeof(pq->statistics));
|
memset(&pq->statistics, 0, sizeof(pq->statistics));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
GL_EXTCALL(glGetQueryObjectuiv(pq->u.query.written,
|
GL_EXTCALL(glGetQueryObjectuiv(pq->u.query.written,
|
||||||
GL_QUERY_RESULT_AVAILABLE, &written_available));
|
GL_QUERY_RESULT_AVAILABLE, &written_available));
|
||||||
|
@ -819,7 +819,7 @@ static BOOL wined3d_so_statistics_query_ops_poll(struct wined3d_query *query, DW
|
||||||
static void wined3d_so_statistics_query_end(struct wined3d_so_statistics_query *query,
|
static void wined3d_so_statistics_query_end(struct wined3d_so_statistics_query *query,
|
||||||
struct wined3d_context_gl *context_gl)
|
struct wined3d_context_gl *context_gl)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (gl_info->supported[ARB_TRANSFORM_FEEDBACK3])
|
if (gl_info->supported[ARB_TRANSFORM_FEEDBACK3])
|
||||||
{
|
{
|
||||||
|
@ -867,7 +867,7 @@ static BOOL wined3d_so_statistics_query_ops_issue(struct wined3d_query *query, D
|
||||||
context_gl = wined3d_context_gl(context_acquire(device, NULL, 0));
|
context_gl = wined3d_context_gl(context_acquire(device, NULL, 0));
|
||||||
wined3d_context_gl_alloc_so_statistics_query(context_gl, pq);
|
wined3d_context_gl_alloc_so_statistics_query(context_gl, pq);
|
||||||
}
|
}
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (gl_info->supported[ARB_TRANSFORM_FEEDBACK3])
|
if (gl_info->supported[ARB_TRANSFORM_FEEDBACK3])
|
||||||
{
|
{
|
||||||
|
@ -926,7 +926,7 @@ static BOOL wined3d_pipeline_query_ops_poll(struct wined3d_query *query, DWORD f
|
||||||
memset(&pq->statistics, 0, sizeof(pq->statistics));
|
memset(&pq->statistics, 0, sizeof(pq->statistics));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(pq->u.id); ++i)
|
for (i = 0; i < ARRAY_SIZE(pq->u.id); ++i)
|
||||||
{
|
{
|
||||||
|
@ -958,7 +958,7 @@ static BOOL wined3d_pipeline_query_ops_poll(struct wined3d_query *query, DWORD f
|
||||||
static void wined3d_pipeline_statistics_query_end(struct wined3d_pipeline_statistics_query *query,
|
static void wined3d_pipeline_statistics_query_end(struct wined3d_pipeline_statistics_query *query,
|
||||||
struct wined3d_context_gl *context_gl)
|
struct wined3d_context_gl *context_gl)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
GL_EXTCALL(glEndQuery(GL_VERTICES_SUBMITTED_ARB));
|
GL_EXTCALL(glEndQuery(GL_VERTICES_SUBMITTED_ARB));
|
||||||
GL_EXTCALL(glEndQuery(GL_PRIMITIVES_SUBMITTED_ARB));
|
GL_EXTCALL(glEndQuery(GL_PRIMITIVES_SUBMITTED_ARB));
|
||||||
|
@ -1007,7 +1007,7 @@ static BOOL wined3d_pipeline_query_ops_issue(struct wined3d_query *query, DWORD
|
||||||
context_gl = wined3d_context_gl(context_acquire(device, NULL, 0));
|
context_gl = wined3d_context_gl(context_acquire(device, NULL, 0));
|
||||||
wined3d_context_gl_alloc_pipeline_statistics_query(context_gl, pq);
|
wined3d_context_gl_alloc_pipeline_statistics_query(context_gl, pq);
|
||||||
}
|
}
|
||||||
gl_info = context_gl->c.gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
GL_EXTCALL(glBeginQuery(GL_VERTICES_SUBMITTED_ARB, pq->u.query.vertices));
|
GL_EXTCALL(glBeginQuery(GL_VERTICES_SUBMITTED_ARB, pq->u.query.vertices));
|
||||||
GL_EXTCALL(glBeginQuery(GL_PRIMITIVES_SUBMITTED_ARB, pq->u.query.primitives));
|
GL_EXTCALL(glBeginQuery(GL_PRIMITIVES_SUBMITTED_ARB, pq->u.query.primitives));
|
||||||
|
|
|
@ -42,7 +42,7 @@ static void wined3d_sampler_destroy_object(void *object)
|
||||||
if (sampler->name)
|
if (sampler->name)
|
||||||
{
|
{
|
||||||
context = context_acquire(sampler->device, NULL, 0);
|
context = context_acquire(sampler->device, NULL, 0);
|
||||||
gl_info = context->gl_info;
|
gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
GL_EXTCALL(glDeleteSamplers(1, &sampler->name));
|
GL_EXTCALL(glDeleteSamplers(1, &sampler->name));
|
||||||
context_release(context);
|
context_release(context);
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ static void wined3d_sampler_cs_init(void *object)
|
||||||
struct wined3d_context *context;
|
struct wined3d_context *context;
|
||||||
|
|
||||||
context = context_acquire(sampler->device, NULL, 0);
|
context = context_acquire(sampler->device, NULL, 0);
|
||||||
gl_info = context->gl_info;
|
gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
desc = &sampler->desc;
|
desc = &sampler->desc;
|
||||||
GL_EXTCALL(glGenSamplers(1, &sampler->name));
|
GL_EXTCALL(glGenSamplers(1, &sampler->name));
|
||||||
|
@ -184,7 +184,7 @@ static void texture_gl_apply_base_level(struct wined3d_texture_gl *texture_gl,
|
||||||
void wined3d_sampler_bind(struct wined3d_sampler *sampler, unsigned int unit,
|
void wined3d_sampler_bind(struct wined3d_sampler *sampler, unsigned int unit,
|
||||||
struct wined3d_texture_gl *texture_gl, const struct wined3d_context_gl *context_gl)
|
struct wined3d_texture_gl *texture_gl, const struct wined3d_context_gl *context_gl)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (gl_info->supported[ARB_SAMPLER_OBJECTS])
|
if (gl_info->supported[ARB_SAMPLER_OBJECTS])
|
||||||
{
|
{
|
||||||
|
|
|
@ -3896,8 +3896,8 @@ void find_gs_compile_args(const struct wined3d_state *state, const struct wined3
|
||||||
void find_ps_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader,
|
void find_ps_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader,
|
||||||
BOOL position_transformed, struct ps_compile_args *args, const struct wined3d_context *context)
|
BOOL position_transformed, struct ps_compile_args *args, const struct wined3d_context *context)
|
||||||
{
|
{
|
||||||
|
const struct wined3d_gl_info *gl_info = &context->device->adapter->gl_info;
|
||||||
const struct wined3d_d3d_info *d3d_info = context->d3d_info;
|
const struct wined3d_d3d_info *d3d_info = context->d3d_info;
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
|
||||||
struct wined3d_texture *texture;
|
struct wined3d_texture *texture;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
|
|
@ -173,8 +173,8 @@ void state_nop(struct wined3d_context *context, const struct wined3d_state *stat
|
||||||
|
|
||||||
static void state_fillmode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_fillmode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
enum wined3d_fill_mode mode = state->render_states[WINED3D_RS_FILLMODE];
|
enum wined3d_fill_mode mode = state->render_states[WINED3D_RS_FILLMODE];
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
|
||||||
|
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
|
@ -197,7 +197,7 @@ static void state_fillmode(struct wined3d_context *context, const struct wined3d
|
||||||
|
|
||||||
static void state_lighting(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_lighting(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
/* Lighting is not enabled if transformed vertices are drawn, but lighting
|
/* Lighting is not enabled if transformed vertices are drawn, but lighting
|
||||||
* does not affect the stream sources, so it is not grouped for
|
* does not affect the stream sources, so it is not grouped for
|
||||||
|
@ -223,7 +223,7 @@ static void state_lighting(struct wined3d_context *context, const struct wined3d
|
||||||
static void state_zenable(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_zenable(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
enum wined3d_depth_buffer_type zenable = state->render_states[WINED3D_RS_ZENABLE];
|
enum wined3d_depth_buffer_type zenable = state->render_states[WINED3D_RS_ZENABLE];
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
/* No z test without depth stencil buffers */
|
/* No z test without depth stencil buffers */
|
||||||
if (!state->fb->depth_stencil)
|
if (!state->fb->depth_stencil)
|
||||||
|
@ -258,7 +258,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_
|
||||||
|
|
||||||
static void state_cullmode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_cullmode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
/* glFrontFace() is set in context.c at context init and on an
|
/* glFrontFace() is set in context.c at context init and on an
|
||||||
* offscreen / onscreen rendering switch. */
|
* offscreen / onscreen rendering switch. */
|
||||||
|
@ -288,7 +288,7 @@ static void state_cullmode(struct wined3d_context *context, const struct wined3d
|
||||||
|
|
||||||
void state_shademode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
void state_shademode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
switch (state->render_states[WINED3D_RS_SHADEMODE])
|
switch (state->render_states[WINED3D_RS_SHADEMODE])
|
||||||
{
|
{
|
||||||
|
@ -311,7 +311,7 @@ void state_shademode(struct wined3d_context *context, const struct wined3d_state
|
||||||
|
|
||||||
static void state_ditherenable(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_ditherenable(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
if (state->render_states[WINED3D_RS_DITHERENABLE])
|
if (state->render_states[WINED3D_RS_DITHERENABLE])
|
||||||
{
|
{
|
||||||
|
@ -327,7 +327,7 @@ static void state_ditherenable(struct wined3d_context *context, const struct win
|
||||||
|
|
||||||
static void state_zwriteenable(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_zwriteenable(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
if (state->render_states[WINED3D_RS_ZWRITEENABLE])
|
if (state->render_states[WINED3D_RS_ZWRITEENABLE])
|
||||||
{
|
{
|
||||||
|
@ -373,7 +373,7 @@ GLenum wined3d_gl_compare_func(enum wined3d_cmp_func f)
|
||||||
static void state_zfunc(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_zfunc(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
GLenum depth_func = wined3d_gl_compare_func(state->render_states[WINED3D_RS_ZFUNC]);
|
GLenum depth_func = wined3d_gl_compare_func(state->render_states[WINED3D_RS_ZFUNC]);
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
if (!depth_func) return;
|
if (!depth_func) return;
|
||||||
|
|
||||||
|
@ -383,7 +383,7 @@ static void state_zfunc(struct wined3d_context *context, const struct wined3d_st
|
||||||
|
|
||||||
static void state_ambient(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_ambient(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
struct wined3d_color color;
|
struct wined3d_color color;
|
||||||
|
|
||||||
wined3d_color_from_d3dcolor(&color, state->render_states[WINED3D_RS_AMBIENT]);
|
wined3d_color_from_d3dcolor(&color, state->render_states[WINED3D_RS_AMBIENT]);
|
||||||
|
@ -422,7 +422,7 @@ static GLenum gl_blend_op(const struct wined3d_gl_info *gl_info, enum wined3d_bl
|
||||||
|
|
||||||
static void state_blendop(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_blendop(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
GLenum blend_equation_alpha = GL_FUNC_ADD_EXT;
|
GLenum blend_equation_alpha = GL_FUNC_ADD_EXT;
|
||||||
GLenum blend_equation = GL_FUNC_ADD_EXT;
|
GLenum blend_equation = GL_FUNC_ADD_EXT;
|
||||||
|
|
||||||
|
@ -529,7 +529,7 @@ static void gl_blend_from_d3d(GLenum *src_blend, GLenum *dst_blend,
|
||||||
|
|
||||||
static void state_blend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_blend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
const struct wined3d_format *rt_format;
|
const struct wined3d_format *rt_format;
|
||||||
GLenum src_blend, dst_blend;
|
GLenum src_blend, dst_blend;
|
||||||
unsigned int rt_fmt_flags;
|
unsigned int rt_fmt_flags;
|
||||||
|
@ -571,7 +571,7 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st
|
||||||
GLenum src_blend_alpha, dst_blend_alpha;
|
GLenum src_blend_alpha, dst_blend_alpha;
|
||||||
|
|
||||||
/* Separate alpha blending requires GL_EXT_blend_function_separate, so make sure it is around */
|
/* Separate alpha blending requires GL_EXT_blend_function_separate, so make sure it is around */
|
||||||
if (!context->gl_info->supported[EXT_BLEND_FUNC_SEPARATE])
|
if (!gl_info->supported[EXT_BLEND_FUNC_SEPARATE])
|
||||||
{
|
{
|
||||||
WARN("Unsupported in local OpenGL implementation: glBlendFuncSeparate.\n");
|
WARN("Unsupported in local OpenGL implementation: glBlendFuncSeparate.\n");
|
||||||
return;
|
return;
|
||||||
|
@ -604,8 +604,8 @@ static void state_blend_factor_w(struct wined3d_context *context, const struct w
|
||||||
|
|
||||||
static void state_blend_factor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_blend_factor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
const struct wined3d_color *factor = &state->blend_factor;
|
const struct wined3d_color *factor = &state->blend_factor;
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
|
||||||
|
|
||||||
TRACE("Setting blend factor to %s.\n", debug_color(factor));
|
TRACE("Setting blend factor to %s.\n", debug_color(factor));
|
||||||
|
|
||||||
|
@ -615,7 +615,7 @@ static void state_blend_factor(struct wined3d_context *context, const struct win
|
||||||
|
|
||||||
static void state_blend_object(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_blend_object(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
BOOL alpha_to_coverage = FALSE;
|
BOOL alpha_to_coverage = FALSE;
|
||||||
|
|
||||||
if (!gl_info->supported[ARB_MULTISAMPLE])
|
if (!gl_info->supported[ARB_MULTISAMPLE])
|
||||||
|
@ -637,7 +637,7 @@ static void state_blend_object(struct wined3d_context *context, const struct win
|
||||||
|
|
||||||
void state_alpha_test(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
void state_alpha_test(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
int glParm = 0;
|
int glParm = 0;
|
||||||
float ref;
|
float ref;
|
||||||
BOOL enable_ckey = FALSE;
|
BOOL enable_ckey = FALSE;
|
||||||
|
@ -727,7 +727,8 @@ void state_clipping(struct wined3d_context *context, const struct wined3d_state
|
||||||
|
|
||||||
static void state_specularenable(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_specularenable(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
/* Originally this used glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL,GL_SEPARATE_SPECULAR_COLOR)
|
/* Originally this used glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL,GL_SEPARATE_SPECULAR_COLOR)
|
||||||
* and (GL_LIGHT_MODEL_COLOR_CONTROL,GL_SINGLE_COLOR) to swap between enabled/disabled
|
* and (GL_LIGHT_MODEL_COLOR_CONTROL,GL_SINGLE_COLOR) to swap between enabled/disabled
|
||||||
* specular color. This is wrong:
|
* specular color. This is wrong:
|
||||||
|
@ -829,7 +830,7 @@ static void state_specularenable(struct wined3d_context *context, const struct w
|
||||||
static void state_texfactor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_texfactor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
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->gl_info;
|
||||||
struct wined3d_color color;
|
struct wined3d_color color;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
@ -852,7 +853,7 @@ static void state_texfactor(struct wined3d_context *context, const struct wined3
|
||||||
static void renderstate_stencil_twosided(struct wined3d_context *context, GLint face,
|
static void renderstate_stencil_twosided(struct wined3d_context *context, GLint face,
|
||||||
GLint func, GLint ref, GLuint mask, GLint stencilFail, GLint depthFail, GLint stencilPass)
|
GLint func, GLint ref, GLuint mask, GLint stencilFail, GLint depthFail, GLint stencilPass)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
gl_info->gl_ops.gl.p_glEnable(GL_STENCIL_TEST_TWO_SIDE_EXT);
|
gl_info->gl_ops.gl.p_glEnable(GL_STENCIL_TEST_TWO_SIDE_EXT);
|
||||||
checkGLcall("glEnable(GL_STENCIL_TEST_TWO_SIDE_EXT)");
|
checkGLcall("glEnable(GL_STENCIL_TEST_TWO_SIDE_EXT)");
|
||||||
|
@ -895,7 +896,7 @@ static GLenum gl_stencil_op(enum wined3d_stencil_op op)
|
||||||
|
|
||||||
static void state_stencil(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_stencil(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
DWORD onesided_enable;
|
DWORD onesided_enable;
|
||||||
DWORD twosided_enable;
|
DWORD twosided_enable;
|
||||||
GLint func;
|
GLint func;
|
||||||
|
@ -1007,7 +1008,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_
|
||||||
static void state_stencilwrite2s_ext(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_stencilwrite2s_ext(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
DWORD mask = state->fb->depth_stencil ? state->render_states[WINED3D_RS_STENCILWRITEMASK] : 0;
|
DWORD mask = state->fb->depth_stencil ? state->render_states[WINED3D_RS_STENCILWRITEMASK] : 0;
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
GL_EXTCALL(glActiveStencilFaceEXT(GL_BACK));
|
GL_EXTCALL(glActiveStencilFaceEXT(GL_BACK));
|
||||||
checkGLcall("glActiveStencilFaceEXT(GL_BACK)");
|
checkGLcall("glActiveStencilFaceEXT(GL_BACK)");
|
||||||
|
@ -1021,7 +1022,7 @@ static void state_stencilwrite2s_ext(struct wined3d_context *context, const stru
|
||||||
static void state_stencilwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_stencilwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
DWORD mask = state->fb->depth_stencil ? state->render_states[WINED3D_RS_STENCILWRITEMASK] : 0;
|
DWORD mask = state->fb->depth_stencil ? state->render_states[WINED3D_RS_STENCILWRITEMASK] : 0;
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
gl_info->gl_ops.gl.p_glStencilMask(mask);
|
gl_info->gl_ops.gl.p_glStencilMask(mask);
|
||||||
checkGLcall("glStencilMask");
|
checkGLcall("glStencilMask");
|
||||||
|
@ -1029,7 +1030,7 @@ static void state_stencilwrite(struct wined3d_context *context, const struct win
|
||||||
|
|
||||||
static void state_fog_vertexpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_fog_vertexpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
|
TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
|
||||||
|
|
||||||
|
@ -1101,7 +1102,7 @@ static void state_fog_vertexpart(struct wined3d_context *context, const struct w
|
||||||
|
|
||||||
void state_fogstartend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
void state_fogstartend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
float fogstart, fogend;
|
float fogstart, fogend;
|
||||||
|
|
||||||
get_fog_start_end(context, state, &fogstart, &fogend);
|
get_fog_start_end(context, state, &fogstart, &fogend);
|
||||||
|
@ -1117,7 +1118,7 @@ void state_fogstartend(struct wined3d_context *context, const struct wined3d_sta
|
||||||
|
|
||||||
void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
enum fogsource new_source;
|
enum fogsource new_source;
|
||||||
DWORD fogstart = state->render_states[WINED3D_RS_FOGSTART];
|
DWORD fogstart = state->render_states[WINED3D_RS_FOGSTART];
|
||||||
DWORD fogend = state->render_states[WINED3D_RS_FOGEND];
|
DWORD fogend = state->render_states[WINED3D_RS_FOGEND];
|
||||||
|
@ -1275,7 +1276,7 @@ void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_st
|
||||||
|
|
||||||
void state_fogcolor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
void state_fogcolor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
struct wined3d_color color;
|
struct wined3d_color color;
|
||||||
|
|
||||||
wined3d_color_from_d3dcolor(&color, state->render_states[WINED3D_RS_FOGCOLOR]);
|
wined3d_color_from_d3dcolor(&color, state->render_states[WINED3D_RS_FOGCOLOR]);
|
||||||
|
@ -1285,7 +1286,7 @@ void state_fogcolor(struct wined3d_context *context, const struct wined3d_state
|
||||||
|
|
||||||
void state_fogdensity(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
void state_fogdensity(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
union {
|
union {
|
||||||
DWORD d;
|
DWORD d;
|
||||||
float f;
|
float f;
|
||||||
|
@ -1299,7 +1300,7 @@ void state_fogdensity(struct wined3d_context *context, const struct wined3d_stat
|
||||||
static void state_colormat(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_colormat(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
GLenum Parm = 0;
|
GLenum Parm = 0;
|
||||||
|
|
||||||
/* Depends on the decoded vertex declaration to read the existence of
|
/* Depends on the decoded vertex declaration to read the existence of
|
||||||
|
@ -1412,7 +1413,7 @@ static void state_colormat(struct wined3d_context *context, const struct wined3d
|
||||||
|
|
||||||
static void state_linepattern(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_linepattern(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
DWORD d;
|
DWORD d;
|
||||||
|
@ -1446,7 +1447,7 @@ static void state_linepattern_w(struct wined3d_context *context, const struct wi
|
||||||
|
|
||||||
static void state_normalize(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_normalize(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
if (isStateDirty(context, STATE_VDECL))
|
if (isStateDirty(context, STATE_VDECL))
|
||||||
return;
|
return;
|
||||||
|
@ -1482,7 +1483,7 @@ static void state_psizemin_w(struct wined3d_context *context, const struct wined
|
||||||
|
|
||||||
static void state_psizemin_ext(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_psizemin_ext(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
float min, max;
|
float min, max;
|
||||||
|
|
||||||
get_pointsize_minmax(context, state, &min, &max);
|
get_pointsize_minmax(context, state, &min, &max);
|
||||||
|
@ -1495,7 +1496,7 @@ static void state_psizemin_ext(struct wined3d_context *context, const struct win
|
||||||
|
|
||||||
static void state_psizemin_arb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_psizemin_arb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
float min, max;
|
float min, max;
|
||||||
|
|
||||||
get_pointsize_minmax(context, state, &min, &max);
|
get_pointsize_minmax(context, state, &min, &max);
|
||||||
|
@ -1508,7 +1509,7 @@ static void state_psizemin_arb(struct wined3d_context *context, const struct win
|
||||||
|
|
||||||
static void state_pscale(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_pscale(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
float att[3];
|
float att[3];
|
||||||
float pointsize;
|
float pointsize;
|
||||||
|
|
||||||
|
@ -1540,11 +1541,11 @@ static void state_debug_monitor(struct wined3d_context *context, const struct wi
|
||||||
|
|
||||||
static void state_colorwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_colorwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
DWORD mask0 = state->render_states[WINED3D_RS_COLORWRITEENABLE];
|
DWORD mask0 = state->render_states[WINED3D_RS_COLORWRITEENABLE];
|
||||||
DWORD mask1 = state->render_states[WINED3D_RS_COLORWRITEENABLE1];
|
DWORD mask1 = state->render_states[WINED3D_RS_COLORWRITEENABLE1];
|
||||||
DWORD mask2 = state->render_states[WINED3D_RS_COLORWRITEENABLE2];
|
DWORD mask2 = state->render_states[WINED3D_RS_COLORWRITEENABLE2];
|
||||||
DWORD mask3 = state->render_states[WINED3D_RS_COLORWRITEENABLE3];
|
DWORD mask3 = state->render_states[WINED3D_RS_COLORWRITEENABLE3];
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
|
||||||
|
|
||||||
TRACE("Color mask: r(%d) g(%d) b(%d) a(%d)\n",
|
TRACE("Color mask: r(%d) g(%d) b(%d) a(%d)\n",
|
||||||
mask0 & WINED3DCOLORWRITEENABLE_RED ? 1 : 0,
|
mask0 & WINED3DCOLORWRITEENABLE_RED ? 1 : 0,
|
||||||
|
@ -1578,27 +1579,27 @@ static void set_color_mask(const struct wined3d_gl_info *gl_info, UINT index, DW
|
||||||
|
|
||||||
static void state_colorwrite0(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_colorwrite0(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
set_color_mask(context->gl_info, 0, state->render_states[WINED3D_RS_COLORWRITEENABLE]);
|
set_color_mask(wined3d_context_gl(context)->gl_info, 0, state->render_states[WINED3D_RS_COLORWRITEENABLE]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_colorwrite1(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_colorwrite1(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
set_color_mask(context->gl_info, 1, state->render_states[WINED3D_RS_COLORWRITEENABLE1]);
|
set_color_mask(wined3d_context_gl(context)->gl_info, 1, state->render_states[WINED3D_RS_COLORWRITEENABLE]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_colorwrite2(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_colorwrite2(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
set_color_mask(context->gl_info, 2, state->render_states[WINED3D_RS_COLORWRITEENABLE2]);
|
set_color_mask(wined3d_context_gl(context)->gl_info, 2, state->render_states[WINED3D_RS_COLORWRITEENABLE]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_colorwrite3(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_colorwrite3(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
set_color_mask(context->gl_info, 3, state->render_states[WINED3D_RS_COLORWRITEENABLE3]);
|
set_color_mask(wined3d_context_gl(context)->gl_info, 3, state->render_states[WINED3D_RS_COLORWRITEENABLE]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_localviewer(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_localviewer(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
if (state->render_states[WINED3D_RS_LOCALVIEWER])
|
if (state->render_states[WINED3D_RS_LOCALVIEWER])
|
||||||
{
|
{
|
||||||
|
@ -1645,7 +1646,7 @@ void state_pointsprite_w(struct wined3d_context *context, const struct wined3d_s
|
||||||
|
|
||||||
void state_pointsprite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
void state_pointsprite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
if (state->render_states[WINED3D_RS_POINTSPRITEENABLE])
|
if (state->render_states[WINED3D_RS_POINTSPRITEENABLE])
|
||||||
{
|
{
|
||||||
|
@ -1691,7 +1692,7 @@ static void state_msaa_w(struct wined3d_context *context, const struct wined3d_s
|
||||||
|
|
||||||
static void state_msaa(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_msaa(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
if (state->render_states[WINED3D_RS_MULTISAMPLEANTIALIAS])
|
if (state->render_states[WINED3D_RS_MULTISAMPLEANTIALIAS])
|
||||||
{
|
{
|
||||||
|
@ -1707,7 +1708,7 @@ static void state_msaa(struct wined3d_context *context, const struct wined3d_sta
|
||||||
|
|
||||||
static void state_line_antialias(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_line_antialias(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
if (state->render_states[WINED3D_RS_EDGEANTIALIAS]
|
if (state->render_states[WINED3D_RS_EDGEANTIALIAS]
|
||||||
|| state->render_states[WINED3D_RS_ANTIALIASEDLINEENABLE])
|
|| state->render_states[WINED3D_RS_ANTIALIASEDLINEENABLE])
|
||||||
|
@ -1724,7 +1725,7 @@ static void state_line_antialias(struct wined3d_context *context, const struct w
|
||||||
|
|
||||||
static void state_scissor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_scissor(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
if (state->render_states[WINED3D_RS_SCISSORTESTENABLE])
|
if (state->render_states[WINED3D_RS_SCISSORTESTENABLE])
|
||||||
{
|
{
|
||||||
|
@ -1755,7 +1756,7 @@ static void state_scissor(struct wined3d_context *context, const struct wined3d_
|
||||||
* doesn't need to be scaled to account for GL vs D3D differences. */
|
* doesn't need to be scaled to account for GL vs D3D differences. */
|
||||||
static void state_depthbias(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_depthbias(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
if (state->render_states[WINED3D_RS_SLOPESCALEDEPTHBIAS]
|
if (state->render_states[WINED3D_RS_SLOPESCALEDEPTHBIAS]
|
||||||
|| state->render_states[WINED3D_RS_DEPTHBIAS])
|
|| state->render_states[WINED3D_RS_DEPTHBIAS])
|
||||||
|
@ -1892,13 +1893,13 @@ static void state_tessellation(struct wined3d_context *context, const struct win
|
||||||
|
|
||||||
static void state_nvdb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_nvdb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
union {
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
DWORD d;
|
union
|
||||||
|
{
|
||||||
|
uint32_t d;
|
||||||
float f;
|
float f;
|
||||||
} zmin, zmax;
|
} zmin, zmax;
|
||||||
|
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
|
||||||
|
|
||||||
if (state->render_states[WINED3D_RS_ADAPTIVETESS_X] == WINED3DFMT_NVDB)
|
if (state->render_states[WINED3D_RS_ADAPTIVETESS_X] == WINED3DFMT_NVDB)
|
||||||
{
|
{
|
||||||
zmin.d = state->render_states[WINED3D_RS_ADAPTIVETESS_Z];
|
zmin.d = state->render_states[WINED3D_RS_ADAPTIVETESS_Z];
|
||||||
|
@ -3118,7 +3119,7 @@ static void tex_colorop(struct wined3d_context *context, const struct wined3d_st
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
BOOL tex_used = context->fixed_function_usage_map & (1u << stage);
|
BOOL tex_used = context->fixed_function_usage_map & (1u << stage);
|
||||||
unsigned int mapped_stage = context_gl->tex_unit_map[stage];
|
unsigned int mapped_stage = context_gl->tex_unit_map[stage];
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
TRACE("Setting color op for stage %d\n", stage);
|
TRACE("Setting color op for stage %d\n", stage);
|
||||||
|
|
||||||
|
@ -3179,8 +3180,8 @@ void tex_alphaop(struct wined3d_context *context, const struct wined3d_state *st
|
||||||
unsigned int stage = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
unsigned int stage = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
BOOL tex_used = context->fixed_function_usage_map & (1u << stage);
|
BOOL tex_used = context->fixed_function_usage_map & (1u << stage);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
unsigned int mapped_stage = context_gl->tex_unit_map[stage];
|
unsigned int mapped_stage = context_gl->tex_unit_map[stage];
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
|
||||||
DWORD op, arg1, arg2, arg0;
|
DWORD op, arg1, arg2, arg0;
|
||||||
|
|
||||||
TRACE("Setting alpha op for stage %d\n", stage);
|
TRACE("Setting alpha op for stage %d\n", stage);
|
||||||
|
@ -3278,8 +3279,8 @@ static void transform_texture(struct wined3d_context *context, const struct wine
|
||||||
{
|
{
|
||||||
unsigned int tex = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
unsigned int tex = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
unsigned int mapped_stage = context_gl->tex_unit_map[tex];
|
unsigned int mapped_stage = context_gl->tex_unit_map[tex];
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
|
||||||
struct wined3d_matrix mat;
|
struct wined3d_matrix mat;
|
||||||
|
|
||||||
/* Ignore this when a vertex shader is used, or if the streams aren't sorted out yet */
|
/* Ignore this when a vertex shader is used, or if the streams aren't sorted out yet */
|
||||||
|
@ -3306,8 +3307,8 @@ static void tex_coordindex(struct wined3d_context *context, const struct wined3d
|
||||||
{
|
{
|
||||||
unsigned int stage = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
unsigned int stage = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
unsigned int mapped_stage = context_gl->tex_unit_map[stage];
|
unsigned int mapped_stage = context_gl->tex_unit_map[stage];
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
|
||||||
|
|
||||||
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 };
|
||||||
|
@ -3578,7 +3579,7 @@ static void wined3d_sampler_desc_from_sampler_states(struct wined3d_sampler_desc
|
||||||
if (texture_gl->t.flags & WINED3D_TEXTURE_COND_NP2)
|
if (texture_gl->t.flags & WINED3D_TEXTURE_COND_NP2)
|
||||||
{
|
{
|
||||||
desc->mip_filter = WINED3D_TEXF_NONE;
|
desc->mip_filter = WINED3D_TEXF_NONE;
|
||||||
if (context_gl->c.gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT])
|
if (context_gl->gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT])
|
||||||
desc->min_filter = WINED3D_TEXF_POINT;
|
desc->min_filter = WINED3D_TEXF_POINT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3591,7 +3592,7 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
unsigned int sampler_idx = state_id - STATE_SAMPLER(0);
|
unsigned int sampler_idx = state_id - STATE_SAMPLER(0);
|
||||||
unsigned int mapped_stage = context_gl->tex_unit_map[sampler_idx];
|
unsigned int mapped_stage = context_gl->tex_unit_map[sampler_idx];
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
TRACE("Sampler %u.\n", sampler_idx);
|
TRACE("Sampler %u.\n", sampler_idx);
|
||||||
|
|
||||||
|
@ -3713,7 +3714,7 @@ static void shader_bumpenv(struct wined3d_context *context, const struct wined3d
|
||||||
|
|
||||||
static void transform_world(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void transform_world(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
struct wined3d_matrix mat;
|
struct wined3d_matrix mat;
|
||||||
|
|
||||||
/* This function is called by transform_view below if the view matrix was changed too
|
/* This function is called by transform_view below if the view matrix was changed too
|
||||||
|
@ -3734,7 +3735,7 @@ static void transform_world(struct wined3d_context *context, const struct wined3
|
||||||
|
|
||||||
void clipplane(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
void clipplane(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
UINT index = state_id - STATE_CLIPPLANE(0);
|
UINT index = state_id - STATE_CLIPPLANE(0);
|
||||||
GLdouble plane[4];
|
GLdouble plane[4];
|
||||||
|
|
||||||
|
@ -3786,7 +3787,7 @@ static void state_vertexblend_w(struct wined3d_context *context, const struct wi
|
||||||
|
|
||||||
static void transform_view(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void transform_view(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
const struct wined3d_light_info *light = NULL;
|
const struct wined3d_light_info *light = NULL;
|
||||||
unsigned int k;
|
unsigned int k;
|
||||||
|
|
||||||
|
@ -3838,7 +3839,7 @@ static void transform_view(struct wined3d_context *context, const struct wined3d
|
||||||
|
|
||||||
static void transform_projection(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void transform_projection(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
struct wined3d_matrix projection;
|
struct wined3d_matrix projection;
|
||||||
|
|
||||||
gl_info->gl_ops.gl.p_glMatrixMode(GL_PROJECTION);
|
gl_info->gl_ops.gl.p_glMatrixMode(GL_PROJECTION);
|
||||||
|
@ -3866,7 +3867,7 @@ static void vdecl_miscpart(struct wined3d_context *context, const struct wined3d
|
||||||
static void vertexdeclaration(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void vertexdeclaration(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
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->gl_info;
|
||||||
BOOL useVertexShaderFunction = use_vs(state);
|
BOOL useVertexShaderFunction = use_vs(state);
|
||||||
BOOL updateFog = FALSE;
|
BOOL updateFog = FALSE;
|
||||||
BOOL transformed;
|
BOOL transformed;
|
||||||
|
@ -4034,7 +4035,7 @@ static void get_viewports(struct wined3d_context *context, const struct wined3d_
|
||||||
|
|
||||||
static void viewport_miscpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void viewport_miscpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
struct wined3d_viewport vp[WINED3D_MAX_VIEWPORTS];
|
struct wined3d_viewport vp[WINED3D_MAX_VIEWPORTS];
|
||||||
|
|
||||||
if (gl_info->supported[ARB_VIEWPORT_ARRAY])
|
if (gl_info->supported[ARB_VIEWPORT_ARRAY])
|
||||||
|
@ -4081,10 +4082,10 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wine
|
||||||
static void viewport_miscpart_cc(struct wined3d_context *context,
|
static void viewport_miscpart_cc(struct wined3d_context *context,
|
||||||
const struct wined3d_state *state, DWORD state_id)
|
const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
/* See get_projection_matrix() in utils.c for a discussion about those values. */
|
/* See get_projection_matrix() in utils.c for a discussion about those values. */
|
||||||
float pixel_center_offset = context->d3d_info->wined3d_creation_flags
|
float pixel_center_offset = context->d3d_info->wined3d_creation_flags
|
||||||
& WINED3D_PIXEL_CENTER_INTEGER ? 63.0f / 128.0f : -1.0f / 128.0f;
|
& WINED3D_PIXEL_CENTER_INTEGER ? 63.0f / 128.0f : -1.0f / 128.0f;
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
|
||||||
struct wined3d_viewport vp[WINED3D_MAX_VIEWPORTS];
|
struct wined3d_viewport vp[WINED3D_MAX_VIEWPORTS];
|
||||||
GLdouble depth_ranges[2 * WINED3D_MAX_VIEWPORTS];
|
GLdouble depth_ranges[2 * WINED3D_MAX_VIEWPORTS];
|
||||||
GLfloat viewports[4 * WINED3D_MAX_VIEWPORTS];
|
GLfloat viewports[4 * WINED3D_MAX_VIEWPORTS];
|
||||||
|
@ -4134,7 +4135,7 @@ static void viewport_vertexpart(struct wined3d_context *context, const struct wi
|
||||||
|
|
||||||
static void light(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void light(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
UINT Index = state_id - STATE_ACTIVELIGHT(0);
|
UINT Index = state_id - STATE_ACTIVELIGHT(0);
|
||||||
const struct wined3d_light_info *lightInfo = state->light_state.lights[Index];
|
const struct wined3d_light_info *lightInfo = state->light_state.lights[Index];
|
||||||
|
|
||||||
|
@ -4237,7 +4238,7 @@ static void light(struct wined3d_context *context, const struct wined3d_state *s
|
||||||
|
|
||||||
static void scissorrect(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void scissorrect(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
unsigned int height = 0;
|
unsigned int height = 0;
|
||||||
const RECT *r;
|
const RECT *r;
|
||||||
|
|
||||||
|
@ -4289,8 +4290,8 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st
|
||||||
|
|
||||||
static void indexbuffer(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void indexbuffer(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
const struct wined3d_stream_info *stream_info = &context->stream_info;
|
const struct wined3d_stream_info *stream_info = &context->stream_info;
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
|
||||||
|
|
||||||
if (!state->index_buffer || !stream_info->all_vbo)
|
if (!state->index_buffer || !stream_info->all_vbo)
|
||||||
{
|
{
|
||||||
|
@ -4321,7 +4322,7 @@ static void depth_clip(const struct wined3d_rasterizer_state *r, const struct wi
|
||||||
|
|
||||||
static void rasterizer(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void rasterizer(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
GLenum mode;
|
GLenum mode;
|
||||||
|
|
||||||
mode = state->rasterizer_state && state->rasterizer_state->desc.front_ccw ? GL_CCW : GL_CW;
|
mode = state->rasterizer_state && state->rasterizer_state->desc.front_ccw ? GL_CCW : GL_CW;
|
||||||
|
@ -4337,7 +4338,7 @@ static void rasterizer(struct wined3d_context *context, const struct wined3d_sta
|
||||||
|
|
||||||
static void rasterizer_cc(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void rasterizer_cc(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
GLenum mode;
|
GLenum mode;
|
||||||
|
|
||||||
mode = state->rasterizer_state && state->rasterizer_state->desc.front_ccw ? GL_CCW : GL_CW;
|
mode = state->rasterizer_state && state->rasterizer_state->desc.front_ccw ? GL_CCW : GL_CW;
|
||||||
|
@ -4362,7 +4363,7 @@ static void psorigin_w(struct wined3d_context *context, const struct wined3d_sta
|
||||||
|
|
||||||
static void psorigin(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void psorigin(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
GLint origin = context->render_offscreen ? GL_LOWER_LEFT : GL_UPPER_LEFT;
|
GLint origin = context->render_offscreen ? GL_LOWER_LEFT : GL_UPPER_LEFT;
|
||||||
|
|
||||||
GL_EXTCALL(glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, origin));
|
GL_EXTCALL(glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, origin));
|
||||||
|
@ -4371,7 +4372,7 @@ static void psorigin(struct wined3d_context *context, const struct wined3d_state
|
||||||
|
|
||||||
void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
|
TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
|
||||||
|
|
||||||
|
@ -4383,7 +4384,7 @@ void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state
|
||||||
|
|
||||||
static void state_cb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_cb(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
enum wined3d_shader_type shader_type;
|
enum wined3d_shader_type shader_type;
|
||||||
struct wined3d_buffer *buffer;
|
struct wined3d_buffer *buffer;
|
||||||
unsigned int i, base, count;
|
unsigned int i, base, count;
|
||||||
|
@ -4449,7 +4450,7 @@ static void state_uav_warn(struct wined3d_context *context, const struct wined3d
|
||||||
static void state_so(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
static void state_so(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
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->gl_info;
|
||||||
struct wined3d_buffer *buffer;
|
struct wined3d_buffer *buffer;
|
||||||
unsigned int offset, size, i;
|
unsigned int offset, size, i;
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ static void texture2d_depth_blt_fbo(const struct wined3d_device *device, struct
|
||||||
DWORD dst_location, const RECT *dst_rect)
|
DWORD dst_location, const RECT *dst_rect)
|
||||||
{
|
{
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
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->gl_info;
|
||||||
DWORD src_mask, dst_mask;
|
DWORD src_mask, dst_mask;
|
||||||
GLbitfield gl_mask;
|
GLbitfield gl_mask;
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ static void texture2d_depth_blt_fbo(const struct wined3d_device *device, struct
|
||||||
}
|
}
|
||||||
if (gl_mask & GL_STENCIL_BUFFER_BIT)
|
if (gl_mask & GL_STENCIL_BUFFER_BIT)
|
||||||
{
|
{
|
||||||
if (context->gl_info->supported[EXT_STENCIL_TWO_SIDE])
|
if (gl_info->supported[EXT_STENCIL_TWO_SIDE])
|
||||||
{
|
{
|
||||||
gl_info->gl_ops.gl.p_glDisable(GL_STENCIL_TEST_TWO_SIDE_EXT);
|
gl_info->gl_ops.gl.p_glDisable(GL_STENCIL_TEST_TWO_SIDE_EXT);
|
||||||
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_TWOSIDEDSTENCILMODE));
|
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_TWOSIDEDSTENCILMODE));
|
||||||
|
@ -218,7 +218,7 @@ void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *co
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gl_info = context->gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (src_location == WINED3D_LOCATION_DRAWABLE)
|
if (src_location == WINED3D_LOCATION_DRAWABLE)
|
||||||
{
|
{
|
||||||
|
@ -721,7 +721,7 @@ void texture2d_read_from_framebuffer(struct wined3d_texture *texture, unsigned i
|
||||||
else
|
else
|
||||||
restore_texture = NULL;
|
restore_texture = NULL;
|
||||||
context_gl = wined3d_context_gl(context);
|
context_gl = wined3d_context_gl(context);
|
||||||
gl_info = context->gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (src_location != resource->draw_binding)
|
if (src_location != resource->draw_binding)
|
||||||
{
|
{
|
||||||
|
@ -851,7 +851,7 @@ void texture2d_load_fb_texture(struct wined3d_texture_gl *texture_gl,
|
||||||
restore_texture = NULL;
|
restore_texture = NULL;
|
||||||
context_gl = wined3d_context_gl(context);
|
context_gl = wined3d_context_gl(context);
|
||||||
|
|
||||||
gl_info = context->gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
device_invalidate_state(device, STATE_FRAMEBUFFER);
|
device_invalidate_state(device, STATE_FRAMEBUFFER);
|
||||||
|
|
||||||
wined3d_texture_gl_prepare_texture(texture_gl, context_gl, srgb);
|
wined3d_texture_gl_prepare_texture(texture_gl, context_gl, srgb);
|
||||||
|
@ -904,7 +904,7 @@ static void fb_copy_to_texture_direct(struct wined3d_texture_gl *dst_texture, un
|
||||||
|
|
||||||
context = context_acquire(device, &src_texture->t, src_sub_resource_idx);
|
context = context_acquire(device, &src_texture->t, src_sub_resource_idx);
|
||||||
context_gl = wined3d_context_gl(context);
|
context_gl = wined3d_context_gl(context);
|
||||||
gl_info = context->gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
wined3d_context_gl_apply_blit_state(context_gl, device);
|
wined3d_context_gl_apply_blit_state(context_gl, device);
|
||||||
wined3d_texture_load(&dst_texture->t, context, FALSE);
|
wined3d_texture_load(&dst_texture->t, context, FALSE);
|
||||||
|
|
||||||
|
@ -1024,7 +1024,7 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_texture_gl *dst_texture,
|
||||||
/* Activate the Proper context for reading from the source surface, set it up for blitting */
|
/* Activate the Proper context for reading from the source surface, set it up for blitting */
|
||||||
context = context_acquire(device, &src_texture->t, src_sub_resource_idx);
|
context = context_acquire(device, &src_texture->t, src_sub_resource_idx);
|
||||||
context_gl = wined3d_context_gl(context);
|
context_gl = wined3d_context_gl(context);
|
||||||
gl_info = context->gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
wined3d_context_gl_apply_ffp_blit_state(context_gl, device);
|
wined3d_context_gl_apply_ffp_blit_state(context_gl, device);
|
||||||
wined3d_texture_load(&dst_texture->t, context, FALSE);
|
wined3d_texture_load(&dst_texture->t, context, FALSE);
|
||||||
|
|
||||||
|
@ -1445,6 +1445,7 @@ static DWORD fbo_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit
|
||||||
unsigned int dst_sub_resource_idx, DWORD dst_location, const RECT *dst_rect,
|
unsigned int dst_sub_resource_idx, DWORD dst_location, const RECT *dst_rect,
|
||||||
const struct wined3d_color_key *colour_key, enum wined3d_texture_filter_type filter)
|
const struct wined3d_color_key *colour_key, enum wined3d_texture_filter_type filter)
|
||||||
{
|
{
|
||||||
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
struct wined3d_resource *src_resource, *dst_resource;
|
struct wined3d_resource *src_resource, *dst_resource;
|
||||||
enum wined3d_blit_op blit_op = op;
|
enum wined3d_blit_op blit_op = op;
|
||||||
struct wined3d_device *device;
|
struct wined3d_device *device;
|
||||||
|
@ -1469,7 +1470,7 @@ static DWORD fbo_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit
|
||||||
blit_op = WINED3D_BLIT_OP_COLOR_BLIT;
|
blit_op = WINED3D_BLIT_OP_COLOR_BLIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fbo_blitter_supported(blit_op, context->gl_info,
|
if (!fbo_blitter_supported(blit_op, context_gl->gl_info,
|
||||||
src_resource, src_location, dst_resource, dst_location))
|
src_resource, src_location, dst_resource, dst_location))
|
||||||
{
|
{
|
||||||
if (!(next = blitter->next))
|
if (!(next = blitter->next))
|
||||||
|
@ -1565,7 +1566,8 @@ static DWORD raw_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit
|
||||||
{
|
{
|
||||||
struct wined3d_texture_gl *src_texture_gl = wined3d_texture_gl(src_texture);
|
struct wined3d_texture_gl *src_texture_gl = wined3d_texture_gl(src_texture);
|
||||||
struct wined3d_texture_gl *dst_texture_gl = wined3d_texture_gl(dst_texture);
|
struct wined3d_texture_gl *dst_texture_gl = wined3d_texture_gl(dst_texture);
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
unsigned int src_level, src_layer, dst_level, dst_layer;
|
unsigned int src_level, src_layer, dst_level, dst_layer;
|
||||||
struct wined3d_blitter *next;
|
struct wined3d_blitter *next;
|
||||||
GLuint src_name, dst_name;
|
GLuint src_name, dst_name;
|
||||||
|
@ -1710,7 +1712,7 @@ static BOOL ffp_blit_supported(enum wined3d_blit_op blit_op, const struct wined3
|
||||||
}
|
}
|
||||||
case WINED3D_BLIT_OP_COLOR_BLIT:
|
case WINED3D_BLIT_OP_COLOR_BLIT:
|
||||||
case WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST:
|
case WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST:
|
||||||
if (!context->gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
|
if (!wined3d_context_gl_const(context)->gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (TRACE_ON(d3d))
|
if (TRACE_ON(d3d))
|
||||||
|
@ -1873,7 +1875,7 @@ static DWORD ffp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit
|
||||||
{
|
{
|
||||||
struct wined3d_texture_gl *src_texture_gl = wined3d_texture_gl(src_texture);
|
struct wined3d_texture_gl *src_texture_gl = wined3d_texture_gl(src_texture);
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
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->gl_info;
|
||||||
struct wined3d_resource *src_resource, *dst_resource;
|
struct wined3d_resource *src_resource, *dst_resource;
|
||||||
struct wined3d_texture *staging_texture = NULL;
|
struct wined3d_texture *staging_texture = NULL;
|
||||||
struct wined3d_color_key old_blt_key;
|
struct wined3d_color_key old_blt_key;
|
||||||
|
|
|
@ -369,7 +369,7 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain,
|
||||||
static void swapchain_gl_set_swap_interval(struct wined3d_swapchain *swapchain,
|
static void swapchain_gl_set_swap_interval(struct wined3d_swapchain *swapchain,
|
||||||
struct wined3d_context_gl *context_gl, unsigned int swap_interval)
|
struct wined3d_context_gl *context_gl, unsigned int swap_interval)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
swap_interval = swap_interval <= 4 ? swap_interval : 1;
|
swap_interval = swap_interval <= 4 ? swap_interval : 1;
|
||||||
if (swapchain->swap_interval == swap_interval)
|
if (swapchain->swap_interval == swap_interval)
|
||||||
|
@ -456,7 +456,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gl_info = context->gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
swapchain_gl_set_swap_interval(swapchain, context_gl, swap_interval);
|
swapchain_gl_set_swap_interval(swapchain, context_gl, swap_interval);
|
||||||
|
|
||||||
|
|
|
@ -357,7 +357,7 @@ static BOOL wined3d_texture_copy_sysmem_location(struct wined3d_texture *texture
|
||||||
if (dst.buffer_object)
|
if (dst.buffer_object)
|
||||||
{
|
{
|
||||||
context = context_acquire(device, NULL, 0);
|
context = context_acquire(device, NULL, 0);
|
||||||
gl_info = context->gl_info;
|
gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, dst.buffer_object));
|
GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, dst.buffer_object));
|
||||||
GL_EXTCALL(glBufferSubData(GL_PIXEL_UNPACK_BUFFER, 0, size, src.addr));
|
GL_EXTCALL(glBufferSubData(GL_PIXEL_UNPACK_BUFFER, 0, size, src.addr));
|
||||||
GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
|
GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
|
||||||
|
@ -369,7 +369,7 @@ static BOOL wined3d_texture_copy_sysmem_location(struct wined3d_texture *texture
|
||||||
if (src.buffer_object)
|
if (src.buffer_object)
|
||||||
{
|
{
|
||||||
context = context_acquire(device, NULL, 0);
|
context = context_acquire(device, NULL, 0);
|
||||||
gl_info = context->gl_info;
|
gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, src.buffer_object));
|
GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, src.buffer_object));
|
||||||
GL_EXTCALL(glGetBufferSubData(GL_PIXEL_PACK_BUFFER, 0, size, dst.addr));
|
GL_EXTCALL(glGetBufferSubData(GL_PIXEL_PACK_BUFFER, 0, size, dst.addr));
|
||||||
GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, 0));
|
GL_EXTCALL(glBindBuffer(GL_PIXEL_PACK_BUFFER, 0));
|
||||||
|
@ -505,7 +505,7 @@ static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
|
||||||
&& !wined3d_texture_load_location(texture, i, context, map_binding))
|
&& !wined3d_texture_load_location(texture, i, context, map_binding))
|
||||||
ERR("Failed to load location %s.\n", wined3d_debug_location(map_binding));
|
ERR("Failed to load location %s.\n", wined3d_debug_location(map_binding));
|
||||||
if (texture->resource.map_binding == WINED3D_LOCATION_BUFFER)
|
if (texture->resource.map_binding == WINED3D_LOCATION_BUFFER)
|
||||||
wined3d_texture_remove_buffer_object(texture, i, context->gl_info);
|
wined3d_texture_remove_buffer_object(texture, i, wined3d_context_gl(context)->gl_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context)
|
if (context)
|
||||||
|
@ -643,14 +643,14 @@ static void wined3d_texture_gl_unload_texture(struct wined3d_texture_gl *texture
|
||||||
|| texture_gl->rb_multisample || texture_gl->rb_resolved)
|
|| texture_gl->rb_multisample || texture_gl->rb_resolved)
|
||||||
{
|
{
|
||||||
context = context_acquire(device, NULL, 0);
|
context = context_acquire(device, NULL, 0);
|
||||||
gl_info = context->gl_info;
|
gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (texture_gl->texture_rgb.name)
|
if (texture_gl->texture_rgb.name)
|
||||||
gltexture_delete(device, context->gl_info, &texture_gl->texture_rgb);
|
gltexture_delete(device, gl_info, &texture_gl->texture_rgb);
|
||||||
|
|
||||||
if (texture_gl->texture_srgb.name)
|
if (texture_gl->texture_srgb.name)
|
||||||
gltexture_delete(device, context->gl_info, &texture_gl->texture_srgb);
|
gltexture_delete(device, gl_info, &texture_gl->texture_srgb);
|
||||||
|
|
||||||
if (texture_gl->rb_multisample)
|
if (texture_gl->rb_multisample)
|
||||||
{
|
{
|
||||||
|
@ -842,7 +842,7 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||||
if (!context)
|
if (!context)
|
||||||
{
|
{
|
||||||
context = context_acquire(device, NULL, 0);
|
context = context_acquire(device, NULL, 0);
|
||||||
gl_info = context->gl_info;
|
gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
GL_EXTCALL(glDeleteBuffers(1, &buffer_object));
|
GL_EXTCALL(glDeleteBuffers(1, &buffer_object));
|
||||||
|
@ -892,7 +892,7 @@ static void wined3d_texture_gl_cleanup(struct wined3d_texture_gl *texture_gl)
|
||||||
if (!list_empty(&texture_gl->renderbuffers))
|
if (!list_empty(&texture_gl->renderbuffers))
|
||||||
{
|
{
|
||||||
context = context_acquire(device, NULL, 0);
|
context = context_acquire(device, NULL, 0);
|
||||||
gl_info = context->gl_info;
|
gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &texture_gl->renderbuffers, struct wined3d_renderbuffer_entry, entry)
|
LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &texture_gl->renderbuffers, struct wined3d_renderbuffer_entry, entry)
|
||||||
{
|
{
|
||||||
|
@ -938,7 +938,7 @@ void wined3d_texture_gl_bind(struct wined3d_texture_gl *texture_gl,
|
||||||
struct wined3d_context_gl *context_gl, BOOL srgb)
|
struct wined3d_context_gl *context_gl, BOOL srgb)
|
||||||
{
|
{
|
||||||
const struct wined3d_format *format = texture_gl->t.resource.format;
|
const struct wined3d_format *format = texture_gl->t.resource.format;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
const struct color_fixup_desc fixup = format->color_fixup;
|
const struct color_fixup_desc fixup = format->color_fixup;
|
||||||
struct gl_texture *gl_tex;
|
struct gl_texture *gl_tex;
|
||||||
GLenum target;
|
GLenum target;
|
||||||
|
@ -1088,7 +1088,7 @@ void wined3d_texture_gl_bind_and_dirtify(struct wined3d_texture_gl *texture_gl,
|
||||||
void wined3d_texture_gl_apply_sampler_desc(struct wined3d_texture_gl *texture_gl,
|
void wined3d_texture_gl_apply_sampler_desc(struct wined3d_texture_gl *texture_gl,
|
||||||
const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_context_gl *context_gl)
|
const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_context_gl *context_gl)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
GLenum target = texture_gl->target;
|
GLenum target = texture_gl->target;
|
||||||
struct gl_texture *gl_tex;
|
struct gl_texture *gl_tex;
|
||||||
DWORD state;
|
DWORD state;
|
||||||
|
@ -1455,7 +1455,7 @@ HRESULT CDECL wined3d_texture_set_color_key(struct wined3d_texture *texture,
|
||||||
void wined3d_texture_gl_set_compatible_renderbuffer(struct wined3d_texture_gl *texture_gl,
|
void wined3d_texture_gl_set_compatible_renderbuffer(struct wined3d_texture_gl *texture_gl,
|
||||||
struct wined3d_context_gl *context_gl, unsigned int level, const struct wined3d_rendertarget_info *rt)
|
struct wined3d_context_gl *context_gl, unsigned int level, const struct wined3d_rendertarget_info *rt)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_renderbuffer_entry *entry;
|
struct wined3d_renderbuffer_entry *entry;
|
||||||
unsigned int src_width, src_height;
|
unsigned int src_width, src_height;
|
||||||
unsigned int width, height;
|
unsigned int width, height;
|
||||||
|
@ -1720,7 +1720,7 @@ void wined3d_texture_gl_prepare_texture(struct wined3d_texture_gl *texture_gl,
|
||||||
{
|
{
|
||||||
DWORD alloc_flag = srgb ? WINED3D_TEXTURE_SRGB_ALLOCATED : WINED3D_TEXTURE_RGB_ALLOCATED;
|
DWORD alloc_flag = srgb ? WINED3D_TEXTURE_SRGB_ALLOCATED : WINED3D_TEXTURE_RGB_ALLOCATED;
|
||||||
const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info;
|
const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_resource *resource = &texture_gl->t.resource;
|
struct wined3d_resource *resource = &texture_gl->t.resource;
|
||||||
const struct wined3d_device *device = resource->device;
|
const struct wined3d_device *device = resource->device;
|
||||||
const struct wined3d_format *format = resource->format;
|
const struct wined3d_format *format = resource->format;
|
||||||
|
@ -1842,7 +1842,7 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case WINED3D_LOCATION_BUFFER:
|
case WINED3D_LOCATION_BUFFER:
|
||||||
wined3d_texture_prepare_buffer_object(texture, sub_resource_idx, context->gl_info);
|
wined3d_texture_prepare_buffer_object(texture, sub_resource_idx, context_gl->gl_info);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case WINED3D_LOCATION_TEXTURE_RGB:
|
case WINED3D_LOCATION_TEXTURE_RGB:
|
||||||
|
@ -1859,11 +1859,11 @@ BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case WINED3D_LOCATION_RB_MULTISAMPLE:
|
case WINED3D_LOCATION_RB_MULTISAMPLE:
|
||||||
wined3d_texture_gl_prepare_rb(texture_gl, context->gl_info, TRUE);
|
wined3d_texture_gl_prepare_rb(texture_gl, context_gl->gl_info, TRUE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case WINED3D_LOCATION_RB_RESOLVED:
|
case WINED3D_LOCATION_RB_RESOLVED:
|
||||||
wined3d_texture_gl_prepare_rb(texture_gl, context->gl_info, FALSE);
|
wined3d_texture_gl_prepare_rb(texture_gl, context_gl->gl_info, FALSE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -1916,7 +1916,7 @@ void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int s
|
||||||
unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, BOOL srgb)
|
unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, BOOL srgb)
|
||||||
{
|
{
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
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->gl_info;
|
||||||
unsigned int update_w = src_box->right - src_box->left;
|
unsigned int update_w = src_box->right - src_box->left;
|
||||||
unsigned int update_h = src_box->bottom - src_box->top;
|
unsigned int update_h = src_box->bottom - src_box->top;
|
||||||
unsigned int update_d = src_box->back - src_box->front;
|
unsigned int update_d = src_box->back - src_box->front;
|
||||||
|
@ -2148,7 +2148,7 @@ void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int s
|
||||||
static void wined3d_texture_gl_download_data_slow_path(struct wined3d_texture_gl *texture_gl,
|
static void wined3d_texture_gl_download_data_slow_path(struct wined3d_texture_gl *texture_gl,
|
||||||
unsigned int sub_resource_idx, struct wined3d_context_gl *context_gl, const struct wined3d_bo_address *data)
|
unsigned int sub_resource_idx, struct wined3d_context_gl *context_gl, const struct wined3d_bo_address *data)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_texture_sub_resource *sub_resource;
|
struct wined3d_texture_sub_resource *sub_resource;
|
||||||
unsigned int dst_row_pitch, dst_slice_pitch;
|
unsigned int dst_row_pitch, dst_slice_pitch;
|
||||||
unsigned int src_row_pitch, src_slice_pitch;
|
unsigned int src_row_pitch, src_slice_pitch;
|
||||||
|
@ -2381,7 +2381,7 @@ static void wined3d_texture_gl_download_data(struct wined3d_context *context,
|
||||||
{
|
{
|
||||||
struct wined3d_texture_gl *src_texture_gl = wined3d_texture_gl(src_texture);
|
struct wined3d_texture_gl *src_texture_gl = wined3d_texture_gl(src_texture);
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
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->gl_info;
|
||||||
unsigned int src_level, src_width, src_height, src_depth;
|
unsigned int src_level, src_width, src_height, src_depth;
|
||||||
unsigned int src_row_pitch, src_slice_pitch;
|
unsigned int src_row_pitch, src_slice_pitch;
|
||||||
const struct wined3d_format_gl *format_gl;
|
const struct wined3d_format_gl *format_gl;
|
||||||
|
@ -2622,8 +2622,8 @@ static BOOL wined3d_texture_gl_load_texture(struct wined3d_texture_gl *texture_g
|
||||||
unsigned int sub_resource_idx, struct wined3d_context_gl *context_gl, BOOL srgb)
|
unsigned int sub_resource_idx, struct wined3d_context_gl *context_gl, BOOL srgb)
|
||||||
{
|
{
|
||||||
unsigned int width, height, level, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch;
|
unsigned int width, height, level, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch;
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
|
||||||
struct wined3d_device *device = texture_gl->t.resource.device;
|
struct wined3d_device *device = texture_gl->t.resource.device;
|
||||||
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
const struct wined3d_color_key_conversion *conversion;
|
const struct wined3d_color_key_conversion *conversion;
|
||||||
struct wined3d_texture_sub_resource *sub_resource;
|
struct wined3d_texture_sub_resource *sub_resource;
|
||||||
const struct wined3d_format *format;
|
const struct wined3d_format *format;
|
||||||
|
@ -2880,7 +2880,7 @@ static void wined3d_texture_gl_unload(struct wined3d_resource *resource)
|
||||||
TRACE("texture_gl %p.\n", texture_gl);
|
TRACE("texture_gl %p.\n", texture_gl);
|
||||||
|
|
||||||
context = context_acquire(device, NULL, 0);
|
context = context_acquire(device, NULL, 0);
|
||||||
gl_info = context->gl_info;
|
gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
|
|
||||||
for (i = 0; i < sub_count; ++i)
|
for (i = 0; i < sub_count; ++i)
|
||||||
{
|
{
|
||||||
|
@ -2905,7 +2905,7 @@ static void wined3d_texture_gl_unload(struct wined3d_resource *resource)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sub_resource->buffer_object)
|
if (sub_resource->buffer_object)
|
||||||
wined3d_texture_remove_buffer_object(&texture_gl->t, i, context->gl_info);
|
wined3d_texture_remove_buffer_object(&texture_gl->t, i, gl_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &texture_gl->renderbuffers, struct wined3d_renderbuffer_entry, entry)
|
LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &texture_gl->renderbuffers, struct wined3d_renderbuffer_entry, entry)
|
||||||
|
|
|
@ -6340,20 +6340,22 @@ void texture_activate_dimensions(struct wined3d_texture *texture, const struct w
|
||||||
/* Context activation is done by the caller (state handler). */
|
/* Context activation is done by the caller (state handler). */
|
||||||
void sampler_texdim(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
void sampler_texdim(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||||
{
|
{
|
||||||
|
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
||||||
unsigned int sampler = state_id - STATE_SAMPLER(0);
|
unsigned int sampler = state_id - STATE_SAMPLER(0);
|
||||||
unsigned int mapped_stage = wined3d_context_gl(context)->tex_unit_map[sampler];
|
unsigned int mapped_stage;
|
||||||
|
|
||||||
/* No need to enable / disable anything here for unused samplers. The
|
/* No need to enable / disable anything here for unused samplers. The
|
||||||
* tex_colorop handler takes care. Also no action is needed with pixel
|
* tex_colorop handler takes care. Also no action is needed with pixel
|
||||||
* shaders, or if tex_colorop will take care of this business. */
|
* shaders, or if tex_colorop will take care of this business. */
|
||||||
if (mapped_stage == WINED3D_UNMAPPED_STAGE || mapped_stage >= context->gl_info->limits.textures)
|
mapped_stage = context_gl->tex_unit_map[sampler];
|
||||||
|
if (mapped_stage == WINED3D_UNMAPPED_STAGE || mapped_stage >= context_gl->gl_info->limits.textures)
|
||||||
return;
|
return;
|
||||||
if (sampler >= context->lowest_disabled_stage)
|
if (sampler >= context->lowest_disabled_stage)
|
||||||
return;
|
return;
|
||||||
if (isStateDirty(context, STATE_TEXTURESTAGE(sampler, WINED3D_TSS_COLOR_OP)))
|
if (isStateDirty(context, STATE_TEXTURESTAGE(sampler, WINED3D_TSS_COLOR_OP)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
texture_activate_dimensions(state->textures[sampler], context->gl_info);
|
texture_activate_dimensions(state->textures[sampler], context_gl->gl_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
int wined3d_ffp_frag_program_key_compare(const void *key, const struct wine_rb_entry *entry)
|
int wined3d_ffp_frag_program_key_compare(const void *key, const struct wine_rb_entry *entry)
|
||||||
|
|
|
@ -181,7 +181,7 @@ static void create_texture_view(struct wined3d_gl_view *view, GLenum view_target
|
||||||
|
|
||||||
context = context_acquire(texture_gl->t.resource.device, NULL, 0);
|
context = context_acquire(texture_gl->t.resource.device, NULL, 0);
|
||||||
context_gl = wined3d_context_gl(context);
|
context_gl = wined3d_context_gl(context);
|
||||||
gl_info = context->gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
|
|
||||||
if (!gl_info->supported[ARB_TEXTURE_VIEW])
|
if (!gl_info->supported[ARB_TEXTURE_VIEW])
|
||||||
{
|
{
|
||||||
|
@ -249,7 +249,7 @@ static void create_buffer_texture(struct wined3d_gl_view *view, struct wined3d_c
|
||||||
unsigned int offset, unsigned int size)
|
unsigned int offset, unsigned int size)
|
||||||
{
|
{
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
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->gl_info;
|
||||||
const struct wined3d_format_gl *view_format_gl;
|
const struct wined3d_format_gl *view_format_gl;
|
||||||
|
|
||||||
if (!gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT])
|
if (!gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT])
|
||||||
|
@ -356,7 +356,7 @@ static void wined3d_rendertarget_view_gl_destroy_object(void *object)
|
||||||
struct wined3d_context *context;
|
struct wined3d_context *context;
|
||||||
|
|
||||||
context = context_acquire(device, NULL, 0);
|
context = context_acquire(device, NULL, 0);
|
||||||
gl_info = context->gl_info;
|
gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
context_gl_resource_released(device, view_gl->gl_view.name, FALSE);
|
context_gl_resource_released(device, view_gl->gl_view.name, FALSE);
|
||||||
gl_info->gl_ops.gl.p_glDeleteTextures(1, &view_gl->gl_view.name);
|
gl_info->gl_ops.gl.p_glDeleteTextures(1, &view_gl->gl_view.name);
|
||||||
checkGLcall("glDeleteTextures");
|
checkGLcall("glDeleteTextures");
|
||||||
|
@ -685,7 +685,7 @@ static void wined3d_shader_resource_view_gl_destroy_object(void *object)
|
||||||
struct wined3d_context *context;
|
struct wined3d_context *context;
|
||||||
|
|
||||||
context = context_acquire(view_gl->v.resource->device, NULL, 0);
|
context = context_acquire(view_gl->v.resource->device, NULL, 0);
|
||||||
gl_info = context->gl_info;
|
gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
gl_info->gl_ops.gl.p_glDeleteTextures(1, &view_gl->gl_view.name);
|
gl_info->gl_ops.gl.p_glDeleteTextures(1, &view_gl->gl_view.name);
|
||||||
checkGLcall("glDeleteTextures");
|
checkGLcall("glDeleteTextures");
|
||||||
context_release(context);
|
context_release(context);
|
||||||
|
@ -830,7 +830,7 @@ HRESULT CDECL wined3d_shader_resource_view_create(const struct wined3d_view_desc
|
||||||
void wined3d_shader_resource_view_gl_bind(struct wined3d_shader_resource_view_gl *view_gl,
|
void wined3d_shader_resource_view_gl_bind(struct wined3d_shader_resource_view_gl *view_gl,
|
||||||
unsigned int unit, struct wined3d_sampler *sampler, struct wined3d_context_gl *context_gl)
|
unsigned int unit, struct wined3d_sampler *sampler, struct wined3d_context_gl *context_gl)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context_gl->c.gl_info;
|
const struct wined3d_gl_info *gl_info = context_gl->gl_info;
|
||||||
struct wined3d_texture_gl *texture_gl;
|
struct wined3d_texture_gl *texture_gl;
|
||||||
|
|
||||||
wined3d_context_gl_active_texture(context_gl, gl_info, unit);
|
wined3d_context_gl_active_texture(context_gl, gl_info, unit);
|
||||||
|
@ -887,7 +887,7 @@ void shader_resource_view_generate_mipmaps(struct wined3d_shader_resource_view *
|
||||||
|
|
||||||
context = context_acquire(view_gl->v.resource->device, NULL, 0);
|
context = context_acquire(view_gl->v.resource->device, NULL, 0);
|
||||||
context_gl = wined3d_context_gl(context);
|
context_gl = wined3d_context_gl(context);
|
||||||
gl_info = context->gl_info;
|
gl_info = context_gl->gl_info;
|
||||||
layer_count = view_gl->v.desc.u.texture.layer_count;
|
layer_count = view_gl->v.desc.u.texture.layer_count;
|
||||||
level_count = view_gl->v.desc.u.texture.level_count;
|
level_count = view_gl->v.desc.u.texture.level_count;
|
||||||
base_level = view_gl->v.desc.u.texture.level_idx;
|
base_level = view_gl->v.desc.u.texture.level_idx;
|
||||||
|
@ -983,7 +983,7 @@ static void wined3d_unordered_access_view_gl_destroy_object(void *object)
|
||||||
struct wined3d_context *context;
|
struct wined3d_context *context;
|
||||||
|
|
||||||
context = context_acquire(view_gl->v.resource->device, NULL, 0);
|
context = context_acquire(view_gl->v.resource->device, NULL, 0);
|
||||||
gl_info = context->gl_info;
|
gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
if (view_gl->gl_view.name)
|
if (view_gl->gl_view.name)
|
||||||
gl_info->gl_ops.gl.p_glDeleteTextures(1, &view_gl->gl_view.name);
|
gl_info->gl_ops.gl.p_glDeleteTextures(1, &view_gl->gl_view.name);
|
||||||
if (view_gl->counter_bo)
|
if (view_gl->counter_bo)
|
||||||
|
@ -1034,7 +1034,7 @@ void wined3d_unordered_access_view_clear_uint(struct wined3d_unordered_access_vi
|
||||||
const struct wined3d_uvec4 *clear_value, struct wined3d_context *context)
|
const struct wined3d_uvec4 *clear_value, struct wined3d_context *context)
|
||||||
{
|
{
|
||||||
struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
|
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->gl_info;
|
||||||
const struct wined3d_format_gl *format;
|
const struct wined3d_format_gl *format;
|
||||||
struct wined3d_buffer_gl *buffer_gl;
|
struct wined3d_buffer_gl *buffer_gl;
|
||||||
struct wined3d_resource *resource;
|
struct wined3d_resource *resource;
|
||||||
|
@ -1084,7 +1084,7 @@ void wined3d_unordered_access_view_set_counter(struct wined3d_unordered_access_v
|
||||||
return;
|
return;
|
||||||
|
|
||||||
context = context_acquire(view_gl->v.resource->device, NULL, 0);
|
context = context_acquire(view_gl->v.resource->device, NULL, 0);
|
||||||
gl_info = context->gl_info;
|
gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
GL_EXTCALL(glBindBuffer(GL_ATOMIC_COUNTER_BUFFER, view_gl->counter_bo));
|
GL_EXTCALL(glBindBuffer(GL_ATOMIC_COUNTER_BUFFER, view_gl->counter_bo));
|
||||||
GL_EXTCALL(glBufferSubData(GL_ATOMIC_COUNTER_BUFFER, 0, sizeof(value), &value));
|
GL_EXTCALL(glBufferSubData(GL_ATOMIC_COUNTER_BUFFER, 0, sizeof(value), &value));
|
||||||
checkGLcall("set atomic counter");
|
checkGLcall("set atomic counter");
|
||||||
|
@ -1129,7 +1129,7 @@ static void wined3d_unordered_access_view_gl_cs_init(void *object)
|
||||||
struct wined3d_context *context;
|
struct wined3d_context *context;
|
||||||
|
|
||||||
context = context_acquire(resource->device, NULL, 0);
|
context = context_acquire(resource->device, NULL, 0);
|
||||||
gl_info = context->gl_info;
|
gl_info = wined3d_context_gl(context)->gl_info;
|
||||||
create_buffer_view(&view_gl->gl_view, context, desc, buffer, view_gl->v.format);
|
create_buffer_view(&view_gl->gl_view, context, desc, buffer, view_gl->v.format);
|
||||||
if (desc->flags & (WINED3D_VIEW_BUFFER_COUNTER | WINED3D_VIEW_BUFFER_APPEND))
|
if (desc->flags & (WINED3D_VIEW_BUFFER_COUNTER | WINED3D_VIEW_BUFFER_APPEND))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1889,7 +1889,6 @@ struct wined3d_fb_state
|
||||||
|
|
||||||
struct wined3d_context
|
struct wined3d_context
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info;
|
|
||||||
const struct wined3d_d3d_info *d3d_info;
|
const struct wined3d_d3d_info *d3d_info;
|
||||||
const struct wined3d_state_entry *state_table;
|
const struct wined3d_state_entry *state_table;
|
||||||
/* State dirtification
|
/* State dirtification
|
||||||
|
@ -1976,6 +1975,8 @@ struct wined3d_context_gl
|
||||||
{
|
{
|
||||||
struct wined3d_context c;
|
struct wined3d_context c;
|
||||||
|
|
||||||
|
const struct wined3d_gl_info *gl_info;
|
||||||
|
|
||||||
DWORD tid; /* Thread ID which owns this context at the moment. */
|
DWORD tid; /* Thread ID which owns this context at the moment. */
|
||||||
|
|
||||||
uint32_t dc_is_private : 1;
|
uint32_t dc_is_private : 1;
|
||||||
|
|
Loading…
Reference in New Issue