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
c7c78586
Commit
c7c78586
authored
Nov 02, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Nov 08, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Replace the position fixup mul-add-add with a MAD.
parent
6209b36a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
18 deletions
+13
-18
directx.c
dlls/wined3d/directx.c
+1
-0
vertexshader.c
dlls/wined3d/vertexshader.c
+12
-18
No files found.
dlls/wined3d/directx.c
View file @
c7c78586
...
@@ -2642,6 +2642,7 @@ static HRESULT WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter,
...
@@ -2642,6 +2642,7 @@ static HRESULT WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter,
}
else
{
}
else
{
object
->
surface_alignment
=
4
;
object
->
surface_alignment
=
4
;
}
}
object
->
posFixup
[
0
]
=
1
.
0
;
/* This is needed to get the x coord unmodified through a MAD */
/* Set the state up as invalid until the device is fully created */
/* Set the state up as invalid until the device is fully created */
object
->
state
=
WINED3DERR_DRIVERINTERNALERROR
;
object
->
state
=
WINED3DERR_DRIVERINTERNALERROR
;
...
...
dlls/wined3d/vertexshader.c
View file @
c7c78586
...
@@ -333,20 +333,16 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader(
...
@@ -333,20 +333,16 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader(
/* If this shader doesn't use fog copy the z coord to the fog coord so that we can use table fog */
/* If this shader doesn't use fog copy the z coord to the fog coord so that we can use table fog */
if
(
!
reg_maps
->
fog
)
if
(
!
reg_maps
->
fog
)
shader_addline
(
&
buffer
,
"gl_FogFragCoord = gl_Position.z;
\n
"
);
shader_addline
(
&
buffer
,
"gl_FogFragCoord = gl_Position.z;
\n
"
);
/* Write the final position.
/* Write the final position.
*
*
* OpenGL coordinates specify the center of the pixel while d3d coords specify
* OpenGL coordinates specify the center of the pixel while d3d coords specify
* the corner. The offsets are stored in z and w in the 2nd row of the projection
* the corner. The offsets are stored in z and w in posFixup. posFixup.y contains
* matrix to avoid wasting a free shader constant. Add them to the w and z coord
* 1.0 or -1.0 to turn the rendering upside down for offscreen rendering. PosFixup.x
* of the 2nd row
* contains 1.0 to allow a mad.
*/
shader_addline
(
&
buffer
,
"gl_Position.x = gl_Position.x + posFixup[2];
\n
"
);
shader_addline
(
&
buffer
,
"gl_Position.y = gl_Position.y + posFixup[3];
\n
"
);
/* Account for any inverted textures (render to texture case) by reversing the y coordinate
* (this is handled in drawPrim() when it sets the MODELVIEW and PROJECTION matrices)
*/
*/
shader_addline
(
&
buffer
,
"gl_Position.y = gl_Position.y * posFixup[1];
\n
"
);
shader_addline
(
&
buffer
,
"gl_Position.xy = gl_Position.xy * posFixup.xy + posFixup.zw;
\n
"
);
/* Z coord [0;1]->[-1;1] mapping, see comment in transform_projection in state.c
/* Z coord [0;1]->[-1;1] mapping, see comment in transform_projection in state.c
*
*
* Basically we want(in homogenous coordinates) z = z * 2 - 1. However, shaders are run
* Basically we want(in homogenous coordinates) z = z * 2 - 1. However, shaders are run
...
@@ -399,15 +395,13 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader(
...
@@ -399,15 +395,13 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader(
/* Write the final position.
/* Write the final position.
*
*
* OpenGL coordinates specify the center of the pixel while d3d coords specify
* OpenGL coordinates specify the center of the pixel while d3d coords specify
* the corner. The offsets are stored in the 2nd row of the projection matrix,
* the corner. The offsets are stored in z and w in posFixup. posFixup.y contains
* the x offset in z and the y offset in w. Add them to the resulting position
* 1.0 or -1.0 to turn the rendering upside down for offscreen rendering. PosFixup.x
*/
* contains 1.0 to allow a mad, but arb vs swizzles are too restricted for that.
shader_addline
(
&
buffer
,
"ADD TMP_OUT.x, TMP_OUT.x, posFixup.z;
\n
"
);
shader_addline
(
&
buffer
,
"ADD TMP_OUT.y, TMP_OUT.y, posFixup.w;
\n
"
);
/* Account for any inverted textures (render to texture case) by reversing the y coordinate
* (this is handled in drawPrim() when it sets the MODELVIEW and PROJECTION matrices)
*/
*/
shader_addline
(
&
buffer
,
"MUL TMP_OUT.y, TMP_OUT.y, posFixup.y;
\n
"
);
shader_addline
(
&
buffer
,
"ADD TMP_OUT.x, TMP_OUT.x, posFixup.z;"
);
shader_addline
(
&
buffer
,
"MAD TMP_OUT.y, TMP_OUT.y, posFixup.y, posFixup.w;"
);
/* Z coord [0;1]->[-1;1] mapping, see comment in transform_projection in state.c
/* Z coord [0;1]->[-1;1] mapping, see comment in transform_projection in state.c
* and the glsl equivalent
* and the glsl equivalent
*/
*/
...
...
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