mirror of
https://github.com/reactos/wine.git
synced 2025-02-20 12:50:53 +00:00
wined3d: Pass an IWineD3DDeviceImpl pointer to shader_alloc_private().
This commit is contained in:
parent
77923346da
commit
4a69874938
@ -4744,8 +4744,8 @@ static const struct wine_rb_functions sig_tree_functions =
|
|||||||
sig_tree_compare
|
sig_tree_compare
|
||||||
};
|
};
|
||||||
|
|
||||||
static HRESULT shader_arb_alloc(IWineD3DDevice *iface) {
|
static HRESULT shader_arb_alloc(IWineD3DDeviceImpl *device)
|
||||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
{
|
||||||
struct shader_arb_priv *priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*priv));
|
struct shader_arb_priv *priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*priv));
|
||||||
if(wine_rb_init(&priv->signature_tree, &sig_tree_functions) == -1)
|
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);
|
HeapFree(GetProcessHeap(), 0, priv);
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
This->shader_priv = priv;
|
device->shader_priv = priv;
|
||||||
return WINED3D_OK;
|
return WINED3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1963,7 +1963,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface,
|
|||||||
if (This->depth_stencil)
|
if (This->depth_stencil)
|
||||||
IWineD3DSurface_AddRef((IWineD3DSurface *)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)) {
|
if(FAILED(hr)) {
|
||||||
TRACE("Shader private data couldn't be allocated\n");
|
TRACE("Shader private data couldn't be allocated\n");
|
||||||
goto err_out;
|
goto err_out;
|
||||||
@ -6244,7 +6244,7 @@ static HRESULT create_primary_opengl_context(IWineD3DDevice *iface, IWineD3DSwap
|
|||||||
create_dummy_textures(This);
|
create_dummy_textures(This);
|
||||||
context_release(context);
|
context_release(context);
|
||||||
|
|
||||||
hr = This->shader_backend->shader_alloc_private(iface);
|
hr = This->shader_backend->shader_alloc_private(This);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
ERR("Failed to allocate shader private data, hr %#x.\n", 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,
|
glsl_program_key_compare,
|
||||||
};
|
};
|
||||||
|
|
||||||
static HRESULT shader_glsl_alloc(IWineD3DDevice *iface) {
|
static HRESULT shader_glsl_alloc(IWineD3DDeviceImpl *device)
|
||||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
{
|
||||||
const struct wined3d_gl_info *gl_info = &This->adapter->gl_info;
|
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));
|
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,
|
SIZE_T stack_size = wined3d_log2i(max(gl_info->limits.glsl_vs_float_constants,
|
||||||
gl_info->limits.glsl_ps_float_constants)) + 1;
|
gl_info->limits.glsl_ps_float_constants)) + 1;
|
||||||
@ -4858,7 +4858,7 @@ static HRESULT shader_glsl_alloc(IWineD3DDevice *iface) {
|
|||||||
|
|
||||||
priv->next_constant_version = 1;
|
priv->next_constant_version = 1;
|
||||||
|
|
||||||
This->shader_priv = priv;
|
device->shader_priv = priv;
|
||||||
return WINED3D_OK;
|
return WINED3D_OK;
|
||||||
|
|
||||||
fail:
|
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,
|
static void shader_none_load_np2fixup_constants(void *shader_priv,
|
||||||
const struct wined3d_gl_info *gl_info, const struct wined3d_state *state) {}
|
const struct wined3d_gl_info *gl_info, const struct wined3d_state *state) {}
|
||||||
static void shader_none_destroy(IWineD3DBaseShader *iface) {}
|
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 void shader_none_free(IWineD3DDevice *iface) {}
|
||||||
static BOOL shader_none_dirty_const(IWineD3DDevice *iface) {return FALSE;}
|
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,
|
void (*shader_load_np2fixup_constants)(void *shader_priv, const struct wined3d_gl_info *gl_info,
|
||||||
const struct wined3d_state *state);
|
const struct wined3d_state *state);
|
||||||
void (*shader_destroy)(IWineD3DBaseShader *iface);
|
void (*shader_destroy)(IWineD3DBaseShader *iface);
|
||||||
HRESULT (*shader_alloc_private)(IWineD3DDevice *iface);
|
HRESULT (*shader_alloc_private)(IWineD3DDeviceImpl *device);
|
||||||
void (*shader_free_private)(IWineD3DDevice *iface);
|
void (*shader_free_private)(IWineD3DDevice *iface);
|
||||||
BOOL (*shader_dirtifyable_constants)(IWineD3DDevice *iface);
|
BOOL (*shader_dirtifyable_constants)(IWineD3DDevice *iface);
|
||||||
void (*shader_get_caps)(const struct wined3d_gl_info *gl_info, struct shader_caps *caps);
|
void (*shader_get_caps)(const struct wined3d_gl_info *gl_info, struct shader_caps *caps);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user