Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
01918d05
Commit
01918d05
authored
Sep 20, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: wined3d_device_set_vertex_declaration() never fails.
parent
63b20223
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
50 deletions
+16
-50
device.c
dlls/d3d8/device.c
+2
-3
device.c
dlls/d3d9/device.c
+4
-8
device.c
dlls/ddraw/device.c
+4
-33
device.c
dlls/wined3d/device.c
+5
-5
wined3d.h
include/wine/wined3d.h
+1
-1
No files found.
dlls/d3d8/device.c
View file @
01918d05
...
...
@@ -2138,10 +2138,9 @@ static HRESULT WINAPI d3d8_device_SetVertexShader(IDirect3DDevice8 *iface, DWORD
return
D3DERR_INVALIDCALL
;
}
hr
=
wined3d_device_set_vertex_declaration
(
device
->
wined3d_device
,
wined3d_device_set_vertex_declaration
(
device
->
wined3d_device
,
shader_impl
->
vertex_declaration
->
wined3d_vertex_declaration
);
if
(
SUCCEEDED
(
hr
))
hr
=
wined3d_device_set_vertex_shader
(
device
->
wined3d_device
,
shader_impl
->
wined3d_shader
);
hr
=
wined3d_device_set_vertex_shader
(
device
->
wined3d_device
,
shader_impl
->
wined3d_shader
);
wined3d_mutex_unlock
();
TRACE
(
"Returning hr %#x
\n
"
,
hr
);
...
...
dlls/d3d9/device.c
View file @
01918d05
...
...
@@ -2073,16 +2073,15 @@ static HRESULT WINAPI d3d9_device_SetVertexDeclaration(IDirect3DDevice9Ex *iface
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
struct
d3d9_vertex_declaration
*
decl_impl
=
unsafe_impl_from_IDirect3DVertexDeclaration9
(
declaration
);
HRESULT
hr
;
TRACE
(
"iface %p, declaration %p.
\n
"
,
iface
,
declaration
);
wined3d_mutex_lock
();
hr
=
wined3d_device_set_vertex_declaration
(
device
->
wined3d_device
,
wined3d_device_set_vertex_declaration
(
device
->
wined3d_device
,
decl_impl
?
decl_impl
->
wined3d_declaration
:
NULL
);
wined3d_mutex_unlock
();
return
hr
;
return
D3D_OK
;
}
static
HRESULT
WINAPI
d3d9_device_GetVertexDeclaration
(
IDirect3DDevice9Ex
*
iface
,
...
...
@@ -2188,7 +2187,6 @@ static HRESULT WINAPI d3d9_device_SetFVF(IDirect3DDevice9Ex *iface, DWORD fvf)
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
struct
wined3d_vertex_declaration
*
decl
;
HRESULT
hr
;
TRACE
(
"iface %p, fvf %#x.
\n
"
,
iface
,
fvf
);
...
...
@@ -2206,12 +2204,10 @@ static HRESULT WINAPI d3d9_device_SetFVF(IDirect3DDevice9Ex *iface, DWORD fvf)
return
D3DERR_DRIVERINTERNALERROR
;
}
hr
=
wined3d_device_set_vertex_declaration
(
device
->
wined3d_device
,
decl
);
if
(
FAILED
(
hr
))
ERR
(
"Failed to set vertex declaration.
\n
"
);
wined3d_device_set_vertex_declaration
(
device
->
wined3d_device
,
decl
);
wined3d_mutex_unlock
();
return
hr
;
return
D3D_OK
;
}
static
HRESULT
WINAPI
d3d9_device_GetFVF
(
IDirect3DDevice9Ex
*
iface
,
DWORD
*
fvf
)
...
...
dlls/ddraw/device.c
View file @
01918d05
...
...
@@ -3406,16 +3406,8 @@ static HRESULT d3d_device7_DrawPrimitive(IDirect3DDevice7 *iface,
/* Get the stride */
stride
=
get_flexible_vertex_size
(
fvf
);
/* Set the FVF */
wined3d_mutex_lock
();
hr
=
wined3d_device_set_vertex_declaration
(
device
->
wined3d_device
,
ddraw_find_decl
(
device
->
ddraw
,
fvf
));
if
(
hr
!=
D3D_OK
)
{
wined3d_mutex_unlock
();
return
hr
;
}
/* This method translates to the user pointer draw of WineD3D */
wined3d_device_set_vertex_declaration
(
device
->
wined3d_device
,
ddraw_find_decl
(
device
->
ddraw
,
fvf
));
wined3d_device_set_primitive_type
(
device
->
wined3d_device
,
primitive_type
);
hr
=
wined3d_device_draw_primitive_up
(
device
->
wined3d_device
,
vertex_count
,
vertices
,
stride
);
wined3d_mutex_unlock
();
...
...
@@ -3518,14 +3510,7 @@ static HRESULT d3d_device7_DrawIndexedPrimitive(IDirect3DDevice7 *iface,
/* Set the D3DDevice's FVF */
wined3d_mutex_lock
();
hr
=
wined3d_device_set_vertex_declaration
(
device
->
wined3d_device
,
ddraw_find_decl
(
device
->
ddraw
,
fvf
));
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to set vertex declaration, hr %#x.
\n
"
,
hr
);
wined3d_mutex_unlock
();
return
hr
;
}
wined3d_device_set_vertex_declaration
(
device
->
wined3d_device
,
ddraw_find_decl
(
device
->
ddraw
,
fvf
));
wined3d_device_set_primitive_type
(
device
->
wined3d_device
,
primitive_type
);
hr
=
wined3d_device_draw_indexed_primitive_up
(
device
->
wined3d_device
,
index_count
,
indices
,
WINED3DFMT_R16_UINT
,
vertices
,
get_flexible_vertex_size
(
fvf
));
...
...
@@ -3992,15 +3977,7 @@ static HRESULT d3d_device7_DrawPrimitiveVB(IDirect3DDevice7 *iface, D3DPRIMITIVE
stride
=
get_flexible_vertex_size
(
vb
->
fvf
);
wined3d_mutex_lock
();
hr
=
wined3d_device_set_vertex_declaration
(
device
->
wined3d_device
,
vb
->
wineD3DVertexDeclaration
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to set vertex declaration, hr %#x.
\n
"
,
hr
);
wined3d_mutex_unlock
();
return
hr
;
}
/* Set the vertex stream source */
wined3d_device_set_vertex_declaration
(
device
->
wined3d_device
,
vb
->
wineD3DVertexDeclaration
);
hr
=
wined3d_device_set_stream_source
(
device
->
wined3d_device
,
0
,
vb
->
wineD3DVertexBuffer
,
0
,
stride
);
if
(
FAILED
(
hr
))
{
...
...
@@ -4091,13 +4068,7 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
wined3d_mutex_lock
();
hr
=
wined3d_device_set_vertex_declaration
(
This
->
wined3d_device
,
vb
->
wineD3DVertexDeclaration
);
if
(
FAILED
(
hr
))
{
ERR
(
" (%p) Setting the FVF failed, hr = %x!
\n
"
,
This
,
hr
);
wined3d_mutex_unlock
();
return
hr
;
}
wined3d_device_set_vertex_declaration
(
This
->
wined3d_device
,
vb
->
wineD3DVertexDeclaration
);
/* check that the buffer is large enough to hold the indices,
* reallocate if necessary. */
...
...
dlls/wined3d/device.c
View file @
01918d05
...
...
@@ -2411,7 +2411,7 @@ void CDECL wined3d_device_get_scissor_rect(const struct wined3d_device *device,
TRACE
(
"Returning rect %s.
\n
"
,
wine_dbgstr_rect
(
rect
));
}
HRESULT
CDECL
wined3d_device_set_vertex_declaration
(
struct
wined3d_device
*
device
,
void
CDECL
wined3d_device_set_vertex_declaration
(
struct
wined3d_device
*
device
,
struct
wined3d_vertex_declaration
*
declaration
)
{
struct
wined3d_vertex_declaration
*
prev
=
device
->
updateStateBlock
->
state
.
vertex_declaration
;
...
...
@@ -2429,17 +2429,17 @@ HRESULT CDECL wined3d_device_set_vertex_declaration(struct wined3d_device *devic
if
(
device
->
isRecordingState
)
{
TRACE
(
"Recording... not performing anything.
\n
"
);
return
WINED3D_OK
;
return
;
}
else
if
(
declaration
==
prev
)
if
(
declaration
==
prev
)
{
/* Checked after the assignment to allow proper stateblock recording. */
TRACE
(
"Application is setting the old declaration over, nothing to do.
\n
"
);
return
WINED3D_OK
;
return
;
}
device_invalidate_state
(
device
,
STATE_VDECL
);
return
WINED3D_OK
;
}
HRESULT
CDECL
wined3d_device_get_vertex_declaration
(
const
struct
wined3d_device
*
device
,
...
...
include/wine/wined3d.h
View file @
01918d05
...
...
@@ -2235,7 +2235,7 @@ HRESULT __cdecl wined3d_device_set_texture_stage_state(struct wined3d_device *de
UINT
stage
,
enum
wined3d_texture_stage_state
state
,
DWORD
value
);
void
__cdecl
wined3d_device_set_transform
(
struct
wined3d_device
*
device
,
enum
wined3d_transform_state
state
,
const
struct
wined3d_matrix
*
matrix
);
HRESULT
__cdecl
wined3d_device_set_vertex_declaration
(
struct
wined3d_device
*
device
,
void
__cdecl
wined3d_device_set_vertex_declaration
(
struct
wined3d_device
*
device
,
struct
wined3d_vertex_declaration
*
declaration
);
HRESULT
__cdecl
wined3d_device_set_vertex_shader
(
struct
wined3d_device
*
device
,
struct
wined3d_shader
*
shader
);
void
__cdecl
wined3d_device_set_viewport
(
struct
wined3d_device
*
device
,
const
struct
wined3d_viewport
*
viewport
);
...
...
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