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

wined3d: Rename "wineD3DDevice" to "device".

parent bd9828a0
...@@ -537,7 +537,7 @@ static inline void shader_arb_vs_local_constants(IWineD3DDeviceImpl* deviceImpl) ...@@ -537,7 +537,7 @@ static inline void shader_arb_vs_local_constants(IWineD3DDeviceImpl* deviceImpl)
/* GL locking is done by the caller (state handler) */ /* GL locking is done by the caller (state handler) */
static void shader_arb_load_constants(const struct wined3d_context *context, char usePixelShader, char useVertexShader) static void shader_arb_load_constants(const struct wined3d_context *context, char usePixelShader, char useVertexShader)
{ {
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice; IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.device;
IWineD3DStateBlockImpl* stateBlock = device->stateBlock; IWineD3DStateBlockImpl* stateBlock = device->stateBlock;
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
...@@ -567,7 +567,7 @@ static void shader_arb_update_float_vertex_constants(IWineD3DDevice *iface, UINT ...@@ -567,7 +567,7 @@ static void shader_arb_update_float_vertex_constants(IWineD3DDevice *iface, UINT
/* 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 */
if (!context || ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice != This) return; if (!context || ((IWineD3DSurfaceImpl *)context->surface)->resource.device != This) return;
memset(context->vshader_const_dirty + start, 1, sizeof(*context->vshader_const_dirty) * count); memset(context->vshader_const_dirty + start, 1, sizeof(*context->vshader_const_dirty) * count);
This->highest_dirty_vs_const = max(This->highest_dirty_vs_const, start + count); This->highest_dirty_vs_const = max(This->highest_dirty_vs_const, start + count);
...@@ -580,7 +580,7 @@ static void shader_arb_update_float_pixel_constants(IWineD3DDevice *iface, UINT ...@@ -580,7 +580,7 @@ static void shader_arb_update_float_pixel_constants(IWineD3DDevice *iface, UINT
/* 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 */
if (!context || ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice != This) return; if (!context || ((IWineD3DSurfaceImpl *)context->surface)->resource.device != This) return;
memset(context->pshader_const_dirty + start, 1, sizeof(*context->pshader_const_dirty) * count); memset(context->pshader_const_dirty + start, 1, sizeof(*context->pshader_const_dirty) * count);
This->highest_dirty_ps_const = max(This->highest_dirty_ps_const, start + count); This->highest_dirty_ps_const = max(This->highest_dirty_ps_const, start + count);
...@@ -4292,7 +4292,7 @@ static inline void find_arb_vs_compile_args(IWineD3DVertexShaderImpl *shader, IW ...@@ -4292,7 +4292,7 @@ static inline void find_arb_vs_compile_args(IWineD3DVertexShaderImpl *shader, IW
/* GL locking is done by the caller */ /* GL locking is done by the caller */
static void shader_arb_select(const struct wined3d_context *context, BOOL usePS, BOOL useVS) static void shader_arb_select(const struct wined3d_context *context, BOOL usePS, BOOL useVS)
{ {
IWineD3DDeviceImpl *This = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice; IWineD3DDeviceImpl *This = ((IWineD3DSurfaceImpl *)context->surface)->resource.device;
struct shader_arb_priv *priv = This->shader_priv; struct shader_arb_priv *priv = This->shader_priv;
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
int i; int i;
...@@ -5263,11 +5263,11 @@ static void arbfp_get_caps(WINED3DDEVTYPE devtype, const struct wined3d_gl_info ...@@ -5263,11 +5263,11 @@ 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->device->adapter->gl_info
static void state_texfactor_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context) static void state_texfactor_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{ {
IWineD3DDeviceImpl *device = stateblock->device;
float col[4]; float col[4];
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
/* Don't load the parameter if we're using an arbfp pixel shader, otherwise we'll overwrite /* Don't load the parameter if we're using an arbfp pixel shader, otherwise we'll overwrite
* application provided constants * application provided constants
...@@ -5287,8 +5287,8 @@ static void state_texfactor_arbfp(DWORD state, IWineD3DStateBlockImpl *statebloc ...@@ -5287,8 +5287,8 @@ static void state_texfactor_arbfp(DWORD state, IWineD3DStateBlockImpl *statebloc
static void state_arb_specularenable(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context) static void state_arb_specularenable(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{ {
IWineD3DDeviceImpl *device = stateblock->device;
float col[4]; float col[4];
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
/* Don't load the parameter if we're using an arbfp pixel shader, otherwise we'll overwrite /* Don't load the parameter if we're using an arbfp pixel shader, otherwise we'll overwrite
* application provided constants * application provided constants
...@@ -5315,7 +5315,7 @@ static void state_arb_specularenable(DWORD state, IWineD3DStateBlockImpl *stateb ...@@ -5315,7 +5315,7 @@ static void state_arb_specularenable(DWORD state, IWineD3DStateBlockImpl *stateb
static void set_bumpmat_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *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->device;
float mat[2][2]; float mat[2][2];
if (use_ps(stateblock)) if (use_ps(stateblock))
...@@ -5352,7 +5352,7 @@ static void set_bumpmat_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, s ...@@ -5352,7 +5352,7 @@ static void set_bumpmat_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, s
static void tex_bumpenvlum_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *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->device;
float param[4]; float param[4];
if (use_ps(stateblock)) if (use_ps(stateblock))
...@@ -5873,7 +5873,7 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, IWi ...@@ -5873,7 +5873,7 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, IWi
static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context) static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{ {
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; IWineD3DDeviceImpl *device = stateblock->device;
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);
BOOL use_vshader = use_vs(stateblock); BOOL use_vshader = use_vs(stateblock);
......
...@@ -798,10 +798,10 @@ static GLuint gen_ati_shader(const struct texture_stage_op op[MAX_TEXTURES], con ...@@ -798,10 +798,10 @@ 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->device->adapter->gl_info
static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context) static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{ {
IWineD3DDeviceImpl *This = stateblock->wineD3DDevice; IWineD3DDeviceImpl *This = stateblock->device;
const struct atifs_ffp_desc *desc; const struct atifs_ffp_desc *desc;
struct ffp_frag_settings settings; struct ffp_frag_settings settings;
struct atifs_private_data *priv = This->fragment_priv; struct atifs_private_data *priv = This->fragment_priv;
...@@ -889,7 +889,7 @@ static void textransform(DWORD state, IWineD3DStateBlockImpl *stateblock, struct ...@@ -889,7 +889,7 @@ static void textransform(DWORD state, IWineD3DStateBlockImpl *stateblock, struct
static void atifs_apply_pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context) static void atifs_apply_pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{ {
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; IWineD3DDeviceImpl *device = stateblock->device;
BOOL use_vshader = use_vs(stateblock); BOOL use_vshader = use_vs(stateblock);
context->last_was_pshader = use_ps(stateblock); context->last_was_pshader = use_ps(stateblock);
......
...@@ -81,7 +81,7 @@ static void gltexture_delete(struct gl_texture *tex) ...@@ -81,7 +81,7 @@ static void gltexture_delete(struct gl_texture *tex)
void basetexture_unload(IWineD3DBaseTexture *iface) void basetexture_unload(IWineD3DBaseTexture *iface)
{ {
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface; IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; IWineD3DDeviceImpl *device = This->resource.device;
struct wined3d_context *context = NULL; struct wined3d_context *context = NULL;
if (This->baseTexture.texture_rgb.name || This->baseTexture.texture_srgb.name) if (This->baseTexture.texture_rgb.name || This->baseTexture.texture_srgb.name)
...@@ -124,7 +124,7 @@ DWORD basetexture_set_lod(IWineD3DBaseTexture *iface, DWORD LODNew) ...@@ -124,7 +124,7 @@ DWORD basetexture_set_lod(IWineD3DBaseTexture *iface, DWORD LODNew)
This->baseTexture.texture_rgb.states[WINED3DTEXSTA_MAXMIPLEVEL] = ~0U; This->baseTexture.texture_rgb.states[WINED3DTEXSTA_MAXMIPLEVEL] = ~0U;
This->baseTexture.texture_srgb.states[WINED3DTEXSTA_MAXMIPLEVEL] = ~0U; This->baseTexture.texture_srgb.states[WINED3DTEXSTA_MAXMIPLEVEL] = ~0U;
if(This->baseTexture.bindCount) { if(This->baseTexture.bindCount) {
IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_SAMPLER(This->baseTexture.sampler)); IWineD3DDeviceImpl_MarkStateDirty(This->resource.device, STATE_SAMPLER(This->baseTexture.sampler));
} }
} }
...@@ -152,7 +152,7 @@ DWORD basetexture_get_level_count(IWineD3DBaseTexture *iface) ...@@ -152,7 +152,7 @@ DWORD basetexture_get_level_count(IWineD3DBaseTexture *iface)
HRESULT basetexture_set_autogen_filter_type(IWineD3DBaseTexture *iface, WINED3DTEXTUREFILTERTYPE FilterType) HRESULT basetexture_set_autogen_filter_type(IWineD3DBaseTexture *iface, WINED3DTEXTUREFILTERTYPE FilterType)
{ {
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; IWineD3DDeviceImpl *device = This->resource.device;
UINT textureDimensions = IWineD3DBaseTexture_GetTextureDimensions(iface); UINT textureDimensions = IWineD3DBaseTexture_GetTextureDimensions(iface);
if (!(This->resource.usage & WINED3DUSAGE_AUTOGENMIPMAP)) { if (!(This->resource.usage & WINED3DUSAGE_AUTOGENMIPMAP)) {
...@@ -477,7 +477,7 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface, ...@@ -477,7 +477,7 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
if (gl_tex->states[WINED3DTEXSTA_MAXANISOTROPY] != aniso) if (gl_tex->states[WINED3DTEXSTA_MAXANISOTROPY] != aniso)
{ {
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; IWineD3DDeviceImpl *device = This->resource.device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
if (gl_info->supported[EXT_TEXTURE_FILTER_ANISOTROPIC]) if (gl_info->supported[EXT_TEXTURE_FILTER_ANISOTROPIC])
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(d3d); WINE_DEFAULT_DEBUG_CHANNEL(d3d);
#define GLINFO_LOCATION This->resource.wineD3DDevice->adapter->gl_info #define GLINFO_LOCATION This->resource.device->adapter->gl_info
#define VB_MAXDECLCHANGES 100 /* After that number we stop converting */ #define VB_MAXDECLCHANGES 100 /* After that number we stop converting */
#define VB_RESETDECLCHANGE 1000 /* Reset the changecount after that number of draws */ #define VB_RESETDECLCHANGE 1000 /* Reset the changecount after that number of draws */
...@@ -68,7 +68,7 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This) ...@@ -68,7 +68,7 @@ static void buffer_create_buffer_object(struct wined3d_buffer *This)
if(This->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB) if(This->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB)
{ {
IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_INDEXBUFFER); IWineD3DDeviceImpl_MarkStateDirty(This->resource.device, STATE_INDEXBUFFER);
} }
GL_EXTCALL(glBindBufferARB(This->buffer_type_hint, This->buffer_object)); GL_EXTCALL(glBindBufferARB(This->buffer_type_hint, This->buffer_object));
error = glGetError(); error = glGetError();
...@@ -148,7 +148,7 @@ static BOOL buffer_process_converted_attribute(struct wined3d_buffer *This, ...@@ -148,7 +148,7 @@ static BOOL buffer_process_converted_attribute(struct wined3d_buffer *This,
DWORD attrib_size; DWORD attrib_size;
BOOL ret = FALSE; BOOL ret = FALSE;
unsigned int i; unsigned int i;
DWORD offset = This->resource.wineD3DDevice->stateBlock->streamOffset[attrib->stream_idx]; DWORD offset = This->resource.device->stateBlock->streamOffset[attrib->stream_idx];
DWORD_PTR data; DWORD_PTR data;
/* Check for some valid situations which cause us pain. One is if the buffer is used for /* Check for some valid situations which cause us pain. One is if the buffer is used for
...@@ -203,7 +203,7 @@ static BOOL buffer_check_attribute(struct wined3d_buffer *This, const struct win ...@@ -203,7 +203,7 @@ static BOOL buffer_check_attribute(struct wined3d_buffer *This, const struct win
DWORD *stride_this_run, BOOL *float16_used) DWORD *stride_this_run, BOOL *float16_used)
{ {
const struct wined3d_stream_info_element *attrib = &si->elements[attrib_idx]; const struct wined3d_stream_info_element *attrib = &si->elements[attrib_idx];
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; IWineD3DDeviceImpl *device = This->resource.device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
BOOL ret = FALSE; BOOL ret = FALSE;
WINED3DFORMAT format; WINED3DFORMAT format;
...@@ -311,7 +311,7 @@ static UINT *find_conversion_shift(struct wined3d_buffer *This, ...@@ -311,7 +311,7 @@ static UINT *find_conversion_shift(struct wined3d_buffer *This,
static BOOL buffer_find_decl(struct wined3d_buffer *This) static BOOL buffer_find_decl(struct wined3d_buffer *This)
{ {
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; IWineD3DDeviceImpl *device = This->resource.device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct wined3d_stream_info *si = &device->strided_streams; const struct wined3d_stream_info *si = &device->strided_streams;
UINT stride_this_run = 0; UINT stride_this_run = 0;
...@@ -472,7 +472,7 @@ static void buffer_check_buffer_object_size(struct wined3d_buffer *This) ...@@ -472,7 +472,7 @@ static void buffer_check_buffer_object_size(struct wined3d_buffer *This)
if(This->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB) if(This->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB)
{ {
IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_INDEXBUFFER); IWineD3DDeviceImpl_MarkStateDirty(This->resource.device, STATE_INDEXBUFFER);
} }
/* Rescue the data before resizing the buffer object if we do not have our backup copy */ /* Rescue the data before resizing the buffer object if we do not have our backup copy */
...@@ -607,7 +607,7 @@ static void STDMETHODCALLTYPE buffer_UnLoad(IWineD3DBuffer *iface) ...@@ -607,7 +607,7 @@ static void STDMETHODCALLTYPE buffer_UnLoad(IWineD3DBuffer *iface)
if (This->buffer_object) if (This->buffer_object)
{ {
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; IWineD3DDeviceImpl *device = This->resource.device;
struct wined3d_context *context; struct wined3d_context *context;
context = context_acquire(device, NULL, CTXUSAGE_RESOURCELOAD); context = context_acquire(device, NULL, CTXUSAGE_RESOURCELOAD);
...@@ -687,7 +687,7 @@ static DWORD STDMETHODCALLTYPE buffer_GetPriority(IWineD3DBuffer *iface) ...@@ -687,7 +687,7 @@ static DWORD STDMETHODCALLTYPE buffer_GetPriority(IWineD3DBuffer *iface)
static void STDMETHODCALLTYPE buffer_PreLoad(IWineD3DBuffer *iface) static void STDMETHODCALLTYPE buffer_PreLoad(IWineD3DBuffer *iface)
{ {
struct wined3d_buffer *This = (struct wined3d_buffer *)iface; struct wined3d_buffer *This = (struct wined3d_buffer *)iface;
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; IWineD3DDeviceImpl *device = This->resource.device;
UINT start = 0, end = 0, vertices; UINT start = 0, end = 0, vertices;
struct wined3d_context *context; struct wined3d_context *context;
BOOL decl_changed = FALSE; BOOL decl_changed = FALSE;
...@@ -795,7 +795,7 @@ static void STDMETHODCALLTYPE buffer_PreLoad(IWineD3DBuffer *iface) ...@@ -795,7 +795,7 @@ static void STDMETHODCALLTYPE buffer_PreLoad(IWineD3DBuffer *iface)
if(This->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB) if(This->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB)
{ {
IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_INDEXBUFFER); IWineD3DDeviceImpl_MarkStateDirty(This->resource.device, STATE_INDEXBUFFER);
} }
if (!This->conversion_map) if (!This->conversion_map)
...@@ -957,12 +957,12 @@ static HRESULT STDMETHODCALLTYPE buffer_Map(IWineD3DBuffer *iface, UINT offset, ...@@ -957,12 +957,12 @@ static HRESULT STDMETHODCALLTYPE buffer_Map(IWineD3DBuffer *iface, UINT offset,
{ {
if(count == 1) if(count == 1)
{ {
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; IWineD3DDeviceImpl *device = This->resource.device;
struct wined3d_context *context; struct wined3d_context *context;
if(This->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB) if(This->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB)
{ {
IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_INDEXBUFFER); IWineD3DDeviceImpl_MarkStateDirty(This->resource.device, STATE_INDEXBUFFER);
} }
context = context_acquire(device, NULL, CTXUSAGE_RESOURCELOAD); context = context_acquire(device, NULL, CTXUSAGE_RESOURCELOAD);
...@@ -1011,12 +1011,12 @@ static HRESULT STDMETHODCALLTYPE buffer_Unmap(IWineD3DBuffer *iface) ...@@ -1011,12 +1011,12 @@ static HRESULT STDMETHODCALLTYPE buffer_Unmap(IWineD3DBuffer *iface)
if(!(This->flags & WINED3D_BUFFER_DOUBLEBUFFER) && This->buffer_object) if(!(This->flags & WINED3D_BUFFER_DOUBLEBUFFER) && This->buffer_object)
{ {
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; IWineD3DDeviceImpl *device = This->resource.device;
struct wined3d_context *context; struct wined3d_context *context;
if(This->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB) if(This->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB)
{ {
IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_INDEXBUFFER); IWineD3DDeviceImpl_MarkStateDirty(This->resource.device, STATE_INDEXBUFFER);
} }
context = context_acquire(device, NULL, CTXUSAGE_RESOURCELOAD); context = context_acquire(device, NULL, CTXUSAGE_RESOURCELOAD);
......
...@@ -117,7 +117,7 @@ static void context_destroy_fbo(struct wined3d_context *context, GLuint *fbo) ...@@ -117,7 +117,7 @@ static void context_destroy_fbo(struct wined3d_context *context, GLuint *fbo)
static void context_apply_attachment_filter_states(IWineD3DSurface *surface, BOOL force_preload) static void context_apply_attachment_filter_states(IWineD3DSurface *surface, BOOL force_preload)
{ {
const IWineD3DSurfaceImpl *surface_impl = (IWineD3DSurfaceImpl *)surface; const IWineD3DSurfaceImpl *surface_impl = (IWineD3DSurfaceImpl *)surface;
IWineD3DDeviceImpl *device = surface_impl->resource.wineD3DDevice; IWineD3DDeviceImpl *device = surface_impl->resource.device;
IWineD3DBaseTextureImpl *texture_impl; IWineD3DBaseTextureImpl *texture_impl;
BOOL update_minfilter = FALSE; BOOL update_minfilter = FALSE;
BOOL update_magfilter = FALSE; BOOL update_magfilter = FALSE;
...@@ -317,7 +317,7 @@ static void context_check_fbo_status(struct wined3d_context *context) ...@@ -317,7 +317,7 @@ static void context_check_fbo_status(struct wined3d_context *context)
static struct fbo_entry *context_create_fbo_entry(struct wined3d_context *context) static struct fbo_entry *context_create_fbo_entry(struct wined3d_context *context)
{ {
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice; IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.device;
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
struct fbo_entry *entry; struct fbo_entry *entry;
...@@ -334,7 +334,7 @@ static struct fbo_entry *context_create_fbo_entry(struct wined3d_context *contex ...@@ -334,7 +334,7 @@ static struct fbo_entry *context_create_fbo_entry(struct wined3d_context *contex
/* GL locking is done by the caller */ /* GL locking is done by the caller */
static void context_reuse_fbo_entry(struct wined3d_context *context, struct fbo_entry *entry) static void context_reuse_fbo_entry(struct wined3d_context *context, struct fbo_entry *entry)
{ {
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice; IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.device;
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
context_bind_fbo(context, GL_FRAMEBUFFER, &entry->id); context_bind_fbo(context, GL_FRAMEBUFFER, &entry->id);
...@@ -363,7 +363,7 @@ static void context_destroy_fbo_entry(struct wined3d_context *context, struct fb ...@@ -363,7 +363,7 @@ static void context_destroy_fbo_entry(struct wined3d_context *context, struct fb
/* GL locking is done by the caller */ /* GL locking is done by the caller */
static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context) static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context)
{ {
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice; IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.device;
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
struct fbo_entry *entry; struct fbo_entry *entry;
...@@ -399,7 +399,7 @@ static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context) ...@@ -399,7 +399,7 @@ static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context)
/* GL locking is done by the caller */ /* GL locking is done by the caller */
static void context_apply_fbo_entry(struct wined3d_context *context, struct fbo_entry *entry) static void context_apply_fbo_entry(struct wined3d_context *context, struct fbo_entry *entry)
{ {
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice; IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.device;
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
unsigned int i; unsigned int i;
...@@ -1869,7 +1869,7 @@ static inline struct wined3d_context *FindContext(IWineD3DDeviceImpl *This, IWin ...@@ -1869,7 +1869,7 @@ static inline struct wined3d_context *FindContext(IWineD3DDeviceImpl *This, IWin
{ {
if (current_context if (current_context
&& current_context->current_rt && current_context->current_rt
&& ((IWineD3DSurfaceImpl *)current_context->surface)->resource.wineD3DDevice == This) && ((IWineD3DSurfaceImpl *)current_context->surface)->resource.device == This)
{ {
target = current_context->current_rt; target = current_context->current_rt;
} }
...@@ -1952,7 +1952,7 @@ retry: ...@@ -1952,7 +1952,7 @@ retry:
{ {
/* Stay with the currently active context. */ /* Stay with the currently active context. */
if (current_context if (current_context
&& ((IWineD3DSurfaceImpl *)current_context->surface)->resource.wineD3DDevice == This) && ((IWineD3DSurfaceImpl *)current_context->surface)->resource.device == This)
{ {
context = current_context; context = current_context;
} }
...@@ -2057,7 +2057,7 @@ static void context_apply_draw_buffer(struct wined3d_context *context, BOOL blit ...@@ -2057,7 +2057,7 @@ static void context_apply_draw_buffer(struct wined3d_context *context, BOOL blit
IWineD3DSwapChain *swapchain; IWineD3DSwapChain *swapchain;
IWineD3DDeviceImpl *device; IWineD3DDeviceImpl *device;
device = ((IWineD3DSurfaceImpl *)rt)->resource.wineD3DDevice; device = ((IWineD3DSurfaceImpl *)rt)->resource.device;
if (SUCCEEDED(IWineD3DSurface_GetContainer(rt, &IID_IWineD3DSwapChain, (void **)&swapchain))) if (SUCCEEDED(IWineD3DSurface_GetContainer(rt, &IID_IWineD3DSwapChain, (void **)&swapchain)))
{ {
IWineD3DSwapChain_Release((IUnknown *)swapchain); IWineD3DSwapChain_Release((IUnknown *)swapchain);
......
...@@ -31,7 +31,7 @@ static void cubetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3 ...@@ -31,7 +31,7 @@ static void cubetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3
{ {
/* Override the IWineD3DResource Preload method. */ /* Override the IWineD3DResource Preload method. */
IWineD3DCubeTextureImpl *This = (IWineD3DCubeTextureImpl *)iface; IWineD3DCubeTextureImpl *This = (IWineD3DCubeTextureImpl *)iface;
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; IWineD3DDeviceImpl *device = This->resource.device;
struct wined3d_context *context = NULL; struct wined3d_context *context = NULL;
unsigned int i, j; unsigned int i, j;
BOOL srgb_mode; BOOL srgb_mode;
......
...@@ -881,7 +881,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINE ...@@ -881,7 +881,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINE
object->lpVtbl = vtable; object->lpVtbl = vtable;
object->type = Type; object->type = Type;
object->state = QUERY_CREATED; object->state = QUERY_CREATED;
object->wineD3DDevice = This; object->device = This;
object->parent = parent; object->parent = parent;
object->ref = 1; object->ref = 1;
...@@ -1080,7 +1080,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSwapChain(IWineD3DDevice *iface, ...@@ -1080,7 +1080,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSwapChain(IWineD3DDevice *iface,
HeapFree(GetProcessHeap(), 0, object); HeapFree(GetProcessHeap(), 0, object);
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
} }
object->wineD3DDevice = This; object->device = This;
object->parent = parent; object->parent = parent;
object->ref = 1; object->ref = 1;
...@@ -1631,7 +1631,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePalette(IWineD3DDevice *iface, DW ...@@ -1631,7 +1631,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePalette(IWineD3DDevice *iface, DW
object->ref = 1; object->ref = 1;
object->Flags = Flags; object->Flags = Flags;
object->parent = Parent; object->parent = Parent;
object->wineD3DDevice = This; object->device = This;
object->palNumEntries = IWineD3DPaletteImpl_Size(Flags); object->palNumEntries = IWineD3DPaletteImpl_Size(Flags);
object->hpal = CreatePalette((const LOGPALETTE*)&(object->palVersion)); object->hpal = CreatePalette((const LOGPALETTE*)&(object->palVersion));
...@@ -6530,7 +6530,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_EvictManagedResources(IWineD3DDevice* ...@@ -6530,7 +6530,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_EvictManagedResources(IWineD3DDevice*
static HRESULT updateSurfaceDesc(IWineD3DSurfaceImpl *surface, const WINED3DPRESENT_PARAMETERS* pPresentationParameters) static HRESULT updateSurfaceDesc(IWineD3DSurfaceImpl *surface, const WINED3DPRESENT_PARAMETERS* pPresentationParameters)
{ {
IWineD3DDeviceImpl *device = surface->resource.wineD3DDevice; IWineD3DDeviceImpl *device = surface->resource.device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
/* Reallocate proper memory for the front and back buffer and adjust their sizes */ /* Reallocate proper memory for the front and back buffer and adjust their sizes */
...@@ -7380,7 +7380,7 @@ void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state) { ...@@ -7380,7 +7380,7 @@ void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state) {
void get_drawable_size_pbuffer(struct wined3d_context *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.device;
/* 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. */
*width = device->pbufferWidth; *width = device->pbufferWidth;
*height = device->pbufferHeight; *height = device->pbufferHeight;
......
...@@ -630,7 +630,7 @@ static void shader_glsl_load_np2fixup_constants( ...@@ -630,7 +630,7 @@ static void shader_glsl_load_np2fixup_constants(
static void shader_glsl_load_constants(const struct wined3d_context *context, static void shader_glsl_load_constants(const struct wined3d_context *context,
char usePixelShader, char useVertexShader) char usePixelShader, char useVertexShader)
{ {
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice; IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.device;
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
IWineD3DStateBlockImpl* stateBlock = device->stateBlock; IWineD3DStateBlockImpl* stateBlock = device->stateBlock;
struct shader_glsl_priv *priv = device->shader_priv; struct shader_glsl_priv *priv = device->shader_priv;
...@@ -4315,7 +4315,7 @@ static GLhandleARB create_glsl_blt_shader(const struct wined3d_gl_info *gl_info, ...@@ -4315,7 +4315,7 @@ static GLhandleARB create_glsl_blt_shader(const struct wined3d_gl_info *gl_info,
/* GL locking is done by the caller */ /* GL locking is done by the caller */
static void shader_glsl_select(const struct wined3d_context *context, BOOL usePS, BOOL useVS) static void shader_glsl_select(const struct wined3d_context *context, BOOL usePS, BOOL useVS)
{ {
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice; IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.device;
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
struct shader_glsl_priv *priv = device->shader_priv; struct shader_glsl_priv *priv = device->shader_priv;
GLhandleARB program_id = 0; GLhandleARB program_id = 0;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(d3d); WINE_DEFAULT_DEBUG_CHANNEL(d3d);
#define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info #define GLINFO_LOCATION stateblock->device->adapter->gl_info
/* GL locking for state handlers is done by the caller. */ /* GL locking for state handlers is done by the caller. */
...@@ -458,8 +458,8 @@ void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, WINED3DTEX ...@@ -458,8 +458,8 @@ void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, WINED3DTEX
static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *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]; BOOL tex_used = stateblock->device->fixed_function_usage_map & (1 << stage);
BOOL tex_used = stateblock->wineD3DDevice->fixed_function_usage_map & (1 << stage); DWORD mapped_stage = stateblock->device->texUnitMap[stage];
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
TRACE("Setting color op for stage %d\n", stage); TRACE("Setting color op for stage %d\n", stage);
...@@ -533,7 +533,7 @@ static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct ...@@ -533,7 +533,7 @@ static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct
} }
/* Set the texture combiners */ /* Set the texture combiners */
set_tex_op_nvrc((IWineD3DDevice *)stateblock->wineD3DDevice, FALSE, stage, set_tex_op_nvrc((IWineD3DDevice *)stateblock->device, FALSE, stage,
stateblock->textureState[stage][WINED3DTSS_COLOROP], stateblock->textureState[stage][WINED3DTSS_COLOROP],
stateblock->textureState[stage][WINED3DTSS_COLORARG1], stateblock->textureState[stage][WINED3DTSS_COLORARG1],
stateblock->textureState[stage][WINED3DTSS_COLORARG2], stateblock->textureState[stage][WINED3DTSS_COLORARG2],
...@@ -562,7 +562,7 @@ static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct ...@@ -562,7 +562,7 @@ static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct
static void nvts_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *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->device->texUnitMap[sampler];
/* 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
...@@ -578,7 +578,7 @@ static void nvts_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, struct ...@@ -578,7 +578,7 @@ static void nvts_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, struct
static void nvts_bumpenvmat(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *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->device->texUnitMap[stage + 1];
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
......
...@@ -151,7 +151,8 @@ static HRESULT WINAPI IWineD3DPaletteImpl_SetEntries(IWineD3DPalette *iface, ...@@ -151,7 +151,8 @@ static HRESULT WINAPI IWineD3DPaletteImpl_SetEntries(IWineD3DPalette *iface,
/* If the palette is attached to the render target, update all render targets */ /* If the palette is attached to the render target, update all render targets */
LIST_FOR_EACH_ENTRY(res, &This->wineD3DDevice->resources, IWineD3DResourceImpl, resource.resource_list_entry) { LIST_FOR_EACH_ENTRY(res, &This->device->resources, IWineD3DResourceImpl, resource.resource_list_entry)
{
if(IWineD3DResource_GetType((IWineD3DResource *) res) == WINED3DRTYPE_SURFACE) { if(IWineD3DResource_GetType((IWineD3DResource *) res) == WINED3DRTYPE_SURFACE) {
IWineD3DSurfaceImpl *impl = (IWineD3DSurfaceImpl *) res; IWineD3DSurfaceImpl *impl = (IWineD3DSurfaceImpl *) res;
if(impl->palette == This) if(impl->palette == This)
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
*/ */
WINE_DEFAULT_DEBUG_CHANNEL(d3d); WINE_DEFAULT_DEBUG_CHANNEL(d3d);
#define GLINFO_LOCATION This->wineD3DDevice->adapter->gl_info #define GLINFO_LOCATION This->device->adapter->gl_info
/* ******************************************* /* *******************************************
IWineD3DQuery IUnknown parts follow IWineD3DQuery IUnknown parts follow
...@@ -263,7 +263,7 @@ static HRESULT WINAPI IWineD3DQueryImpl_GetData(IWineD3DQuery* iface, void* pDa ...@@ -263,7 +263,7 @@ static HRESULT WINAPI IWineD3DQueryImpl_GetData(IWineD3DQuery* iface, void* pDa
static HRESULT WINAPI IWineD3DOcclusionQueryImpl_GetData(IWineD3DQuery* iface, void* pData, DWORD dwSize, DWORD dwGetDataFlags) { static HRESULT WINAPI IWineD3DOcclusionQueryImpl_GetData(IWineD3DQuery* iface, void* pData, DWORD dwSize, DWORD dwGetDataFlags) {
IWineD3DQueryImpl *This = (IWineD3DQueryImpl *) iface; IWineD3DQueryImpl *This = (IWineD3DQueryImpl *) iface;
struct wined3d_occlusion_query *query = This->extendedData; struct wined3d_occlusion_query *query = This->extendedData;
IWineD3DDeviceImpl *device = This->wineD3DDevice; IWineD3DDeviceImpl *device = This->device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
struct wined3d_context *context; struct wined3d_context *context;
DWORD* data = pData; DWORD* data = pData;
...@@ -304,7 +304,7 @@ static HRESULT WINAPI IWineD3DOcclusionQueryImpl_GetData(IWineD3DQuery* iface, ...@@ -304,7 +304,7 @@ static HRESULT WINAPI IWineD3DOcclusionQueryImpl_GetData(IWineD3DQuery* iface,
return S_OK; return S_OK;
} }
context = context_acquire(This->wineD3DDevice, query->context->current_rt, CTXUSAGE_RESOURCELOAD); context = context_acquire(This->device, query->context->current_rt, CTXUSAGE_RESOURCELOAD);
ENTER_GL(); ENTER_GL();
...@@ -362,7 +362,7 @@ static HRESULT WINAPI IWineD3DEventQueryImpl_GetData(IWineD3DQuery* iface, void ...@@ -362,7 +362,7 @@ static HRESULT WINAPI IWineD3DEventQueryImpl_GetData(IWineD3DQuery* iface, void
return S_OK; return S_OK;
} }
context = context_acquire(This->wineD3DDevice, query->context->current_rt, CTXUSAGE_RESOURCELOAD); context = context_acquire(This->device, query->context->current_rt, CTXUSAGE_RESOURCELOAD);
ENTER_GL(); ENTER_GL();
...@@ -472,17 +472,17 @@ static HRESULT WINAPI IWineD3DEventQueryImpl_Issue(IWineD3DQuery* iface, DWORD ...@@ -472,17 +472,17 @@ static HRESULT WINAPI IWineD3DEventQueryImpl_Issue(IWineD3DQuery* iface, DWORD
if (query->context->tid != GetCurrentThreadId()) if (query->context->tid != GetCurrentThreadId())
{ {
context_free_event_query(query); context_free_event_query(query);
context = context_acquire(This->wineD3DDevice, NULL, CTXUSAGE_RESOURCELOAD); context = context_acquire(This->device, NULL, CTXUSAGE_RESOURCELOAD);
context_alloc_event_query(context, query); context_alloc_event_query(context, query);
} }
else else
{ {
context = context_acquire(This->wineD3DDevice, query->context->current_rt, CTXUSAGE_RESOURCELOAD); context = context_acquire(This->device, query->context->current_rt, CTXUSAGE_RESOURCELOAD);
} }
} }
else else
{ {
context = context_acquire(This->wineD3DDevice, NULL, CTXUSAGE_RESOURCELOAD); context = context_acquire(This->device, NULL, CTXUSAGE_RESOURCELOAD);
context_alloc_event_query(context, query); context_alloc_event_query(context, query);
} }
...@@ -520,7 +520,7 @@ static HRESULT WINAPI IWineD3DEventQueryImpl_Issue(IWineD3DQuery* iface, DWORD ...@@ -520,7 +520,7 @@ static HRESULT WINAPI IWineD3DEventQueryImpl_Issue(IWineD3DQuery* iface, DWORD
static HRESULT WINAPI IWineD3DOcclusionQueryImpl_Issue(IWineD3DQuery* iface, DWORD dwIssueFlags) { static HRESULT WINAPI IWineD3DOcclusionQueryImpl_Issue(IWineD3DQuery* iface, DWORD dwIssueFlags) {
IWineD3DQueryImpl *This = (IWineD3DQueryImpl *)iface; IWineD3DQueryImpl *This = (IWineD3DQueryImpl *)iface;
IWineD3DDeviceImpl *device = This->wineD3DDevice; IWineD3DDeviceImpl *device = This->device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
if (gl_info->supported[ARB_OCCLUSION_QUERY]) if (gl_info->supported[ARB_OCCLUSION_QUERY])
...@@ -538,12 +538,12 @@ static HRESULT WINAPI IWineD3DOcclusionQueryImpl_Issue(IWineD3DQuery* iface, D ...@@ -538,12 +538,12 @@ static HRESULT WINAPI IWineD3DOcclusionQueryImpl_Issue(IWineD3DQuery* iface, D
FIXME("Wrong thread, can't restart query.\n"); FIXME("Wrong thread, can't restart query.\n");
context_free_occlusion_query(query); context_free_occlusion_query(query);
context = context_acquire(This->wineD3DDevice, NULL, CTXUSAGE_RESOURCELOAD); context = context_acquire(This->device, NULL, CTXUSAGE_RESOURCELOAD);
context_alloc_occlusion_query(context, query); context_alloc_occlusion_query(context, query);
} }
else else
{ {
context = context_acquire(This->wineD3DDevice, query->context->current_rt, CTXUSAGE_RESOURCELOAD); context = context_acquire(This->device, query->context->current_rt, CTXUSAGE_RESOURCELOAD);
ENTER_GL(); ENTER_GL();
GL_EXTCALL(glEndQueryARB(GL_SAMPLES_PASSED_ARB)); GL_EXTCALL(glEndQueryARB(GL_SAMPLES_PASSED_ARB));
...@@ -554,7 +554,7 @@ static HRESULT WINAPI IWineD3DOcclusionQueryImpl_Issue(IWineD3DQuery* iface, D ...@@ -554,7 +554,7 @@ static HRESULT WINAPI IWineD3DOcclusionQueryImpl_Issue(IWineD3DQuery* iface, D
else else
{ {
if (query->context) context_free_occlusion_query(query); if (query->context) context_free_occlusion_query(query);
context = context_acquire(This->wineD3DDevice, NULL, CTXUSAGE_RESOURCELOAD); context = context_acquire(This->device, NULL, CTXUSAGE_RESOURCELOAD);
context_alloc_occlusion_query(context, query); context_alloc_occlusion_query(context, query);
} }
...@@ -578,7 +578,7 @@ static HRESULT WINAPI IWineD3DOcclusionQueryImpl_Issue(IWineD3DQuery* iface, D ...@@ -578,7 +578,7 @@ static HRESULT WINAPI IWineD3DOcclusionQueryImpl_Issue(IWineD3DQuery* iface, D
} }
else else
{ {
context = context_acquire(This->wineD3DDevice, query->context->current_rt, CTXUSAGE_RESOURCELOAD); context = context_acquire(This->device, query->context->current_rt, CTXUSAGE_RESOURCELOAD);
ENTER_GL(); ENTER_GL();
GL_EXTCALL(glEndQueryARB(GL_SAMPLES_PASSED_ARB)); GL_EXTCALL(glEndQueryARB(GL_SAMPLES_PASSED_ARB));
......
...@@ -33,7 +33,7 @@ HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type ...@@ -33,7 +33,7 @@ HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type
{ {
struct IWineD3DResourceClass *resource = &((IWineD3DResourceImpl *)iface)->resource; struct IWineD3DResourceClass *resource = &((IWineD3DResourceImpl *)iface)->resource;
resource->wineD3DDevice = device; resource->device = device;
resource->parent = parent; resource->parent = parent;
resource->resourceType = resource_type; resource->resourceType = resource_type;
resource->ref = 1; resource->ref = 1;
...@@ -87,7 +87,7 @@ void resource_cleanup(IWineD3DResource *iface) ...@@ -87,7 +87,7 @@ void resource_cleanup(IWineD3DResource *iface)
TRACE("(%p) Cleaning up resource\n", This); TRACE("(%p) Cleaning up resource\n", This);
if (This->resource.pool == WINED3DPOOL_DEFAULT) { if (This->resource.pool == WINED3DPOOL_DEFAULT) {
TRACE("Decrementing device memory pool by %u\n", This->resource.size); TRACE("Decrementing device memory pool by %u\n", This->resource.size);
WineD3DAdapterChangeGLRam(This->resource.wineD3DDevice, -This->resource.size); WineD3DAdapterChangeGLRam(This->resource.device, -This->resource.size);
} }
LIST_FOR_EACH_SAFE(e1, e2, &This->resource.privateData) { LIST_FOR_EACH_SAFE(e1, e2, &This->resource.privateData) {
...@@ -102,7 +102,7 @@ void resource_cleanup(IWineD3DResource *iface) ...@@ -102,7 +102,7 @@ void resource_cleanup(IWineD3DResource *iface)
This->resource.allocatedMemory = 0; This->resource.allocatedMemory = 0;
This->resource.heapMemory = 0; This->resource.heapMemory = 0;
if (This->resource.wineD3DDevice) device_resource_released(This->resource.wineD3DDevice, iface); if (This->resource.device) device_resource_released(This->resource.device, iface);
} }
static PrivateData* resource_find_private_data(IWineD3DResourceImpl *This, REFGUID tag) static PrivateData* resource_find_private_data(IWineD3DResourceImpl *This, REFGUID tag)
...@@ -179,7 +179,7 @@ HRESULT resource_get_private_data(IWineD3DResource *iface, REFGUID refguid, void ...@@ -179,7 +179,7 @@ HRESULT resource_get_private_data(IWineD3DResource *iface, REFGUID refguid, void
if (data->flags & WINED3DSPD_IUNKNOWN) { if (data->flags & WINED3DSPD_IUNKNOWN) {
*(LPUNKNOWN *)pData = data->ptr.object; *(LPUNKNOWN *)pData = data->ptr.object;
if (((IWineD3DImpl *)This->resource.wineD3DDevice->wined3d)->dxVersion != 7) if (((IWineD3DImpl *)This->resource.device->wined3d)->dxVersion != 7)
{ {
/* D3D8 and D3D9 addref the private data, DDraw does not. This can't be handled in /* D3D8 and D3D9 addref the private data, DDraw does not. This can't be handled in
* ddraw because it doesn't know if the pointer returned is an IUnknown * or just a * ddraw because it doesn't know if the pointer returned is an IUnknown * or just a
......
...@@ -193,7 +193,7 @@ static const DWORD vertex_states_sampler[] = ...@@ -193,7 +193,7 @@ static const DWORD vertex_states_sampler[] =
*/ */
static HRESULT stateblock_allocate_shader_constants(IWineD3DStateBlockImpl *object) static HRESULT stateblock_allocate_shader_constants(IWineD3DStateBlockImpl *object)
{ {
IWineD3DDeviceImpl *device = object->wineD3DDevice; IWineD3DDeviceImpl *device = object->device;
/* Allocate space for floating point constants */ /* Allocate space for floating point constants */
object->pixelShaderConstantF = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, object->pixelShaderConstantF = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
...@@ -329,7 +329,7 @@ static void stateblock_savedstates_set_vertex(SAVEDSTATES *states, const DWORD n ...@@ -329,7 +329,7 @@ static void stateblock_savedstates_set_vertex(SAVEDSTATES *states, const DWORD n
void stateblock_init_contained_states(IWineD3DStateBlockImpl *stateblock) void stateblock_init_contained_states(IWineD3DStateBlockImpl *stateblock)
{ {
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; IWineD3DDeviceImpl *device = stateblock->device;
unsigned int i, j; unsigned int i, j;
for (i = 0; i <= WINEHIGHEST_RENDER_STATE >> 5; ++i) for (i = 0; i <= WINEHIGHEST_RENDER_STATE >> 5; ++i)
...@@ -583,7 +583,7 @@ static void record_lights(IWineD3DStateBlockImpl *This, const IWineD3DStateBlock ...@@ -583,7 +583,7 @@ static void record_lights(IWineD3DStateBlockImpl *This, const IWineD3DStateBlock
static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface) static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
{ {
IWineD3DStateBlockImpl *This = (IWineD3DStateBlockImpl *)iface; IWineD3DStateBlockImpl *This = (IWineD3DStateBlockImpl *)iface;
IWineD3DStateBlockImpl *targetStateBlock = This->wineD3DDevice->stateBlock; IWineD3DStateBlockImpl *targetStateBlock = This->device->stateBlock;
unsigned int i; unsigned int i;
DWORD map; DWORD map;
...@@ -720,7 +720,7 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface) ...@@ -720,7 +720,7 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
if (This->changed.vertexDecl && This->vertexDecl != targetStateBlock->vertexDecl if (This->changed.vertexDecl && This->vertexDecl != targetStateBlock->vertexDecl
&& (This->blockType != WINED3DSBT_RECORDED && (This->blockType != WINED3DSBT_RECORDED
|| ((IWineD3DImpl *)This->wineD3DDevice->wined3d)->dxVersion != 9)) || ((IWineD3DImpl *)This->device->wined3d)->dxVersion != 9))
{ {
TRACE("Updating vertex declaration from %p to %p.\n", This->vertexDecl, targetStateBlock->vertexDecl); TRACE("Updating vertex declaration from %p to %p.\n", This->vertexDecl, targetStateBlock->vertexDecl);
...@@ -878,7 +878,7 @@ static void apply_lights(IWineD3DDevice *pDevice, const IWineD3DStateBlockImpl * ...@@ -878,7 +878,7 @@ static void apply_lights(IWineD3DDevice *pDevice, const IWineD3DStateBlockImpl *
static HRESULT WINAPI IWineD3DStateBlockImpl_Apply(IWineD3DStateBlock *iface) static HRESULT WINAPI IWineD3DStateBlockImpl_Apply(IWineD3DStateBlock *iface)
{ {
IWineD3DStateBlockImpl *This = (IWineD3DStateBlockImpl *)iface; IWineD3DStateBlockImpl *This = (IWineD3DStateBlockImpl *)iface;
IWineD3DDevice *pDevice = (IWineD3DDevice *)This->wineD3DDevice; IWineD3DDevice *pDevice = (IWineD3DDevice *)This->device;
unsigned int i; unsigned int i;
DWORD map; DWORD map;
...@@ -961,8 +961,8 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Apply(IWineD3DStateBlock *iface) ...@@ -961,8 +961,8 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Apply(IWineD3DStateBlock *iface)
if (This->changed.primitive_type) if (This->changed.primitive_type)
{ {
This->wineD3DDevice->updateStateBlock->changed.primitive_type = TRUE; This->device->updateStateBlock->changed.primitive_type = TRUE;
This->wineD3DDevice->updateStateBlock->gl_primitive_type = This->gl_primitive_type; This->device->updateStateBlock->gl_primitive_type = This->gl_primitive_type;
} }
if (This->changed.indices) if (This->changed.indices)
...@@ -1028,12 +1028,12 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Apply(IWineD3DStateBlock *iface) ...@@ -1028,12 +1028,12 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Apply(IWineD3DStateBlock *iface)
IWineD3DDevice_SetClipPlane(pDevice, i, clip); IWineD3DDevice_SetClipPlane(pDevice, i, clip);
} }
This->wineD3DDevice->stateBlock->lowest_disabled_stage = MAX_TEXTURES - 1; This->device->stateBlock->lowest_disabled_stage = MAX_TEXTURES - 1;
for (i = 0; i < MAX_TEXTURES - 1; ++i) for (i = 0; i < MAX_TEXTURES - 1; ++i)
{ {
if (This->wineD3DDevice->stateBlock->textureState[i][WINED3DTSS_COLOROP] == WINED3DTOP_DISABLE) if (This->device->stateBlock->textureState[i][WINED3DTSS_COLOROP] == WINED3DTOP_DISABLE)
{ {
This->wineD3DDevice->stateBlock->lowest_disabled_stage = i; This->device->stateBlock->lowest_disabled_stage = i;
break; break;
} }
} }
...@@ -1044,9 +1044,9 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Apply(IWineD3DStateBlock *iface) ...@@ -1044,9 +1044,9 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Apply(IWineD3DStateBlock *iface)
static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStateBlock* iface) { static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStateBlock* iface) {
IWineD3DStateBlockImpl *This = (IWineD3DStateBlockImpl *)iface; IWineD3DStateBlockImpl *This = (IWineD3DStateBlockImpl *)iface;
IWineD3DDevice *device = (IWineD3DDevice *)This->wineD3DDevice; IWineD3DDevice *device = (IWineD3DDevice *)This->device;
IWineD3DDeviceImpl *ThisDevice = (IWineD3DDeviceImpl *)device; IWineD3DDeviceImpl *ThisDevice = (IWineD3DDeviceImpl *)device;
const struct wined3d_gl_info *gl_info = &This->wineD3DDevice->adapter->gl_info; const struct wined3d_gl_info *gl_info = &ThisDevice->adapter->gl_info;
union { union {
WINED3DLINEPATTERN lp; WINED3DLINEPATTERN lp;
DWORD d; DWORD d;
...@@ -1063,7 +1063,7 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat ...@@ -1063,7 +1063,7 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat
/* Note this may have a large overhead but it should only be executed /* Note this may have a large overhead but it should only be executed
once, in order to initialize the complete state of the device and once, in order to initialize the complete state of the device and
all opengl equivalents */ all opengl equivalents */
TRACE("(%p) -----------------------> Setting up device defaults... %p\n", This, This->wineD3DDevice); TRACE("(%p) -----------------------> Setting up device defaults... %p\n", This, ThisDevice);
/* TODO: make a special stateblock type for the primary stateblock (it never gets applied so it doesn't need a real type) */ /* TODO: make a special stateblock type for the primary stateblock (it never gets applied so it doesn't need a real type) */
This->blockType = WINED3DSBT_INIT; This->blockType = WINED3DSBT_INIT;
...@@ -1323,7 +1323,7 @@ HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, IWineD3DDeviceImpl * ...@@ -1323,7 +1323,7 @@ HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, IWineD3DDeviceImpl *
stateblock->lpVtbl = &IWineD3DStateBlock_Vtbl; stateblock->lpVtbl = &IWineD3DStateBlock_Vtbl;
stateblock->ref = 1; stateblock->ref = 1;
stateblock->wineD3DDevice = device; stateblock->device = device;
stateblock->blockType = type; stateblock->blockType = type;
for (i = 0; i < LIGHTMAP_SIZE; i++) for (i = 0; i < LIGHTMAP_SIZE; i++)
......
...@@ -162,11 +162,8 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetContainer(IWineD3DSurface* iface, REFI ...@@ -162,11 +162,8 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetContainer(IWineD3DSurface* iface, REFI
} }
/* Standalone surfaces return the device as container. */ /* Standalone surfaces return the device as container. */
if (This->container) { if (This->container) container = This->container;
container = This->container; else container = (IWineD3DBase *)This->resource.device;
} else {
container = (IWineD3DBase *)This->resource.wineD3DDevice;
}
TRACE("Relaying to QueryInterface\n"); TRACE("Relaying to QueryInterface\n");
return IUnknown_QueryInterface(container, riid, ppContainer); return IUnknown_QueryInterface(container, riid, ppContainer);
...@@ -342,7 +339,7 @@ DWORD WINAPI IWineD3DBaseSurfaceImpl_GetPitch(IWineD3DSurface *iface) { ...@@ -342,7 +339,7 @@ DWORD WINAPI IWineD3DBaseSurfaceImpl_GetPitch(IWineD3DSurface *iface) {
} }
else else
{ {
unsigned char alignment = This->resource.wineD3DDevice->surface_alignment; unsigned char alignment = This->resource.device->surface_alignment;
ret = This->resource.format_desc->byte_count * This->currentDesc.Width; /* Bytes / row */ ret = This->resource.format_desc->byte_count * This->currentDesc.Width; /* Bytes / row */
ret = (ret + alignment - 1) & ~(alignment - 1); ret = (ret + alignment - 1) & ~(alignment - 1);
} }
...@@ -507,7 +504,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetContainer(IWineD3DSurface *iface, IWin ...@@ -507,7 +504,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetContainer(IWineD3DSurface *iface, IWin
HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORMAT format) { HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORMAT format) {
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format,
&This->resource.wineD3DDevice->adapter->gl_info); &This->resource.device->adapter->gl_info);
if (This->resource.format_desc->format != WINED3DFMT_UNKNOWN) if (This->resource.format_desc->format != WINED3DFMT_UNKNOWN)
{ {
...@@ -517,7 +514,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3D ...@@ -517,7 +514,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3D
TRACE("(%p) : Setting texture format to (%d,%s)\n", This, format, debug_d3dformat(format)); TRACE("(%p) : Setting texture format to (%d,%s)\n", This, format, debug_d3dformat(format));
This->resource.size = surface_calculate_size(format_desc, This->resource.wineD3DDevice->surface_alignment, This->resource.size = surface_calculate_size(format_desc, This->resource.device->surface_alignment,
This->pow2Width, This->pow2Height); This->pow2Width, This->pow2Height);
This->Flags |= (WINED3DFMT_D16_LOCKABLE == format) ? SFLAG_LOCKABLE : 0; This->Flags |= (WINED3DFMT_D16_LOCKABLE == format) ? SFLAG_LOCKABLE : 0;
...@@ -793,7 +790,7 @@ static IWineD3DSurfaceImpl *surface_convert_format(IWineD3DSurfaceImpl *source, ...@@ -793,7 +790,7 @@ static IWineD3DSurfaceImpl *surface_convert_format(IWineD3DSurfaceImpl *source,
return NULL; return NULL;
} }
IWineD3DDevice_CreateSurface((IWineD3DDevice *)source->resource.wineD3DDevice, source->currentDesc.Width, IWineD3DDevice_CreateSurface((IWineD3DDevice *)source->resource.device, source->currentDesc.Width,
source->currentDesc.Height, to_fmt, TRUE /* lockable */, TRUE /* discard */, 0 /* level */, &ret, source->currentDesc.Height, to_fmt, TRUE /* lockable */, TRUE /* discard */, 0 /* level */, &ret,
0 /* usage */, WINED3DPOOL_SCRATCH, WINED3DMULTISAMPLE_NONE /* TODO: Multisampled conversion */, 0 /* usage */, WINED3DPOOL_SCRATCH, WINED3DMULTISAMPLE_NONE /* TODO: Multisampled conversion */,
0 /* MultiSampleQuality */, IWineD3DSurface_GetImplType((IWineD3DSurface *) source), 0 /* MultiSampleQuality */, IWineD3DSurface_GetImplType((IWineD3DSurface *) source),
......
...@@ -429,7 +429,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD ...@@ -429,7 +429,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
} else { } else {
IWineD3DSurfaceImpl *dds_primary; IWineD3DSurfaceImpl *dds_primary;
IWineD3DSwapChainImpl *swapchain; IWineD3DSwapChainImpl *swapchain;
swapchain = (IWineD3DSwapChainImpl *)This->resource.wineD3DDevice->swapchains[0]; swapchain = (IWineD3DSwapChainImpl *)This->resource.device->swapchains[0];
dds_primary = (IWineD3DSurfaceImpl *)swapchain->frontBuffer; dds_primary = (IWineD3DSurfaceImpl *)swapchain->frontBuffer;
if (dds_primary && dds_primary->palette) if (dds_primary && dds_primary->palette)
pal = dds_primary->palette->palents; pal = dds_primary->palette->palents;
......
...@@ -139,7 +139,7 @@ HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetDisplayMode(IWineD3DSwapChain *iface ...@@ -139,7 +139,7 @@ HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetDisplayMode(IWineD3DSwapChain *iface
HRESULT hr; HRESULT hr;
TRACE("(%p)->(%p): Calling GetAdapterDisplayMode\n", This, pMode); TRACE("(%p)->(%p): Calling GetAdapterDisplayMode\n", This, pMode);
hr = IWineD3D_GetAdapterDisplayMode(This->wineD3DDevice->wined3d, This->wineD3DDevice->adapter->ordinal, pMode); hr = IWineD3D_GetAdapterDisplayMode(This->device->wined3d, This->device->adapter->ordinal, pMode);
TRACE("(%p) : returning w(%d) h(%d) rr(%d) fmt(%u,%s)\n", This, pMode->Width, pMode->Height, pMode->RefreshRate, TRACE("(%p) : returning w(%d) h(%d) rr(%d) fmt(%u,%s)\n", This, pMode->Width, pMode->Height, pMode->RefreshRate,
pMode->Format, debug_d3dformat(pMode->Format)); pMode->Format, debug_d3dformat(pMode->Format));
...@@ -149,7 +149,7 @@ HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetDisplayMode(IWineD3DSwapChain *iface ...@@ -149,7 +149,7 @@ HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetDisplayMode(IWineD3DSwapChain *iface
HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetDevice(IWineD3DSwapChain *iface, IWineD3DDevice**ppDevice) { HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetDevice(IWineD3DSwapChain *iface, IWineD3DDevice**ppDevice) {
IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface; IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface;
*ppDevice = (IWineD3DDevice *) This->wineD3DDevice; *ppDevice = (IWineD3DDevice *)This->device;
/* Note Calling this method will increase the internal reference count /* Note Calling this method will increase the internal reference count
on the IDirect3DDevice9 interface. */ on the IDirect3DDevice9 interface. */
......
...@@ -67,7 +67,7 @@ static void WINAPI IWineGDISwapChainImpl_Destroy(IWineD3DSwapChain *iface) ...@@ -67,7 +67,7 @@ static void WINAPI IWineGDISwapChainImpl_Destroy(IWineD3DSwapChain *iface)
mode.Height = This->orig_height; mode.Height = This->orig_height;
mode.RefreshRate = 0; mode.RefreshRate = 0;
mode.Format = This->orig_fmt; mode.Format = This->orig_fmt;
IWineD3DDevice_SetDisplayMode((IWineD3DDevice *) This->wineD3DDevice, 0, &mode); IWineD3DDevice_SetDisplayMode((IWineD3DDevice *)This->device, 0, &mode);
} }
HeapFree(GetProcessHeap(), 0, This->context); HeapFree(GetProcessHeap(), 0, This->context);
......
...@@ -31,7 +31,7 @@ static void texture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3DSRG ...@@ -31,7 +31,7 @@ static void texture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3DSRG
{ {
/* Override the IWineD3DResource PreLoad method. */ /* Override the IWineD3DResource PreLoad method. */
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface; IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; IWineD3DDeviceImpl *device = This->resource.device;
struct wined3d_context *context = NULL; struct wined3d_context *context = NULL;
unsigned int i; unsigned int i;
BOOL srgb_mode; BOOL srgb_mode;
......
...@@ -2227,7 +2227,7 @@ DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) { ...@@ -2227,7 +2227,7 @@ DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) {
*********************************************************************/ *********************************************************************/
BOOL CalculateTexRect(IWineD3DSurfaceImpl *This, RECT *Rect, float glTexCoord[4]) BOOL CalculateTexRect(IWineD3DSurfaceImpl *This, RECT *Rect, float glTexCoord[4])
{ {
const struct wined3d_gl_info *gl_info = &This->resource.wineD3DDevice->adapter->gl_info; const struct wined3d_gl_info *gl_info = &This->resource.device->adapter->gl_info;
int x1 = Rect->left, x2 = Rect->right; int x1 = Rect->left, x2 = Rect->right;
int y1 = Rect->top, y2 = Rect->bottom; int y1 = Rect->top, y2 = Rect->bottom;
GLint maxSize = gl_info->limits.texture_size; GLint maxSize = gl_info->limits.texture_size;
...@@ -2386,7 +2386,7 @@ void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_setting ...@@ -2386,7 +2386,7 @@ void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_setting
unsigned int i; unsigned int i;
DWORD ttff; DWORD ttff;
DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2; DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2;
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; IWineD3DDeviceImpl *device = stateblock->device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
for (i = 0; i < gl_info->limits.texture_stages; ++i) for (i = 0; i < gl_info->limits.texture_stages; ++i)
...@@ -2703,7 +2703,7 @@ void texture_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock ...@@ -2703,7 +2703,7 @@ void texture_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock
void sampler_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *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->device->texUnitMap[sampler];
/* 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
......
...@@ -206,7 +206,7 @@ HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *declaration, IWine ...@@ -206,7 +206,7 @@ HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *declaration, IWine
declaration->ref = 1; declaration->ref = 1;
declaration->parent = parent; declaration->parent = parent;
declaration->parent_ops = parent_ops; declaration->parent_ops = parent_ops;
declaration->wineD3DDevice = device; declaration->device = device;
declaration->elements = HeapAlloc(GetProcessHeap(), 0, sizeof(*declaration->elements) * element_count); declaration->elements = HeapAlloc(GetProcessHeap(), 0, sizeof(*declaration->elements) * element_count);
if (!declaration->elements) if (!declaration->elements)
{ {
......
...@@ -25,12 +25,12 @@ ...@@ -25,12 +25,12 @@
#include "wined3d_private.h" #include "wined3d_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface); WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface);
#define GLINFO_LOCATION This->resource.wineD3DDevice->adapter->gl_info #define GLINFO_LOCATION This->resource.device->adapter->gl_info
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static void volume_bind_and_dirtify(IWineD3DVolume *iface) { static void volume_bind_and_dirtify(IWineD3DVolume *iface) {
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface; IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface;
const struct wined3d_gl_info *gl_info = &This->resource.wineD3DDevice->adapter->gl_info; const struct wined3d_gl_info *gl_info = &This->resource.device->adapter->gl_info;
IWineD3DVolumeTexture *texture; IWineD3DVolumeTexture *texture;
DWORD active_sampler; DWORD active_sampler;
...@@ -51,14 +51,14 @@ static void volume_bind_and_dirtify(IWineD3DVolume *iface) { ...@@ -51,14 +51,14 @@ static void volume_bind_and_dirtify(IWineD3DVolume *iface) {
ENTER_GL(); ENTER_GL();
glGetIntegerv(GL_ACTIVE_TEXTURE, &active_texture); glGetIntegerv(GL_ACTIVE_TEXTURE, &active_texture);
LEAVE_GL(); LEAVE_GL();
active_sampler = This->resource.wineD3DDevice->rev_tex_unit_map[active_texture - GL_TEXTURE0_ARB]; active_sampler = This->resource.device->rev_tex_unit_map[active_texture - GL_TEXTURE0_ARB];
} else { } else {
active_sampler = 0; active_sampler = 0;
} }
if (active_sampler != WINED3D_UNMAPPED_STAGE) if (active_sampler != WINED3D_UNMAPPED_STAGE)
{ {
IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_SAMPLER(active_sampler)); IWineD3DDeviceImpl_MarkStateDirty(This->resource.device, STATE_SAMPLER(active_sampler));
} }
if (SUCCEEDED(IWineD3DSurface_GetContainer(iface, &IID_IWineD3DVolumeTexture, (void **)&texture))) { if (SUCCEEDED(IWineD3DSurface_GetContainer(iface, &IID_IWineD3DVolumeTexture, (void **)&texture))) {
......
...@@ -30,7 +30,7 @@ static void volumetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINE ...@@ -30,7 +30,7 @@ static void volumetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINE
{ {
/* Override the IWineD3DResource Preload method. */ /* Override the IWineD3DResource Preload method. */
IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface; IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface;
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; IWineD3DDeviceImpl *device = This->resource.device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
struct wined3d_context *context = NULL; struct wined3d_context *context = NULL;
BOOL srgb_mode = This->baseTexture.is_srgb; BOOL srgb_mode = This->baseTexture.is_srgb;
......
...@@ -1631,7 +1631,7 @@ typedef struct IWineD3DResourceClass ...@@ -1631,7 +1631,7 @@ typedef struct IWineD3DResourceClass
/* WineD3DResource Information */ /* WineD3DResource Information */
IUnknown *parent; IUnknown *parent;
WINED3DRESOURCETYPE resourceType; WINED3DRESOURCETYPE resourceType;
IWineD3DDeviceImpl *wineD3DDevice; IWineD3DDeviceImpl *device;
WINED3DPOOL pool; WINED3DPOOL pool;
UINT size; UINT size;
DWORD usage; DWORD usage;
...@@ -2133,7 +2133,7 @@ typedef struct IWineD3DVertexDeclarationImpl { ...@@ -2133,7 +2133,7 @@ typedef struct IWineD3DVertexDeclarationImpl {
IUnknown *parent; IUnknown *parent;
const struct wined3d_parent_ops *parent_ops; const struct wined3d_parent_ops *parent_ops;
IWineD3DDeviceImpl *wineD3DDevice; IWineD3DDeviceImpl *device;
struct wined3d_vertex_declaration_element *elements; struct wined3d_vertex_declaration_element *elements;
UINT element_count; UINT element_count;
...@@ -2193,7 +2193,7 @@ struct IWineD3DStateBlockImpl ...@@ -2193,7 +2193,7 @@ struct IWineD3DStateBlockImpl
LONG ref; /* Note: Ref counting not required */ LONG ref; /* Note: Ref counting not required */
/* IWineD3DStateBlock information */ /* IWineD3DStateBlock information */
IWineD3DDeviceImpl *wineD3DDevice; IWineD3DDeviceImpl *device;
WINED3DSTATEBLOCKTYPE blockType; WINED3DSTATEBLOCKTYPE blockType;
/* Array indicating whether things have been set or changed */ /* Array indicating whether things have been set or changed */
...@@ -2313,7 +2313,7 @@ typedef struct IWineD3DQueryImpl ...@@ -2313,7 +2313,7 @@ typedef struct IWineD3DQueryImpl
LONG ref; /* Note: Ref counting not required */ LONG ref; /* Note: Ref counting not required */
IUnknown *parent; IUnknown *parent;
IWineD3DDeviceImpl *wineD3DDevice; IWineD3DDeviceImpl *device;
/* IWineD3DQuery fields */ /* IWineD3DQuery fields */
enum query_state state; enum query_state state;
...@@ -2401,7 +2401,7 @@ typedef struct IWineD3DSwapChainImpl ...@@ -2401,7 +2401,7 @@ typedef struct IWineD3DSwapChainImpl
LONG ref; /* Note: Ref counting not required */ LONG ref; /* Note: Ref counting not required */
IUnknown *parent; IUnknown *parent;
IWineD3DDeviceImpl *wineD3DDevice; IWineD3DDeviceImpl *device;
/* IWineD3DSwapChain fields */ /* IWineD3DSwapChain fields */
IWineD3DSurface **backBuffer; IWineD3DSurface **backBuffer;
...@@ -2790,7 +2790,7 @@ struct IWineD3DPaletteImpl { ...@@ -2790,7 +2790,7 @@ struct IWineD3DPaletteImpl {
LONG ref; LONG ref;
IUnknown *parent; IUnknown *parent;
IWineD3DDeviceImpl *wineD3DDevice; IWineD3DDeviceImpl *device;
/* IWineD3DPalette */ /* IWineD3DPalette */
HPALETTE hpal; HPALETTE hpal;
...@@ -2866,13 +2866,12 @@ static inline BOOL use_vs(IWineD3DStateBlockImpl *stateblock) ...@@ -2866,13 +2866,12 @@ static inline BOOL use_vs(IWineD3DStateBlockImpl *stateblock)
* style strided data. */ * style strided data. */
return (stateblock->vertexShader return (stateblock->vertexShader
&& !((IWineD3DVertexDeclarationImpl *)stateblock->vertexDecl)->position_transformed && !((IWineD3DVertexDeclarationImpl *)stateblock->vertexDecl)->position_transformed
&& stateblock->wineD3DDevice->vs_selected_mode != SHADER_NONE); && stateblock->device->vs_selected_mode != SHADER_NONE);
} }
static inline BOOL use_ps(IWineD3DStateBlockImpl *stateblock) static inline BOOL use_ps(IWineD3DStateBlockImpl *stateblock)
{ {
return (stateblock->pixelShader return (stateblock->pixelShader && stateblock->device->ps_selected_mode != SHADER_NONE);
&& stateblock->wineD3DDevice->ps_selected_mode != SHADER_NONE);
} }
void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface,
......
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