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
0c2fcf2e
Commit
0c2fcf2e
authored
Sep 21, 2005
by
Oliver Stieber
Committed by
Alexandre Julliard
Sep 21, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for state management of vertex shader constants via
stateblocks.
parent
489c6b38
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
136 additions
and
65 deletions
+136
-65
device.c
dlls/wined3d/device.c
+93
-57
stateblock.c
dlls/wined3d/stateblock.c
+34
-7
wined3d_private.h
dlls/wined3d/wined3d_private.h
+9
-1
No files found.
dlls/wined3d/device.c
View file @
0c2fcf2e
This diff is collapsed.
Click to expand it.
dlls/wined3d/stateblock.c
View file @
0c2fcf2e
...
...
@@ -157,7 +157,22 @@ HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface){
TRACE
(
"Updating vertex shader to %p
\n
"
,
targetStateBlock
->
vertexShader
);
}
/* TODO: Vertex Shader Constants */
/* Vertex Shader Constants */
for
(
i
=
0
;
i
<
MAX_VSHADER_CONSTANTS
;
++
i
)
{
if
(
This
->
set
.
vertexShaderConstants
[
i
])
{
TRACE
(
"Setting %p from %p %d to %f
\n
"
,
This
,
targetStateBlock
,
i
,
targetStateBlock
->
vertexShaderConstantF
[
i
*
4
+
1
]);
This
->
vertexShaderConstantB
[
i
]
=
targetStateBlock
->
vertexShaderConstantB
[
i
];
This
->
vertexShaderConstantF
[
i
*
4
]
=
targetStateBlock
->
vertexShaderConstantF
[
i
*
4
];
This
->
vertexShaderConstantF
[
i
*
4
+
1
]
=
targetStateBlock
->
vertexShaderConstantF
[
i
*
4
+
1
];
This
->
vertexShaderConstantF
[
i
*
4
+
2
]
=
targetStateBlock
->
vertexShaderConstantF
[
i
*
4
+
2
];
This
->
vertexShaderConstantF
[
i
*
4
+
3
]
=
targetStateBlock
->
vertexShaderConstantF
[
i
*
4
+
3
];
This
->
vertexShaderConstantI
[
i
*
4
]
=
targetStateBlock
->
vertexShaderConstantI
[
i
*
4
];
This
->
vertexShaderConstantI
[
i
*
4
+
1
]
=
targetStateBlock
->
vertexShaderConstantI
[
i
*
4
+
1
];
This
->
vertexShaderConstantI
[
i
*
4
+
2
]
=
targetStateBlock
->
vertexShaderConstantI
[
i
*
4
+
2
];
This
->
vertexShaderConstantI
[
i
*
4
+
3
]
=
targetStateBlock
->
vertexShaderConstantI
[
i
*
4
+
3
];
This
->
vertexShaderConstantT
[
i
]
=
targetStateBlock
->
vertexShaderConstantT
[
i
];
}
}
/* Lights... For a recorded state block, we just had a chain of actions to perform,
so we need to walk that chain and update any actions which differ */
...
...
@@ -346,14 +361,26 @@ should really perform a delta so that only the changes get updated*/
toDo
=
toDo
->
next
;
}
/* Vertex Shader */
if
(
This
->
set
.
vertexShader
&&
This
->
changed
.
vertexShader
)
{
IWineD3DDevice_SetVertexShader
(
pDevice
,
This
->
vertexShader
);
/* TODO: Vertex Shader Constants */
#if 0 /* FIXME: This isn't the correct place to set vs constants (The Fur demo fails) */
IWineD3DDevice_SetVertexShaderConstantB(pDevice, 0 , This->vertexShaderConstantB , MAX_VSHADER_CONSTANTS);
IWineD3DDevice_SetVertexShaderConstantI(pDevice, 0 , This->vertexShaderConstantI , MAX_VSHADER_CONSTANTS);
IWineD3DDevice_SetVertexShaderConstantF(pDevice, 0 , This->vertexShaderConstantF , MAX_VSHADER_CONSTANTS);
#endif
}
/* Vertex Shader Constants */
for
(
i
=
0
;
i
<
MAX_VSHADER_CONSTANTS
;
++
i
)
{
if
(
This
->
set
.
vertexShaderConstants
[
i
]
&&
This
->
changed
.
vertexShaderConstants
[
i
])
{
switch
(
This
->
vertexShaderConstantT
[
i
])
{
case
WINESHADERCNST_FLOAT
:
IWineD3DDevice_SetVertexShaderConstantF
(
pDevice
,
i
,
This
->
vertexShaderConstantF
+
i
*
4
,
1
);
break
;
case
WINESHADERCNST_BOOL
:
IWineD3DDevice_SetVertexShaderConstantB
(
pDevice
,
i
,
This
->
vertexShaderConstantB
+
i
,
1
);
break
;
case
WINESHADERCNST_INTEGER
:
IWineD3DDevice_SetVertexShaderConstantI
(
pDevice
,
i
,
This
->
vertexShaderConstantI
+
i
*
4
,
1
);
break
;
}
}
}
}
...
...
dlls/wined3d/wined3d_private.h
View file @
0c2fcf2e
...
...
@@ -866,8 +866,15 @@ typedef struct SAVEDSTATES {
BOOL
vertexDecl
;
BOOL
pixelShader
;
BOOL
vertexShader
;
BOOL
vertexShaderConstants
[
MAX_VSHADER_CONSTANTS
];
}
SAVEDSTATES
;
typedef
enum
{
WINESHADERCNST_FLOAT
=
0
,
WINESHADERCNST_INTEGER
=
1
,
WINESHADERCNST_BOOL
=
2
}
WINESHADERCNST
;
struct
IWineD3DStateBlockImpl
{
/* IUnknown fields */
...
...
@@ -894,8 +901,9 @@ struct IWineD3DStateBlockImpl
BOOL
vertexShaderConstantB
[
MAX_VSHADER_CONSTANTS
];
INT
vertexShaderConstantI
[
MAX_VSHADER_CONSTANTS
*
4
];
float
vertexShaderConstantF
[
MAX_VSHADER_CONSTANTS
*
4
];
WINESHADERCNST
vertexShaderConstantT
[
MAX_VSHADER_CONSTANTS
];
/* TODO: Think about changing this to a char to possibly save a little memory */
BOOL
softwareVertexProcessing
;
BOOL
softwareVertexProcessing
;
/* Stream Source */
BOOL
streamIsUP
;
...
...
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