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
1b2f9d29
Commit
1b2f9d29
authored
Oct 26, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 26, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of the posFixup field from the device.
parent
ccd4479c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
35 deletions
+30
-35
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+10
-10
device.c
dlls/wined3d/device.c
+0
-1
glsl_shader.c
dlls/wined3d/glsl_shader.c
+3
-1
state.c
dlls/wined3d/state.c
+2
-20
wined3d_private.h
dlls/wined3d/wined3d_private.h
+15
-3
No files found.
dlls/wined3d/arb_program_shader.c
View file @
1b2f9d29
...
...
@@ -590,29 +590,29 @@ static inline void shader_arb_ps_local_constants(IWineD3DDeviceImpl* deviceImpl)
}
/* GL locking is done by the caller. */
static
inline
void
shader_arb_vs_local_constants
(
IWineD3DDeviceImpl
*
deviceImpl
)
static
void
shader_arb_vs_local_constants
(
const
struct
wined3d_context
*
context
,
IWineD3DDeviceImpl
*
deviceImpl
)
{
IWineD3DStateBlockImpl
*
stateBlock
;
const
struct
wined3d_gl_info
*
gl_info
=
&
deviceImpl
->
adapter
->
gl_info
;
const
struct
wined3d_state
*
state
=
&
deviceImpl
->
stateBlock
->
state
;
unsigned
char
i
;
struct
shader_arb_priv
*
priv
=
deviceImpl
->
shader_priv
;
const
struct
arb_vs_compiled_shader
*
gl_shader
=
priv
->
compiled_vprog
;
float
position_fixup
[
4
];
/* Upload the position fixup */
GL_EXTCALL
(
glProgramLocalParameter4fvARB
(
GL_VERTEX_PROGRAM_ARB
,
gl_shader
->
pos_fixup
,
deviceImpl
->
posFixup
));
shader_get_position_fixup
(
context
,
state
,
position_fixup
);
GL_EXTCALL
(
glProgramLocalParameter4fvARB
(
GL_VERTEX_PROGRAM_ARB
,
gl_shader
->
pos_fixup
,
position_fixup
));
if
(
!
gl_shader
->
num_int_consts
)
return
;
stateBlock
=
deviceImpl
->
stateBlock
;
for
(
i
=
0
;
i
<
MAX_CONST_I
;
i
++
)
{
if
(
gl_shader
->
int_consts
[
i
]
!=
WINED3D_CONST_NUM_UNUSED
)
{
float
val
[
4
];
val
[
0
]
=
(
float
)
state
Block
->
state
.
vs_consts_i
[
4
*
i
];
val
[
1
]
=
(
float
)
state
Block
->
state
.
vs_consts_i
[
4
*
i
+
1
];
val
[
2
]
=
(
float
)
state
Block
->
state
.
vs_consts_i
[
4
*
i
+
2
];
val
[
0
]
=
(
float
)
state
->
vs_consts_i
[
4
*
i
];
val
[
1
]
=
(
float
)
state
->
vs_consts_i
[
4
*
i
+
1
];
val
[
2
]
=
(
float
)
state
->
vs_consts_i
[
4
*
i
+
2
];
val
[
3
]
=
-
1
.
0
f
;
GL_EXTCALL
(
glProgramLocalParameter4fvARB
(
GL_VERTEX_PROGRAM_ARB
,
gl_shader
->
int_consts
[
i
],
val
));
...
...
@@ -641,7 +641,7 @@ static void shader_arb_load_constants(const struct wined3d_context *context, cha
/* Load DirectX 9 float constants for vertex shader */
device
->
highest_dirty_vs_const
=
shader_arb_load_constantsF
(
vshader
,
gl_info
,
GL_VERTEX_PROGRAM_ARB
,
device
->
highest_dirty_vs_const
,
stateBlock
->
state
.
vs_consts_f
,
context
->
vshader_const_dirty
);
shader_arb_vs_local_constants
(
device
);
shader_arb_vs_local_constants
(
context
,
device
);
}
if
(
usePixelShader
)
...
...
@@ -4601,7 +4601,7 @@ static void shader_arb_select(const struct wined3d_context *context, BOOL usePS,
glEnable
(
GL_VERTEX_PROGRAM_ARB
);
checkGLcall
(
"glEnable(GL_VERTEX_PROGRAM_ARB);"
);
TRACE
(
"(%p) : Bound vertex program %u and enabled GL_VERTEX_PROGRAM_ARB
\n
"
,
This
,
priv
->
current_vprogram_id
);
shader_arb_vs_local_constants
(
This
);
shader_arb_vs_local_constants
(
context
,
This
);
if
(
priv
->
last_vs_color_unclamp
!=
compiled
->
need_color_unclamp
)
{
priv
->
last_vs_color_unclamp
=
compiled
->
need_color_unclamp
;
...
...
dlls/wined3d/device.c
View file @
1b2f9d29
...
...
@@ -6827,7 +6827,6 @@ HRESULT device_init(IWineD3DDeviceImpl *device, IWineD3DImpl *wined3d,
list_init
(
&
device
->
shaders
);
device
->
surface_alignment
=
wined3d
->
dxVersion
==
7
?
DDRAW_PITCH_ALIGNMENT
:
D3D8_PITCH_ALIGNMENT
;
device
->
posFixup
[
0
]
=
1
.
0
f
;
/* This is needed to get the x coord unmodified through a MAD. */
/* Get the initial screen setup for ddraw. */
hr
=
IWineD3D_GetAdapterDisplayMode
((
IWineD3D
*
)
wined3d
,
adapter_idx
,
&
mode
);
...
...
dlls/wined3d/glsl_shader.c
View file @
1b2f9d29
...
...
@@ -733,6 +733,7 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
IWineD3DDeviceImpl
*
device
=
context
->
swapchain
->
device
;
IWineD3DStateBlockImpl
*
stateBlock
=
device
->
stateBlock
;
struct
shader_glsl_priv
*
priv
=
device
->
shader_priv
;
float
position_fixup
[
4
];
GLhandleARB
programId
;
struct
glsl_shader_prog_link
*
prog
=
priv
->
glsl_program
;
...
...
@@ -763,7 +764,8 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
stateBlock
->
changed
.
vertexShaderConstantsB
&
vshader
->
baseShader
.
reg_maps
.
boolean_constants
);
/* Upload the position fixup params */
GL_EXTCALL
(
glUniform4fvARB
(
prog
->
posFixup_location
,
1
,
&
device
->
posFixup
[
0
]));
shader_get_position_fixup
(
context
,
&
stateBlock
->
state
,
position_fixup
);
GL_EXTCALL
(
glUniform4fvARB
(
prog
->
posFixup_location
,
1
,
position_fixup
));
checkGLcall
(
"glUniform4fvARB"
);
}
...
...
dlls/wined3d/state.c
View file @
1b2f9d29
...
...
@@ -4644,20 +4644,6 @@ static void vertexdeclaration(DWORD state_id, IWineD3DStateBlockImpl *stateblock
context
->
last_was_rhw
=
FALSE
;
/* This turns off the Z scale trick to 'disable' viewport frustum clipping in rhw mode*/
device
->
untransformed
=
TRUE
;
/* Todo for sw shaders: Vertex Shader output is already transformed, so set up identity matrices
* Not needed as long as only hw shaders are supported
*/
/* This sets the shader output position correction constants.
* TODO: Move to the viewport state
*/
if
(
useVertexShaderFunction
)
{
GLfloat
yoffset
=
-
(
63
.
0
f
/
64
.
0
f
)
/
stateblock
->
state
.
viewport
.
Height
;
device
->
posFixup
[
1
]
=
context
->
render_offscreen
?
-
1
.
0
f
:
1
.
0
f
;
device
->
posFixup
[
3
]
=
device
->
posFixup
[
1
]
*
yoffset
;
}
}
/* Don't have to apply the matrices when vertex shaders are used. When vshaders are turned
...
...
@@ -4803,19 +4789,15 @@ static void viewport_miscpart(DWORD state, IWineD3DStateBlockImpl *stateblock, s
checkGLcall
(
"glViewport"
);
}
static
void
viewport_vertexpart
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
viewport_vertexpart
(
DWORD
state
_id
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
GLfloat
yoffset
=
-
(
63
.
0
f
/
64
.
0
f
)
/
stateblock
->
state
.
viewport
.
Height
;
stateblock
->
device
->
posFixup
[
2
]
=
(
63
.
0
f
/
64
.
0
f
)
/
stateblock
->
state
.
viewport
.
Width
;
stateblock
->
device
->
posFixup
[
3
]
=
stateblock
->
device
->
posFixup
[
1
]
*
yoffset
;
if
(
!
isStateDirty
(
context
,
STATE_TRANSFORM
(
WINED3DTS_PROJECTION
)))
{
transform_projection
(
STATE_TRANSFORM
(
WINED3DTS_PROJECTION
),
stateblock
,
context
);
}
if
(
!
isStateDirty
(
context
,
STATE_RENDER
(
WINED3DRS_POINTSCALEENABLE
)))
{
state_pscale
(
STATE_RENDER
(
WINED3DRS_POINTSCALEENABLE
),
stateblock
,
context
);
}
/* Update the position fixup. */
if
(
!
isStateDirty
(
context
,
STATE_VERTEXSHADERCONSTANT
))
shaderconstant
(
STATE_VERTEXSHADERCONSTANT
,
stateblock
,
context
);
}
...
...
dlls/wined3d/wined3d_private.h
View file @
1b2f9d29
...
...
@@ -1722,9 +1722,6 @@ struct IWineD3DDeviceImpl
DWORD
ddraw_width
,
ddraw_height
;
enum
wined3d_format_id
ddraw_format
;
/* Final position fixup constant */
float
posFixup
[
4
];
/* With register combiners we can skip junk texture stages */
DWORD
texUnitMap
[
MAX_COMBINED_SAMPLERS
];
DWORD
rev_tex_unit_map
[
MAX_COMBINED_SAMPLERS
];
...
...
@@ -2841,6 +2838,21 @@ static inline BOOL shader_is_scalar(const struct wined3d_shader_register *reg)
}
}
static
inline
void
shader_get_position_fixup
(
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
float
*
position_fixup
)
{
position_fixup
[
0
]
=
1
.
0
f
;
position_fixup
[
1
]
=
1
.
0
f
;
position_fixup
[
2
]
=
(
63
.
0
f
/
64
.
0
f
)
/
state
->
viewport
.
Width
;
position_fixup
[
3
]
=
-
(
63
.
0
f
/
64
.
0
f
)
/
state
->
viewport
.
Height
;
if
(
context
->
render_offscreen
)
{
position_fixup
[
1
]
*=
-
1
.
0
f
;
position_fixup
[
3
]
*=
-
1
.
0
f
;
}
}
static
inline
BOOL
shader_constant_is_local
(
IWineD3DBaseShaderImpl
*
This
,
DWORD
reg
)
{
local_constant
*
lconst
;
...
...
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