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
438c1728
Commit
438c1728
authored
Jan 02, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 03, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move decoding the vertex declaration to the vertexshader state handler.
parent
04ce1419
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
41 deletions
+46
-41
drawprim.c
dlls/wined3d/drawprim.c
+2
-39
state.c
dlls/wined3d/state.c
+43
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/drawprim.c
View file @
438c1728
...
@@ -1943,7 +1943,7 @@ void drawPrimitive(IWineD3DDevice *iface,
...
@@ -1943,7 +1943,7 @@ void drawPrimitive(IWineD3DDevice *iface,
BOOL
usePixelShaderFunction
=
FALSE
;
BOOL
usePixelShaderFunction
=
FALSE
;
IWineD3DSwapChainImpl
*
swapchain
;
IWineD3DSwapChainImpl
*
swapchain
;
int
i
;
int
i
;
BOOL
fixup
=
FALSE
;
BOOL
fixup
;
DWORD
dirtyState
,
idx
;
DWORD
dirtyState
,
idx
;
BYTE
shift
;
BYTE
shift
;
...
@@ -1980,6 +1980,7 @@ void drawPrimitive(IWineD3DDevice *iface,
...
@@ -1980,6 +1980,7 @@ void drawPrimitive(IWineD3DDevice *iface,
StateTable
[
dirtyState
].
apply
(
dirtyState
,
This
->
stateBlock
);
StateTable
[
dirtyState
].
apply
(
dirtyState
,
This
->
stateBlock
);
}
}
This
->
numDirtyEntries
=
0
;
/* This makes the whole list clean */
This
->
numDirtyEntries
=
0
;
/* This makes the whole list clean */
fixup
=
This
->
streamFixedUp
;
if
(
TRACE_ON
(
d3d_draw
)
&&
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
if
(
TRACE_ON
(
d3d_draw
)
&&
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
check_fbo_status
(
iface
);
check_fbo_status
(
iface
);
...
@@ -1990,44 +1991,6 @@ void drawPrimitive(IWineD3DDevice *iface,
...
@@ -1990,44 +1991,6 @@ void drawPrimitive(IWineD3DDevice *iface,
}
}
This
->
depth_copy_state
=
WINED3D_DCS_INITIAL
;
This
->
depth_copy_state
=
WINED3D_DCS_INITIAL
;
if
(
This
->
up_strided
)
{
/* Note: this is a ddraw fixed-function code path */
TRACE
(
"================ Strided Input ===================
\n
"
);
memcpy
(
&
This
->
strided_streams
,
This
->
up_strided
,
sizeof
(
This
->
strided_streams
));
drawPrimitiveTraceDataLocations
(
&
This
->
strided_streams
);
fixup
=
FALSE
;
}
else
if
(
This
->
stateBlock
->
vertexDecl
||
This
->
stateBlock
->
vertexShader
)
{
/* Note: This is a fixed function or shader codepath.
* This means it must handle both types of strided data.
* Shaders must go through here to zero the strided data, even if they
* don't set any declaration at all */
TRACE
(
"================ Vertex Declaration ===================
\n
"
);
memset
(
&
This
->
strided_streams
,
0
,
sizeof
(
This
->
strided_streams
));
if
(
This
->
stateBlock
->
vertexDecl
!=
NULL
||
((
IWineD3DVertexShaderImpl
*
)
This
->
stateBlock
->
vertexShader
)
->
vertexDeclaration
!=
NULL
)
primitiveDeclarationConvertToStridedData
(
iface
,
useVertexShaderFunction
,
&
This
->
strided_streams
,
&
fixup
);
}
else
{
/* Note: This codepath is not reachable from d3d9 (see fvf->decl9 conversion)
* It is reachable through d3d8, but only for fixed-function.
* It will not work properly for shaders. */
TRACE
(
"================ FVF ===================
\n
"
);
memset
(
&
This
->
strided_streams
,
0
,
sizeof
(
This
->
strided_streams
));
primitiveConvertToStridedData
(
iface
,
&
This
->
strided_streams
,
&
fixup
);
drawPrimitiveTraceDataLocations
(
&
This
->
strided_streams
);
}
/* Setup transform matrices and sort out */
/* Setup transform matrices and sort out */
primitiveInitState
(
iface
,
&
This
->
strided_streams
,
useVertexShaderFunction
,
&
lighting_changed
,
&
lighting_original
);
primitiveInitState
(
iface
,
&
This
->
strided_streams
,
useVertexShaderFunction
,
&
lighting_changed
,
&
lighting_original
);
...
...
dlls/wined3d/state.c
View file @
438c1728
...
@@ -1857,8 +1857,49 @@ static void transform_worldex(DWORD state, IWineD3DStateBlockImpl *stateBlock) {
...
@@ -1857,8 +1857,49 @@ static void transform_worldex(DWORD state, IWineD3DStateBlockImpl *stateBlock) {
WARN
(
"World matrix 1 - 255 not supported yet
\n
"
);
WARN
(
"World matrix 1 - 255 not supported yet
\n
"
);
}
}
static
void
vertexdeclaration
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateBlock
)
{
static
void
vertexdeclaration
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
)
{
TRACE
(
"To be filled later
\n
"
);
BOOL
useVertexShaderFunction
=
FALSE
;
stateblock
->
wineD3DDevice
->
streamFixedUp
=
FALSE
;
/* Shaders can be implemented using ARB_PROGRAM, GLSL, or software -
* here simply check whether a shader was set, or the user disabled shaders
*/
if
(
stateblock
->
wineD3DDevice
->
vs_selected_mode
!=
SHADER_NONE
&&
stateblock
->
vertexShader
&&
((
IWineD3DVertexShaderImpl
*
)
stateblock
->
vertexShader
)
->
baseShader
.
function
!=
NULL
)
useVertexShaderFunction
=
TRUE
;
if
(
stateblock
->
wineD3DDevice
->
up_strided
)
{
/* Note: this is a ddraw fixed-function code path */
TRACE
(
"================ Strided Input ===================
\n
"
);
memcpy
(
&
stateblock
->
wineD3DDevice
->
strided_streams
,
stateblock
->
wineD3DDevice
->
up_strided
,
sizeof
(
stateblock
->
wineD3DDevice
->
strided_streams
));
stateblock
->
wineD3DDevice
->
streamFixedUp
=
FALSE
;
}
else
if
(
stateblock
->
vertexDecl
||
stateblock
->
vertexShader
)
{
/* Note: This is a fixed function or shader codepath.
* This means it must handle both types of strided data.
* Shaders must go through here to zero the strided data, even if they
* don't set any declaration at all
*/
TRACE
(
"================ Vertex Declaration ===================
\n
"
);
memset
(
&
stateblock
->
wineD3DDevice
->
strided_streams
,
0
,
sizeof
(
stateblock
->
wineD3DDevice
->
strided_streams
));
if
(
stateblock
->
vertexDecl
!=
NULL
||
((
IWineD3DVertexShaderImpl
*
)
stateblock
->
vertexShader
)
->
vertexDeclaration
!=
NULL
)
{
primitiveDeclarationConvertToStridedData
((
IWineD3DDevice
*
)
stateblock
->
wineD3DDevice
,
useVertexShaderFunction
,
&
stateblock
->
wineD3DDevice
->
strided_streams
,
&
stateblock
->
wineD3DDevice
->
streamFixedUp
);
}
}
else
{
/* Note: This codepath is not reachable from d3d9 (see fvf->decl9 conversion)
* It is reachable through d3d8, but only for fixed-function.
* It will not work properly for shaders.
*/
TRACE
(
"================ FVF ===================
\n
"
);
memset
(
&
stateblock
->
wineD3DDevice
->
strided_streams
,
0
,
sizeof
(
stateblock
->
wineD3DDevice
->
strided_streams
));
primitiveConvertToStridedData
((
IWineD3DDevice
*
)
stateblock
->
wineD3DDevice
,
&
stateblock
->
wineD3DDevice
->
strided_streams
,
&
stateblock
->
wineD3DDevice
->
streamFixedUp
);
}
}
}
const
struct
StateEntry
StateTable
[]
=
const
struct
StateEntry
StateTable
[]
=
...
...
dlls/wined3d/wined3d_private.h
View file @
438c1728
...
@@ -669,6 +669,7 @@ typedef struct IWineD3DDeviceImpl
...
@@ -669,6 +669,7 @@ typedef struct IWineD3DDeviceImpl
/* Stream source management */
/* Stream source management */
WineDirect3DVertexStridedData
strided_streams
;
WineDirect3DVertexStridedData
strided_streams
;
WineDirect3DVertexStridedData
*
up_strided
;
WineDirect3DVertexStridedData
*
up_strided
;
BOOL
streamFixedUp
;
}
IWineD3DDeviceImpl
;
}
IWineD3DDeviceImpl
;
...
...
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