Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
24d4a52e
Commit
24d4a52e
authored
Jan 24, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 25, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Remove COM from the pixel shader implementation.
parent
483b17d4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
109 deletions
+20
-109
d3d8_private.h
dlls/d3d8/d3d8_private.h
+5
-33
device.c
dlls/d3d8/device.c
+7
-10
shader.c
dlls/d3d8/shader.c
+8
-66
No files found.
dlls/d3d8/d3d8_private.h
View file @
24d4a52e
...
@@ -365,9 +365,6 @@ struct IDirect3DVolumeTexture8Impl
...
@@ -365,9 +365,6 @@ struct IDirect3DVolumeTexture8Impl
HRESULT
volumetexture_init
(
IDirect3DVolumeTexture8Impl
*
texture
,
IDirect3DDevice8Impl
*
device
,
HRESULT
volumetexture_init
(
IDirect3DVolumeTexture8Impl
*
texture
,
IDirect3DDevice8Impl
*
device
,
UINT
width
,
UINT
height
,
UINT
depth
,
UINT
levels
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
)
DECLSPEC_HIDDEN
;
UINT
width
,
UINT
height
,
UINT
depth
,
UINT
levels
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
)
DECLSPEC_HIDDEN
;
DEFINE_GUID
(
IID_IDirect3DPixelShader8
,
0x6d3bdbdc
,
0x5b02
,
0x4415
,
0xb8
,
0x52
,
0xce
,
0x5e
,
0x8b
,
0xcc
,
0xb2
,
0x89
);
struct
d3d8_vertex_declaration
struct
d3d8_vertex_declaration
{
{
DWORD
*
elements
;
DWORD
*
elements
;
...
@@ -382,28 +379,6 @@ HRESULT d3d8_vertex_declaration_init(struct d3d8_vertex_declaration *declaration
...
@@ -382,28 +379,6 @@ HRESULT d3d8_vertex_declaration_init(struct d3d8_vertex_declaration *declaration
HRESULT
d3d8_vertex_declaration_init_fvf
(
struct
d3d8_vertex_declaration
*
declaration
,
HRESULT
d3d8_vertex_declaration_init_fvf
(
struct
d3d8_vertex_declaration
*
declaration
,
IDirect3DDevice8Impl
*
device
,
DWORD
fvf
)
DECLSPEC_HIDDEN
;
IDirect3DDevice8Impl
*
device
,
DWORD
fvf
)
DECLSPEC_HIDDEN
;
/*****************************************************************************
* IDirect3DPixelShader8 interface
*/
#define INTERFACE IDirect3DPixelShader8
DECLARE_INTERFACE_
(
IDirect3DPixelShader8
,
IUnknown
)
{
/*** IUnknown methods ***/
STDMETHOD_
(
HRESULT
,
QueryInterface
)(
THIS_
REFIID
riid
,
void
**
ppvObject
)
PURE
;
STDMETHOD_
(
ULONG
,
AddRef
)(
THIS
)
PURE
;
STDMETHOD_
(
ULONG
,
Release
)(
THIS
)
PURE
;
};
#undef INTERFACE
/*** IUnknown methods ***/
#define IDirect3DPixelShader8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirect3DPixelShader8_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirect3DPixelShader8_Release(p) (p)->lpVtbl->Release(p)
/*****************************************************************************
* IDirect3DVertexShader implementation structure
*/
struct
d3d8_vertex_shader
struct
d3d8_vertex_shader
{
{
struct
d3d8_vertex_declaration
*
vertex_declaration
;
struct
d3d8_vertex_declaration
*
vertex_declaration
;
...
@@ -416,17 +391,14 @@ HRESULT d3d8_vertex_shader_init(struct d3d8_vertex_shader *shader, IDirect3DDevi
...
@@ -416,17 +391,14 @@ HRESULT d3d8_vertex_shader_init(struct d3d8_vertex_shader *shader, IDirect3DDevi
#define D3D8_MAX_VERTEX_SHADER_CONSTANTF 256
#define D3D8_MAX_VERTEX_SHADER_CONSTANTF 256
/*****************************************************************************
struct
d3d8_pixel_shader
* IDirect3DPixelShader implementation structure
{
*/
typedef
struct
IDirect3DPixelShader8Impl
{
IDirect3DPixelShader8
IDirect3DPixelShader8_iface
;
LONG
ref
;
DWORD
handle
;
DWORD
handle
;
struct
wined3d_shader
*
wined3d_shader
;
struct
wined3d_shader
*
wined3d_shader
;
}
IDirect3DPixelShader8Impl
;
};
HRESULT
pixelshader_init
(
IDirect3DPixelShader8Impl
*
shader
,
IDirect3DDevice8Impl
*
device
,
void
d3d8_pixel_shader_destroy
(
struct
d3d8_pixel_shader
*
shader
)
DECLSPEC_HIDDEN
;
HRESULT
d3d8_pixel_shader_init
(
struct
d3d8_pixel_shader
*
shader
,
IDirect3DDevice8Impl
*
device
,
const
DWORD
*
byte_code
,
DWORD
shader_handle
)
DECLSPEC_HIDDEN
;
const
DWORD
*
byte_code
,
DWORD
shader_handle
)
DECLSPEC_HIDDEN
;
D3DFORMAT
d3dformat_from_wined3dformat
(
enum
wined3d_format_id
format
)
DECLSPEC_HIDDEN
;
D3DFORMAT
d3dformat_from_wined3dformat
(
enum
wined3d_format_id
format
)
DECLSPEC_HIDDEN
;
...
...
dlls/d3d8/device.c
View file @
24d4a52e
...
@@ -2387,7 +2387,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(IDirect3DDevice8 *i
...
@@ -2387,7 +2387,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(IDirect3DDevice8 *i
const
DWORD
*
byte_code
,
DWORD
*
shader
)
const
DWORD
*
byte_code
,
DWORD
*
shader
)
{
{
IDirect3DDevice8Impl
*
This
=
impl_from_IDirect3DDevice8
(
iface
);
IDirect3DDevice8Impl
*
This
=
impl_from_IDirect3DDevice8
(
iface
);
IDirect3DPixelShader8Impl
*
object
;
struct
d3d8_pixel_shader
*
object
;
DWORD
shader_handle
;
DWORD
shader_handle
;
DWORD
handle
;
DWORD
handle
;
HRESULT
hr
;
HRESULT
hr
;
...
@@ -2419,7 +2419,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(IDirect3DDevice8 *i
...
@@ -2419,7 +2419,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(IDirect3DDevice8 *i
shader_handle
=
handle
+
VS_HIGHESTFIXEDFXF
+
1
;
shader_handle
=
handle
+
VS_HIGHESTFIXEDFXF
+
1
;
hr
=
pixel
shader_init
(
object
,
This
,
byte_code
,
shader_handle
);
hr
=
d3d8_pixel_
shader_init
(
object
,
This
,
byte_code
,
shader_handle
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
{
{
WARN
(
"Failed to initialize pixel shader, hr %#x.
\n
"
,
hr
);
WARN
(
"Failed to initialize pixel shader, hr %#x.
\n
"
,
hr
);
...
@@ -2440,7 +2440,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(IDirect3DDevice8 *i
...
@@ -2440,7 +2440,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(IDirect3DDevice8 *i
static
HRESULT
WINAPI
IDirect3DDevice8Impl_SetPixelShader
(
IDirect3DDevice8
*
iface
,
DWORD
pShader
)
static
HRESULT
WINAPI
IDirect3DDevice8Impl_SetPixelShader
(
IDirect3DDevice8
*
iface
,
DWORD
pShader
)
{
{
IDirect3DDevice8Impl
*
This
=
impl_from_IDirect3DDevice8
(
iface
);
IDirect3DDevice8Impl
*
This
=
impl_from_IDirect3DDevice8
(
iface
);
IDirect3DPixelShader8Impl
*
shader
;
struct
d3d8_pixel_shader
*
shader
;
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"iface %p, shader %#x.
\n
"
,
iface
,
pShader
);
TRACE
(
"iface %p, shader %#x.
\n
"
,
iface
,
pShader
);
...
@@ -2485,7 +2485,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShader(IDirect3DDevice8 *ifac
...
@@ -2485,7 +2485,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShader(IDirect3DDevice8 *ifac
object
=
wined3d_device_get_pixel_shader
(
This
->
wined3d_device
);
object
=
wined3d_device_get_pixel_shader
(
This
->
wined3d_device
);
if
(
object
)
if
(
object
)
{
{
IDirect3DPixelShader8Impl
*
d3d8_shader
;
struct
d3d8_pixel_shader
*
d3d8_shader
;
d3d8_shader
=
wined3d_shader_get_parent
(
object
);
d3d8_shader
=
wined3d_shader_get_parent
(
object
);
wined3d_shader_decref
(
object
);
wined3d_shader_decref
(
object
);
*
ppShader
=
d3d8_shader
->
handle
;
*
ppShader
=
d3d8_shader
->
handle
;
...
@@ -2504,7 +2504,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShader(IDirect3DDevice8 *ifac
...
@@ -2504,7 +2504,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShader(IDirect3DDevice8 *ifac
static
HRESULT
WINAPI
IDirect3DDevice8Impl_DeletePixelShader
(
IDirect3DDevice8
*
iface
,
DWORD
pShader
)
static
HRESULT
WINAPI
IDirect3DDevice8Impl_DeletePixelShader
(
IDirect3DDevice8
*
iface
,
DWORD
pShader
)
{
{
IDirect3DDevice8Impl
*
This
=
impl_from_IDirect3DDevice8
(
iface
);
IDirect3DDevice8Impl
*
This
=
impl_from_IDirect3DDevice8
(
iface
);
IDirect3DPixelShader8Impl
*
shader
;
struct
d3d8_pixel_shader
*
shader
;
struct
wined3d_shader
*
cur
;
struct
wined3d_shader
*
cur
;
TRACE
(
"iface %p, shader %#x.
\n
"
,
iface
,
pShader
);
TRACE
(
"iface %p, shader %#x.
\n
"
,
iface
,
pShader
);
...
@@ -2529,10 +2529,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_DeletePixelShader(IDirect3DDevice8 *i
...
@@ -2529,10 +2529,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_DeletePixelShader(IDirect3DDevice8 *i
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
if
(
IDirect3DPixelShader8_Release
(
&
shader
->
IDirect3DPixelShader8_iface
))
d3d8_pixel_shader_destroy
(
shader
);
{
ERR
(
"Shader %p has references left, this shouldn't happen.
\n
"
,
shader
);
}
return
D3D_OK
;
return
D3D_OK
;
}
}
...
@@ -2573,7 +2570,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShaderFunction(IDirect3DDevic
...
@@ -2573,7 +2570,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShaderFunction(IDirect3DDevic
DWORD
pPixelShader
,
void
*
pData
,
DWORD
*
pSizeOfData
)
DWORD
pPixelShader
,
void
*
pData
,
DWORD
*
pSizeOfData
)
{
{
IDirect3DDevice8Impl
*
This
=
impl_from_IDirect3DDevice8
(
iface
);
IDirect3DDevice8Impl
*
This
=
impl_from_IDirect3DDevice8
(
iface
);
IDirect3DPixelShader8Impl
*
shader
=
NULL
;
struct
d3d8_pixel_shader
*
shader
=
NULL
;
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"iface %p, shader %#x, data %p, data_size %p.
\n
"
,
TRACE
(
"iface %p, shader %#x, data %p, data_size %p.
\n
"
,
...
...
dlls/d3d8/shader.c
View file @
24d4a52e
...
@@ -133,74 +133,18 @@ HRESULT d3d8_vertex_shader_init(struct d3d8_vertex_shader *shader, IDirect3DDevi
...
@@ -133,74 +133,18 @@ HRESULT d3d8_vertex_shader_init(struct d3d8_vertex_shader *shader, IDirect3DDevi
return
D3D_OK
;
return
D3D_OK
;
}
}
static
inline
IDirect3DPixelShader8Impl
*
impl_from_IDirect3DPixelShader8
(
IDirect3DPixelShader8
*
iface
)
static
void
STDMETHODCALLTYPE
d3d8_pixelshader_wined3d_object_destroyed
(
void
*
parent
)
{
return
CONTAINING_RECORD
(
iface
,
IDirect3DPixelShader8Impl
,
IDirect3DPixelShader8_iface
);
}
static
HRESULT
WINAPI
d3d8_pixelshader_QueryInterface
(
IDirect3DPixelShader8
*
iface
,
REFIID
riid
,
void
**
object
)
{
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
if
(
IsEqualGUID
(
riid
,
&
IID_IDirect3DPixelShader8
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
IUnknown_AddRef
(
iface
);
*
object
=
iface
;
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
riid
));
*
object
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
d3d8_pixelshader_AddRef
(
IDirect3DPixelShader8
*
iface
)
{
IDirect3DPixelShader8Impl
*
shader
=
impl_from_IDirect3DPixelShader8
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
shader
->
ref
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
iface
,
refcount
);
if
(
refcount
==
1
)
{
wined3d_mutex_lock
();
wined3d_shader_incref
(
shader
->
wined3d_shader
);
wined3d_mutex_unlock
();
}
return
refcount
;
}
static
ULONG
WINAPI
d3d8_pixelshader_Release
(
IDirect3DPixelShader8
*
iface
)
{
{
IDirect3DPixelShader8Impl
*
shader
=
impl_from_IDirect3DPixelShader8
(
iface
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
ULONG
refcount
=
InterlockedDecrement
(
&
shader
->
ref
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
if
(
!
refcount
)
{
wined3d_mutex_lock
();
wined3d_shader_decref
(
shader
->
wined3d_shader
);
wined3d_mutex_unlock
();
}
return
refcount
;
}
}
static
const
IDirect3DPixelShader8Vtbl
d3d8_pixelshader_vtbl
=
void
d3d8_pixel_shader_destroy
(
struct
d3d8_pixel_shader
*
shader
)
{
{
/* IUnknown */
TRACE
(
"shader %p.
\n
"
,
shader
);
d3d8_pixelshader_QueryInterface
,
d3d8_pixelshader_AddRef
,
d3d8_pixelshader_Release
,
};
static
void
STDMETHODCALLTYPE
d3d8_pixelshader_wined3d_object_destroyed
(
void
*
parent
)
wined3d_mutex_lock
();
{
wined3d_shader_decref
(
shader
->
wined3d_shader
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
wined3d_mutex_unlock
(
);
}
}
static
const
struct
wined3d_parent_ops
d3d8_pixelshader_wined3d_parent_ops
=
static
const
struct
wined3d_parent_ops
d3d8_pixelshader_wined3d_parent_ops
=
...
@@ -208,13 +152,11 @@ static const struct wined3d_parent_ops d3d8_pixelshader_wined3d_parent_ops =
...
@@ -208,13 +152,11 @@ static const struct wined3d_parent_ops d3d8_pixelshader_wined3d_parent_ops =
d3d8_pixelshader_wined3d_object_destroyed
,
d3d8_pixelshader_wined3d_object_destroyed
,
};
};
HRESULT
pixelshader_init
(
IDirect3DPixelShader8Impl
*
shader
,
IDirect3DDevice8Impl
*
device
,
HRESULT
d3d8_pixel_shader_init
(
struct
d3d8_pixel_shader
*
shader
,
IDirect3DDevice8Impl
*
device
,
const
DWORD
*
byte_code
,
DWORD
shader_handle
)
const
DWORD
*
byte_code
,
DWORD
shader_handle
)
{
{
HRESULT
hr
;
HRESULT
hr
;
shader
->
ref
=
1
;
shader
->
IDirect3DPixelShader8_iface
.
lpVtbl
=
&
d3d8_pixelshader_vtbl
;
shader
->
handle
=
shader_handle
;
shader
->
handle
=
shader_handle
;
wined3d_mutex_lock
();
wined3d_mutex_lock
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment