Commit da1e5573 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Rename WineD3DContext to struct wined3d_context.

parent 1d647283
...@@ -534,7 +534,7 @@ static void shader_arb_load_constants( ...@@ -534,7 +534,7 @@ static void shader_arb_load_constants(
IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) device; IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) device;
IWineD3DStateBlockImpl* stateBlock = deviceImpl->stateBlock; IWineD3DStateBlockImpl* stateBlock = deviceImpl->stateBlock;
const struct WineD3DContext *context = context_get_current(); const struct wined3d_context *context = context_get_current();
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
if (useVertexShader) { if (useVertexShader) {
...@@ -560,7 +560,7 @@ static void shader_arb_load_constants( ...@@ -560,7 +560,7 @@ static void shader_arb_load_constants(
static void shader_arb_update_float_vertex_constants(IWineD3DDevice *iface, UINT start, UINT count) static void shader_arb_update_float_vertex_constants(IWineD3DDevice *iface, UINT start, UINT count)
{ {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
struct WineD3DContext *context = context_get_current(); struct wined3d_context *context = context_get_current();
/* We don't want shader constant dirtification to be an O(contexts), so just dirtify the active /* We don't want shader constant dirtification to be an O(contexts), so just dirtify the active
* context. On a context switch the old context will be fully dirtified */ * context. On a context switch the old context will be fully dirtified */
...@@ -573,7 +573,7 @@ static void shader_arb_update_float_vertex_constants(IWineD3DDevice *iface, UINT ...@@ -573,7 +573,7 @@ static void shader_arb_update_float_vertex_constants(IWineD3DDevice *iface, UINT
static void shader_arb_update_float_pixel_constants(IWineD3DDevice *iface, UINT start, UINT count) static void shader_arb_update_float_pixel_constants(IWineD3DDevice *iface, UINT start, UINT count)
{ {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
struct WineD3DContext *context = context_get_current(); struct wined3d_context *context = context_get_current();
/* We don't want shader constant dirtification to be an O(contexts), so just dirtify the active /* We don't want shader constant dirtification to be an O(contexts), so just dirtify the active
* context. On a context switch the old context will be fully dirtified */ * context. On a context switch the old context will be fully dirtified */
...@@ -4215,7 +4215,7 @@ static inline void find_arb_vs_compile_args(IWineD3DVertexShaderImpl *shader, IW ...@@ -4215,7 +4215,7 @@ static inline void find_arb_vs_compile_args(IWineD3DVertexShaderImpl *shader, IW
static void shader_arb_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) { static void shader_arb_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
struct shader_arb_priv *priv = This->shader_priv; struct shader_arb_priv *priv = This->shader_priv;
struct WineD3DContext *context = context_get_current(); struct wined3d_context *context = context_get_current();
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
int i; int i;
...@@ -5161,7 +5161,8 @@ static void arbfp_get_caps(WINED3DDEVTYPE devtype, const struct wined3d_gl_info ...@@ -5161,7 +5161,8 @@ static void arbfp_get_caps(WINED3DDEVTYPE devtype, const struct wined3d_gl_info
#undef GLINFO_LOCATION #undef GLINFO_LOCATION
#define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info #define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info
static void state_texfactor_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void state_texfactor_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
float col[4]; float col[4];
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
...@@ -5182,7 +5183,8 @@ static void state_texfactor_arbfp(DWORD state, IWineD3DStateBlockImpl *statebloc ...@@ -5182,7 +5183,8 @@ static void state_texfactor_arbfp(DWORD state, IWineD3DStateBlockImpl *statebloc
} }
static void state_arb_specularenable(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void state_arb_specularenable(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
float col[4]; float col[4];
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
...@@ -5209,7 +5211,8 @@ static void state_arb_specularenable(DWORD state, IWineD3DStateBlockImpl *stateb ...@@ -5209,7 +5211,8 @@ static void state_arb_specularenable(DWORD state, IWineD3DStateBlockImpl *stateb
checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_SPECULAR_ENABLE, col)"); checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_SPECULAR_ENABLE, col)");
} }
static void set_bumpmat_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void set_bumpmat_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1); DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
float mat[2][2]; float mat[2][2];
...@@ -5244,7 +5247,8 @@ static void set_bumpmat_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, W ...@@ -5244,7 +5247,8 @@ static void set_bumpmat_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, W
checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_BUMPMAT(stage), &mat[0][0])"); checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_BUMPMAT(stage), &mat[0][0])");
} }
static void tex_bumpenvlum_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void tex_bumpenvlum_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1); DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
float param[4]; float param[4];
...@@ -5751,7 +5755,8 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, IWi ...@@ -5751,7 +5755,8 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, IWi
return ret; return ret;
} }
static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
struct shader_arb_priv *priv = device->fragment_priv; struct shader_arb_priv *priv = device->fragment_priv;
BOOL use_pshader = use_ps(stateblock); BOOL use_pshader = use_ps(stateblock);
...@@ -5848,7 +5853,8 @@ static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, ...@@ -5848,7 +5853,8 @@ static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock,
* is that changing the fog start and fog end(which links to FOGENABLE in vertex) results in the * is that changing the fog start and fog end(which links to FOGENABLE in vertex) results in the
* fragment_prog_arbfp function being called because FOGENABLE is dirty, which calls this function here * fragment_prog_arbfp function being called because FOGENABLE is dirty, which calls this function here
*/ */
static void state_arbfp_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void state_arbfp_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
enum fogsource new_source; enum fogsource new_source;
TRACE("state %#x, stateblock %p, context %p\n", state, stateblock, context); TRACE("state %#x, stateblock %p, context %p\n", state, stateblock, context);
...@@ -5878,7 +5884,8 @@ static void state_arbfp_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, Win ...@@ -5878,7 +5884,8 @@ static void state_arbfp_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, Win
} }
} }
static void textransform(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void textransform(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
if(!isStateDirty(context, STATE_PIXELSHADER)) { if(!isStateDirty(context, STATE_PIXELSHADER)) {
fragment_prog_arbfp(state, stateblock, context); fragment_prog_arbfp(state, stateblock, context);
} }
......
...@@ -796,7 +796,8 @@ static GLuint gen_ati_shader(const struct texture_stage_op op[MAX_TEXTURES], con ...@@ -796,7 +796,8 @@ static GLuint gen_ati_shader(const struct texture_stage_op op[MAX_TEXTURES], con
#undef GLINFO_LOCATION #undef GLINFO_LOCATION
#define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info #define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info
static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
IWineD3DDeviceImpl *This = stateblock->wineD3DDevice; IWineD3DDeviceImpl *This = stateblock->wineD3DDevice;
const struct atifs_ffp_desc *desc; const struct atifs_ffp_desc *desc;
struct ffp_frag_settings settings; struct ffp_frag_settings settings;
...@@ -842,7 +843,8 @@ static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, Wi ...@@ -842,7 +843,8 @@ static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, Wi
GL_EXTCALL(glBindFragmentShaderATI(desc->shader)); GL_EXTCALL(glBindFragmentShaderATI(desc->shader));
} }
static void state_texfactor_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void state_texfactor_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
float col[4]; float col[4];
D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_TEXTUREFACTOR], col); D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_TEXTUREFACTOR], col);
...@@ -850,7 +852,8 @@ static void state_texfactor_atifs(DWORD state, IWineD3DStateBlockImpl *statebloc ...@@ -850,7 +852,8 @@ static void state_texfactor_atifs(DWORD state, IWineD3DStateBlockImpl *statebloc
checkGLcall("glSetFragmentShaderConstantATI(ATI_FFP_CONST_TFACTOR, col)"); checkGLcall("glSetFragmentShaderConstantATI(ATI_FFP_CONST_TFACTOR, col)");
} }
static void set_bumpmat(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void set_bumpmat(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1); DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
float mat[2][2]; float mat[2][2];
...@@ -873,13 +876,15 @@ static void set_bumpmat(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D ...@@ -873,13 +876,15 @@ static void set_bumpmat(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
checkGLcall("glSetFragmentShaderConstantATI(ATI_FFP_CONST_BUMPMAT(stage), mat)"); checkGLcall("glSetFragmentShaderConstantATI(ATI_FFP_CONST_BUMPMAT(stage), mat)");
} }
static void textransform(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void textransform(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
if(!isStateDirty(context, STATE_PIXELSHADER)) { if(!isStateDirty(context, STATE_PIXELSHADER)) {
set_tex_op_atifs(state, stateblock, context); set_tex_op_atifs(state, stateblock, context);
} }
} }
static void atifs_apply_pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void atifs_apply_pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
BOOL use_vshader = use_vs(stateblock); BOOL use_vshader = use_vs(stateblock);
......
...@@ -4888,7 +4888,7 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfa ...@@ -4888,7 +4888,7 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfa
UINT drawable_width, drawable_height; UINT drawable_width, drawable_height;
IWineD3DSurfaceImpl *depth_stencil = (IWineD3DSurfaceImpl *) This->stencilBufferTarget; IWineD3DSurfaceImpl *depth_stencil = (IWineD3DSurfaceImpl *) This->stencilBufferTarget;
IWineD3DSwapChainImpl *swapchain = NULL; IWineD3DSwapChainImpl *swapchain = NULL;
struct WineD3DContext *context; struct wined3d_context *context;
/* 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
...@@ -6011,7 +6011,7 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface, ...@@ -6011,7 +6011,7 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface,
const WINED3DRECT *rect, const float color[4]) const WINED3DRECT *rect, const float color[4])
{ {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
struct WineD3DContext *context; struct wined3d_context *context;
IWineD3DSwapChain *swapchain; IWineD3DSwapChain *swapchain;
swapchain = get_swapchain(surface); swapchain = get_swapchain(surface);
...@@ -6390,7 +6390,7 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED ...@@ -6390,7 +6390,7 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
GLbitfield mask = GL_COLOR_BUFFER_BIT; /* TODO: Support blitting depth/stencil surfaces */ GLbitfield mask = GL_COLOR_BUFFER_BIT; /* TODO: Support blitting depth/stencil surfaces */
IWineD3DSwapChain *src_swapchain, *dst_swapchain; IWineD3DSwapChain *src_swapchain, *dst_swapchain;
struct WineD3DContext *context; struct wined3d_context *context;
GLenum gl_filter; GLenum gl_filter;
POINT offset = {0, 0}; POINT offset = {0, 0};
...@@ -6593,7 +6593,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice * ...@@ -6593,7 +6593,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice *
|| ((IWineD3DSurfaceImpl *)This->stencilBufferTarget)->Flags & SFLAG_DISCARD) { || ((IWineD3DSurfaceImpl *)This->stencilBufferTarget)->Flags & SFLAG_DISCARD) {
surface_modify_ds_location(This->stencilBufferTarget, SFLAG_DS_DISCARDED); surface_modify_ds_location(This->stencilBufferTarget, SFLAG_DS_DISCARDED);
} else { } else {
struct WineD3DContext *context = ActivateContext(This, This->render_targets[0], CTXUSAGE_RESOURCELOAD); struct wined3d_context *context = ActivateContext(This, This->render_targets[0], CTXUSAGE_RESOURCELOAD);
surface_load_ds_location(This->stencilBufferTarget, context, SFLAG_DS_OFFSCREEN); surface_load_ds_location(This->stencilBufferTarget, context, SFLAG_DS_OFFSCREEN);
surface_modify_ds_location(This->stencilBufferTarget, SFLAG_DS_OFFSCREEN); surface_modify_ds_location(This->stencilBufferTarget, SFLAG_DS_OFFSCREEN);
} }
...@@ -7679,10 +7679,10 @@ const DWORD SavedVertexStates_S[NUM_SAVEDVERTEXSTATES_S] = { ...@@ -7679,10 +7679,10 @@ const DWORD SavedVertexStates_S[NUM_SAVEDVERTEXSTATES_S] = {
void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state) { void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state) {
DWORD rep = This->StateTable[state].representative; DWORD rep = This->StateTable[state].representative;
struct wined3d_context *context;
DWORD idx; DWORD idx;
BYTE shift; BYTE shift;
UINT i; UINT i;
WineD3DContext *context;
if(!rep) return; if(!rep) return;
for(i = 0; i < This->numContexts; i++) { for(i = 0; i < This->numContexts; i++) {
...@@ -7696,7 +7696,7 @@ void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state) { ...@@ -7696,7 +7696,7 @@ void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state) {
} }
} }
void get_drawable_size_pbuffer(struct WineD3DContext *context, UINT *width, UINT *height) void get_drawable_size_pbuffer(struct wined3d_context *context, UINT *width, UINT *height)
{ {
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->current_rt)->resource.wineD3DDevice; IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->current_rt)->resource.wineD3DDevice;
/* The drawable size of a pbuffer render target is the current pbuffer size. */ /* The drawable size of a pbuffer render target is the current pbuffer size. */
...@@ -7704,7 +7704,7 @@ void get_drawable_size_pbuffer(struct WineD3DContext *context, UINT *width, UINT ...@@ -7704,7 +7704,7 @@ void get_drawable_size_pbuffer(struct WineD3DContext *context, UINT *width, UINT
*height = device->pbufferHeight; *height = device->pbufferHeight;
} }
void get_drawable_size_fbo(struct WineD3DContext *context, UINT *width, UINT *height) void get_drawable_size_fbo(struct wined3d_context *context, UINT *width, UINT *height)
{ {
IWineD3DSurfaceImpl *surface = (IWineD3DSurfaceImpl *)context->current_rt; IWineD3DSurfaceImpl *surface = (IWineD3DSurfaceImpl *)context->current_rt;
/* The drawable size of a fbo target is the opengl texture size, which is the power of two size. */ /* The drawable size of a fbo target is the opengl texture size, which is the power of two size. */
...@@ -7712,7 +7712,7 @@ void get_drawable_size_fbo(struct WineD3DContext *context, UINT *width, UINT *he ...@@ -7712,7 +7712,7 @@ void get_drawable_size_fbo(struct WineD3DContext *context, UINT *width, UINT *he
*height = surface->pow2Height; *height = surface->pow2Height;
} }
void get_drawable_size_backbuffer(struct WineD3DContext *context, UINT *width, UINT *height) void get_drawable_size_backbuffer(struct wined3d_context *context, UINT *width, UINT *height)
{ {
IWineD3DSurfaceImpl *surface = (IWineD3DSurfaceImpl *)context->surface; IWineD3DSurfaceImpl *surface = (IWineD3DSurfaceImpl *)context->surface;
/* The drawable size of a backbuffer / aux buffer offscreen target is the size of the /* The drawable size of a backbuffer / aux buffer offscreen target is the size of the
......
...@@ -73,7 +73,7 @@ static void drawStridedFast(IWineD3DDevice *iface, GLenum primitive_type, ...@@ -73,7 +73,7 @@ static void drawStridedFast(IWineD3DDevice *iface, GLenum primitive_type,
static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_stream_info *si, UINT NumVertexes, static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_stream_info *si, UINT NumVertexes,
GLenum glPrimType, const void *idxData, UINT idxSize, UINT minIndex, UINT startIdx) GLenum glPrimType, const void *idxData, UINT idxSize, UINT minIndex, UINT startIdx)
{ {
struct WineD3DContext *context = context_get_current(); struct wined3d_context *context = context_get_current();
unsigned int textureNo = 0; unsigned int textureNo = 0;
const WORD *pIdxBufS = NULL; const WORD *pIdxBufS = NULL;
const DWORD *pIdxBufL = NULL; const DWORD *pIdxBufL = NULL;
...@@ -559,7 +559,7 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT numberOfVertice ...@@ -559,7 +559,7 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT numberOfVertice
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DSurfaceImpl *target; IWineD3DSurfaceImpl *target;
struct WineD3DContext *context; struct wined3d_context *context;
unsigned int i; unsigned int i;
if (!index_count) return; if (!index_count) return;
......
...@@ -147,7 +147,7 @@ static void WINE_GLAPI wine_glGetDoublev(GLenum pname, GLdouble* params) { ...@@ -147,7 +147,7 @@ static void WINE_GLAPI wine_glGetDoublev(GLenum pname, GLdouble* params) {
static void (WINE_GLAPI *old_fogcoord_glEnable) (GLenum cap) = NULL; static void (WINE_GLAPI *old_fogcoord_glEnable) (GLenum cap) = NULL;
static void WINE_GLAPI wine_glEnable(GLenum cap) { static void WINE_GLAPI wine_glEnable(GLenum cap) {
if(cap == GL_FOG) { if(cap == GL_FOG) {
struct WineD3DContext *ctx = context_get_current(); struct wined3d_context *ctx = context_get_current();
ctx->fog_enabled = 1; ctx->fog_enabled = 1;
if(ctx->gl_fog_source != GL_FRAGMENT_DEPTH_EXT) return; if(ctx->gl_fog_source != GL_FRAGMENT_DEPTH_EXT) return;
} }
...@@ -157,7 +157,7 @@ static void WINE_GLAPI wine_glEnable(GLenum cap) { ...@@ -157,7 +157,7 @@ static void WINE_GLAPI wine_glEnable(GLenum cap) {
static void (WINE_GLAPI *old_fogcoord_glDisable) (GLenum cap) = NULL; static void (WINE_GLAPI *old_fogcoord_glDisable) (GLenum cap) = NULL;
static void WINE_GLAPI wine_glDisable(GLenum cap) { static void WINE_GLAPI wine_glDisable(GLenum cap) {
if(cap == GL_FOG) { if(cap == GL_FOG) {
struct WineD3DContext *ctx = context_get_current(); struct wined3d_context *ctx = context_get_current();
ctx->fog_enabled = 0; ctx->fog_enabled = 0;
if(ctx->gl_fog_source != GL_FRAGMENT_DEPTH_EXT) return; if(ctx->gl_fog_source != GL_FRAGMENT_DEPTH_EXT) return;
} }
...@@ -166,7 +166,7 @@ static void WINE_GLAPI wine_glDisable(GLenum cap) { ...@@ -166,7 +166,7 @@ static void WINE_GLAPI wine_glDisable(GLenum cap) {
static void (WINE_GLAPI *old_fogcoord_glFogi) (GLenum pname, GLint param) = NULL; static void (WINE_GLAPI *old_fogcoord_glFogi) (GLenum pname, GLint param) = NULL;
static void WINE_GLAPI wine_glFogi(GLenum pname, GLint param) { static void WINE_GLAPI wine_glFogi(GLenum pname, GLint param) {
struct WineD3DContext *ctx = context_get_current(); struct wined3d_context *ctx = context_get_current();
if(pname == GL_FOG_COORDINATE_SOURCE_EXT) { if(pname == GL_FOG_COORDINATE_SOURCE_EXT) {
ctx->gl_fog_source = param; ctx->gl_fog_source = param;
...@@ -188,7 +188,7 @@ static void WINE_GLAPI wine_glFogi(GLenum pname, GLint param) { ...@@ -188,7 +188,7 @@ static void WINE_GLAPI wine_glFogi(GLenum pname, GLint param) {
static void (WINE_GLAPI *old_fogcoord_glFogiv) (GLenum pname, const GLint *param) = NULL; static void (WINE_GLAPI *old_fogcoord_glFogiv) (GLenum pname, const GLint *param) = NULL;
static void WINE_GLAPI wine_glFogiv(GLenum pname, const GLint *param) { static void WINE_GLAPI wine_glFogiv(GLenum pname, const GLint *param) {
struct WineD3DContext *ctx = context_get_current(); struct wined3d_context *ctx = context_get_current();
if(pname == GL_FOG_COORDINATE_SOURCE_EXT) { if(pname == GL_FOG_COORDINATE_SOURCE_EXT) {
ctx->gl_fog_source = *param; ctx->gl_fog_source = *param;
if(*param == GL_FRAGMENT_DEPTH_EXT) { if(*param == GL_FRAGMENT_DEPTH_EXT) {
...@@ -209,7 +209,7 @@ static void WINE_GLAPI wine_glFogiv(GLenum pname, const GLint *param) { ...@@ -209,7 +209,7 @@ static void WINE_GLAPI wine_glFogiv(GLenum pname, const GLint *param) {
static void (WINE_GLAPI *old_fogcoord_glFogf) (GLenum pname, GLfloat param) = NULL; static void (WINE_GLAPI *old_fogcoord_glFogf) (GLenum pname, GLfloat param) = NULL;
static void WINE_GLAPI wine_glFogf(GLenum pname, GLfloat param) { static void WINE_GLAPI wine_glFogf(GLenum pname, GLfloat param) {
struct WineD3DContext *ctx = context_get_current(); struct wined3d_context *ctx = context_get_current();
if(pname == GL_FOG_COORDINATE_SOURCE_EXT) { if(pname == GL_FOG_COORDINATE_SOURCE_EXT) {
ctx->gl_fog_source = (GLint) param; ctx->gl_fog_source = (GLint) param;
if(param == GL_FRAGMENT_DEPTH_EXT) { if(param == GL_FRAGMENT_DEPTH_EXT) {
...@@ -230,7 +230,7 @@ static void WINE_GLAPI wine_glFogf(GLenum pname, GLfloat param) { ...@@ -230,7 +230,7 @@ static void WINE_GLAPI wine_glFogf(GLenum pname, GLfloat param) {
static void (WINE_GLAPI *old_fogcoord_glFogfv) (GLenum pname, const GLfloat *param) = NULL; static void (WINE_GLAPI *old_fogcoord_glFogfv) (GLenum pname, const GLfloat *param) = NULL;
static void WINE_GLAPI wine_glFogfv(GLenum pname, const GLfloat *param) { static void WINE_GLAPI wine_glFogfv(GLenum pname, const GLfloat *param) {
struct WineD3DContext *ctx = context_get_current(); struct wined3d_context *ctx = context_get_current();
if(pname == GL_FOG_COORDINATE_SOURCE_EXT) { if(pname == GL_FOG_COORDINATE_SOURCE_EXT) {
ctx->gl_fog_source = (GLint) *param; ctx->gl_fog_source = (GLint) *param;
if(*param == GL_FRAGMENT_DEPTH_EXT) { if(*param == GL_FRAGMENT_DEPTH_EXT) {
...@@ -269,7 +269,7 @@ static void (WINE_GLAPI *old_fogcoord_glFogCoordfvEXT) (const GLfloat *f) = NULL ...@@ -269,7 +269,7 @@ static void (WINE_GLAPI *old_fogcoord_glFogCoordfvEXT) (const GLfloat *f) = NULL
static void (WINE_GLAPI *old_fogcoord_glFogCoorddvEXT) (const GLdouble *f) = NULL; static void (WINE_GLAPI *old_fogcoord_glFogCoorddvEXT) (const GLdouble *f) = NULL;
static void WINE_GLAPI wine_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { static void WINE_GLAPI wine_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
struct WineD3DContext *ctx = context_get_current(); struct wined3d_context *ctx = context_get_current();
if(ctx->gl_fog_source == GL_FOG_COORDINATE_EXT && ctx->fog_enabled) { if(ctx->gl_fog_source == GL_FOG_COORDINATE_EXT && ctx->fog_enabled) {
GLfloat c[4] = {ctx->color[0], ctx->color[1], ctx->color[2], ctx->color[3]}; GLfloat c[4] = {ctx->color[0], ctx->color[1], ctx->color[2], ctx->color[3]};
GLfloat i; GLfloat i;
...@@ -299,7 +299,7 @@ static void WINE_GLAPI wine_glVertex3fv(const GLfloat *pos) { ...@@ -299,7 +299,7 @@ static void WINE_GLAPI wine_glVertex3fv(const GLfloat *pos) {
} }
static void WINE_GLAPI wine_glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a) { static void WINE_GLAPI wine_glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a) {
struct WineD3DContext *ctx = context_get_current(); struct wined3d_context *ctx = context_get_current();
ctx->color[0] = r; ctx->color[0] = r;
ctx->color[1] = g; ctx->color[1] = g;
ctx->color[2] = b; ctx->color[2] = b;
...@@ -327,7 +327,7 @@ static void WINE_GLAPI wine_glColor4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte ...@@ -327,7 +327,7 @@ static void WINE_GLAPI wine_glColor4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte
* precision function * precision function
*/ */
static void WINE_GLAPI wine_glFogCoordfEXT(GLfloat f) { static void WINE_GLAPI wine_glFogCoordfEXT(GLfloat f) {
struct WineD3DContext *ctx = context_get_current(); struct wined3d_context *ctx = context_get_current();
ctx->fog_coord_value = f; ctx->fog_coord_value = f;
} }
static void WINE_GLAPI wine_glFogCoorddEXT(GLdouble f) { static void WINE_GLAPI wine_glFogCoorddEXT(GLdouble f) {
......
...@@ -32,7 +32,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); ...@@ -32,7 +32,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
/* GL locking for state handlers is done by the caller. */ /* GL locking for state handlers is done by the caller. */
static void nvts_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void nvts_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
BOOL bumpmap = FALSE; BOOL bumpmap = FALSE;
if(stage > 0 && (stateblock->textureState[stage - 1][WINED3DTSS_COLOROP] == WINED3DTOP_BUMPENVMAPLUMINANCE || if(stage > 0 && (stateblock->textureState[stage - 1][WINED3DTSS_COLOROP] == WINED3DTOP_BUMPENVMAPLUMINANCE ||
...@@ -452,7 +453,8 @@ void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, WINED3DTEX ...@@ -452,7 +453,8 @@ void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, WINED3DTEX
} }
static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1); DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[stage]; DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[stage];
BOOL tex_used = stateblock->wineD3DDevice->fixed_function_usage_map & (1 << stage); BOOL tex_used = stateblock->wineD3DDevice->fixed_function_usage_map & (1 << stage);
...@@ -544,7 +546,8 @@ static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3 ...@@ -544,7 +546,8 @@ static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3
} }
} }
static void nvts_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void nvts_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
DWORD sampler = state - STATE_SAMPLER(0); DWORD sampler = state - STATE_SAMPLER(0);
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[sampler]; DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[sampler];
...@@ -559,7 +562,8 @@ static void nvts_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D ...@@ -559,7 +562,8 @@ static void nvts_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
nvts_activate_dimensions(sampler, stateblock, context); nvts_activate_dimensions(sampler, stateblock, context);
} }
static void nvts_bumpenvmat(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void nvts_bumpenvmat(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1); DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[stage + 1]; DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[stage + 1];
float mat[2][2]; float mat[2][2];
...@@ -586,7 +590,8 @@ static void nvts_bumpenvmat(DWORD state, IWineD3DStateBlockImpl *stateblock, Win ...@@ -586,7 +590,8 @@ static void nvts_bumpenvmat(DWORD state, IWineD3DStateBlockImpl *stateblock, Win
} }
} }
static void nvrc_texfactor(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { static void nvrc_texfactor(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
float col[4]; float col[4];
D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_TEXTUREFACTOR], col); D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_TEXTUREFACTOR], col);
GL_EXTCALL(glCombinerParameterfvNV(GL_CONSTANT_COLOR0_NV, &col[0])); GL_EXTCALL(glCombinerParameterfvNV(GL_CONSTANT_COLOR0_NV, &col[0]));
......
...@@ -457,7 +457,7 @@ static HRESULT WINAPI IWineD3DEventQueryImpl_Issue(IWineD3DQuery* iface, DWORD ...@@ -457,7 +457,7 @@ static HRESULT WINAPI IWineD3DEventQueryImpl_Issue(IWineD3DQuery* iface, DWORD
if (dwIssueFlags & WINED3DISSUE_END) if (dwIssueFlags & WINED3DISSUE_END)
{ {
struct wined3d_event_query *query = This->extendedData; struct wined3d_event_query *query = This->extendedData;
struct WineD3DContext *context; struct wined3d_context *context;
if (query->context) if (query->context)
{ {
...@@ -514,7 +514,7 @@ static HRESULT WINAPI IWineD3DOcclusionQueryImpl_Issue(IWineD3DQuery* iface, D ...@@ -514,7 +514,7 @@ static HRESULT WINAPI IWineD3DOcclusionQueryImpl_Issue(IWineD3DQuery* iface, D
if (GL_SUPPORT(ARB_OCCLUSION_QUERY)) if (GL_SUPPORT(ARB_OCCLUSION_QUERY))
{ {
struct wined3d_occlusion_query *query = This->extendedData; struct wined3d_occlusion_query *query = This->extendedData;
struct WineD3DContext *context; struct wined3d_context *context;
/* This is allowed according to msdn and our tests. Reset the query and restart */ /* This is allowed according to msdn and our tests. Reset the query and restart */
if (dwIssueFlags & WINED3DISSUE_BEGIN) if (dwIssueFlags & WINED3DISSUE_BEGIN)
......
...@@ -3140,7 +3140,7 @@ static inline void fb_copy_to_texture_hwstretch(IWineD3DSurfaceImpl *This, IWine ...@@ -3140,7 +3140,7 @@ static inline void fb_copy_to_texture_hwstretch(IWineD3DSurfaceImpl *This, IWine
float left, right, top, bottom; /* Texture coordinates */ float left, right, top, bottom; /* Texture coordinates */
UINT fbwidth = Src->currentDesc.Width; UINT fbwidth = Src->currentDesc.Width;
UINT fbheight = Src->currentDesc.Height; UINT fbheight = Src->currentDesc.Height;
struct WineD3DContext *context; struct wined3d_context *context;
GLenum drawBuffer = GL_BACK; GLenum drawBuffer = GL_BACK;
GLenum texture_target; GLenum texture_target;
BOOL noBackBufferBackup; BOOL noBackBufferBackup;
...@@ -4374,7 +4374,7 @@ void surface_modify_ds_location(IWineD3DSurface *iface, DWORD location) { ...@@ -4374,7 +4374,7 @@ void surface_modify_ds_location(IWineD3DSurface *iface, DWORD location) {
} }
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
void surface_load_ds_location(IWineD3DSurface *iface, struct WineD3DContext *context, DWORD location) void surface_load_ds_location(IWineD3DSurface *iface, struct wined3d_context *context, DWORD location)
{ {
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
......
...@@ -372,10 +372,11 @@ const IWineD3DSwapChainVtbl IWineD3DSwapChain_Vtbl = ...@@ -372,10 +372,11 @@ const IWineD3DSwapChainVtbl IWineD3DSwapChain_Vtbl =
IWineD3DBaseSwapChainImpl_GetGammaRamp IWineD3DBaseSwapChainImpl_GetGammaRamp
}; };
WineD3DContext *IWineD3DSwapChainImpl_CreateContextForThread(IWineD3DSwapChain *iface) { struct wined3d_context *IWineD3DSwapChainImpl_CreateContextForThread(IWineD3DSwapChain *iface)
WineD3DContext *ctx; {
IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *) iface; IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *) iface;
WineD3DContext **newArray; struct wined3d_context **newArray;
struct wined3d_context *ctx;
TRACE("Creating a new context for swapchain %p, thread %d\n", This, GetCurrentThreadId()); TRACE("Creating a new context for swapchain %p, thread %d\n", This, GetCurrentThreadId());
...@@ -402,7 +403,7 @@ WineD3DContext *IWineD3DSwapChainImpl_CreateContextForThread(IWineD3DSwapChain * ...@@ -402,7 +403,7 @@ WineD3DContext *IWineD3DSwapChainImpl_CreateContextForThread(IWineD3DSwapChain *
return ctx; return ctx;
} }
void get_drawable_size_swapchain(struct WineD3DContext *context, UINT *width, UINT *height) void get_drawable_size_swapchain(struct wined3d_context *context, UINT *width, UINT *height)
{ {
IWineD3DSurfaceImpl *surface = (IWineD3DSurfaceImpl *)context->current_rt; IWineD3DSurfaceImpl *surface = (IWineD3DSurfaceImpl *)context->current_rt;
/* The drawable size of an onscreen drawable is the surface size. /* The drawable size of an onscreen drawable is the surface size.
......
...@@ -2394,7 +2394,8 @@ void add_ffp_frag_shader(struct wine_rb_tree *shaders, struct ffp_frag_desc *des ...@@ -2394,7 +2394,8 @@ void add_ffp_frag_shader(struct wine_rb_tree *shaders, struct ffp_frag_desc *des
*/ */
#define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info #define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info
/* GL locking is done by the caller (state handler) */ /* GL locking is done by the caller (state handler) */
void texture_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { void texture_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
if(stateblock->textures[stage]) { if(stateblock->textures[stage]) {
switch (IWineD3DBaseTexture_GetTextureDimensions(stateblock->textures[stage])) { switch (IWineD3DBaseTexture_GetTextureDimensions(stateblock->textures[stage])) {
case GL_TEXTURE_2D: case GL_TEXTURE_2D:
...@@ -2468,7 +2469,8 @@ void texture_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock ...@@ -2468,7 +2469,8 @@ void texture_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock
} }
/* GL locking is done by the caller (state handler) */ /* GL locking is done by the caller (state handler) */
void sampler_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { void sampler_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
DWORD sampler = state - STATE_SAMPLER(0); DWORD sampler = state - STATE_SAMPLER(0);
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[sampler]; DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[sampler];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment