Commit 4a698749 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Pass an IWineD3DDeviceImpl pointer to shader_alloc_private().

parent 77923346
......@@ -4744,8 +4744,8 @@ static const struct wine_rb_functions sig_tree_functions =
sig_tree_compare
};
static HRESULT shader_arb_alloc(IWineD3DDevice *iface) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
static HRESULT shader_arb_alloc(IWineD3DDeviceImpl *device)
{
struct shader_arb_priv *priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*priv));
if(wine_rb_init(&priv->signature_tree, &sig_tree_functions) == -1)
{
......@@ -4753,7 +4753,7 @@ static HRESULT shader_arb_alloc(IWineD3DDevice *iface) {
HeapFree(GetProcessHeap(), 0, priv);
return E_OUTOFMEMORY;
}
This->shader_priv = priv;
device->shader_priv = priv;
return WINED3D_OK;
}
......
......@@ -1963,7 +1963,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface,
if (This->depth_stencil)
IWineD3DSurface_AddRef((IWineD3DSurface *)This->depth_stencil);
hr = This->shader_backend->shader_alloc_private(iface);
hr = This->shader_backend->shader_alloc_private(This);
if(FAILED(hr)) {
TRACE("Shader private data couldn't be allocated\n");
goto err_out;
......@@ -6244,7 +6244,7 @@ static HRESULT create_primary_opengl_context(IWineD3DDevice *iface, IWineD3DSwap
create_dummy_textures(This);
context_release(context);
hr = This->shader_backend->shader_alloc_private(iface);
hr = This->shader_backend->shader_alloc_private(This);
if (FAILED(hr))
{
ERR("Failed to allocate shader private data, hr %#x.\n", hr);
......
......@@ -4818,9 +4818,9 @@ static const struct wine_rb_functions wined3d_glsl_program_rb_functions =
glsl_program_key_compare,
};
static HRESULT shader_glsl_alloc(IWineD3DDevice *iface) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
const struct wined3d_gl_info *gl_info = &This->adapter->gl_info;
static HRESULT shader_glsl_alloc(IWineD3DDeviceImpl *device)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
struct shader_glsl_priv *priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct shader_glsl_priv));
SIZE_T stack_size = wined3d_log2i(max(gl_info->limits.glsl_vs_float_constants,
gl_info->limits.glsl_ps_float_constants)) + 1;
......@@ -4858,7 +4858,7 @@ static HRESULT shader_glsl_alloc(IWineD3DDevice *iface) {
priv->next_constant_version = 1;
This->shader_priv = priv;
device->shader_priv = priv;
return WINED3D_OK;
fail:
......
......@@ -1519,7 +1519,7 @@ static void shader_none_load_constants(const struct wined3d_context *context, ch
static void shader_none_load_np2fixup_constants(void *shader_priv,
const struct wined3d_gl_info *gl_info, const struct wined3d_state *state) {}
static void shader_none_destroy(IWineD3DBaseShader *iface) {}
static HRESULT shader_none_alloc(IWineD3DDevice *iface) {return WINED3D_OK;}
static HRESULT shader_none_alloc(IWineD3DDeviceImpl *device) {return WINED3D_OK;}
static void shader_none_free(IWineD3DDevice *iface) {}
static BOOL shader_none_dirty_const(IWineD3DDevice *iface) {return FALSE;}
......
......@@ -759,7 +759,7 @@ typedef struct {
void (*shader_load_np2fixup_constants)(void *shader_priv, const struct wined3d_gl_info *gl_info,
const struct wined3d_state *state);
void (*shader_destroy)(IWineD3DBaseShader *iface);
HRESULT (*shader_alloc_private)(IWineD3DDevice *iface);
HRESULT (*shader_alloc_private)(IWineD3DDeviceImpl *device);
void (*shader_free_private)(IWineD3DDevice *iface);
BOOL (*shader_dirtifyable_constants)(IWineD3DDevice *iface);
void (*shader_get_caps)(const struct wined3d_gl_info *gl_info, struct shader_caps *caps);
......
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