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
46c4b88b
Commit
46c4b88b
authored
Jul 26, 2006
by
Jason Green
Committed by
Alexandre Julliard
Jul 27, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Fix some upside-down rendering issues for shaders.
parent
3127d640
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
6 deletions
+20
-6
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+5
-1
directx.c
dlls/wined3d/directx.c
+4
-2
drawprim.c
dlls/wined3d/drawprim.c
+0
-3
vertexshader.c
dlls/wined3d/vertexshader.c
+11
-0
No files found.
dlls/wined3d/arb_program_shader.c
View file @
46c4b88b
...
...
@@ -144,6 +144,9 @@ void shader_generate_arb_declarations(
unsigned
max_constantsF
=
min
(
This
->
baseShader
.
limits
.
constant_float
,
(
pshader
?
GL_LIMITS
(
pshader_constantsF
)
:
GL_LIMITS
(
vshader_constantsF
)));
/* Temporary Output register */
shader_addline
(
buffer
,
"TEMP TMP_OUT;
\n
"
);
for
(
i
=
0
;
i
<
This
->
baseShader
.
limits
.
temporary
;
i
++
)
{
if
(
reg_maps
->
temporary
[
i
])
shader_addline
(
buffer
,
"TEMP R%lu;
\n
"
,
i
);
...
...
@@ -168,6 +171,7 @@ void shader_generate_arb_declarations(
/* Need to PARAM the environment parameters (constants) so we can use relative addressing */
shader_addline
(
buffer
,
"PARAM C[%d] = { program.env[0..%d] };
\n
"
,
max_constantsF
,
max_constantsF
-
1
);
shader_addline
(
buffer
,
"PARAM PROJECTION = state.matrix.projection.row[1];
\n
"
);
}
static
const
char
*
shift_tab
[]
=
{
...
...
@@ -344,7 +348,7 @@ static void vshader_program_add_param(SHADER_OPCODE_ARG *arg, const DWORD param,
IWineD3DVertexShaderImpl
*
This
=
(
IWineD3DVertexShaderImpl
*
)
arg
->
shader
;
/* oPos, oFog and oPts in D3D */
static
const
char
*
hwrastout_reg_names
[]
=
{
"
result.position
"
,
"TMP_FOG"
,
"result.pointsize"
};
static
const
char
*
hwrastout_reg_names
[]
=
{
"
TMP_OUT
"
,
"TMP_FOG"
,
"result.pointsize"
};
DWORD
reg
=
param
&
D3DSP_REGNUM_MASK
;
DWORD
regtype
=
shader_get_regtype
(
param
);
...
...
dlls/wined3d/directx.c
View file @
46c4b88b
...
...
@@ -247,8 +247,10 @@ void select_shader_max_constants(WineD3D_GL_Info *gl_info) {
gl_info
->
max_vshader_constantsF
=
gl_info
->
vs_glsl_constantsF
-
MAX_CONST_B
-
MAX_CONST_I
;
break
;
case
SHADER_ARB
:
/* ARB shaders seem to have an implicit PARAM when fog is used, so we need to subtract 1 from the total available */
gl_info
->
max_vshader_constantsF
=
gl_info
->
vs_arb_constantsF
-
1
;
/* We have to subtract any other PARAMs that we might use in our shader programs.
* ATI seems to count 2 implicit PARAMs when we use fog and NVIDIA counts 1,
* and we reference one row of the PROJECTION matrix which counts as 1 PARAM. */
gl_info
->
max_vshader_constantsF
=
gl_info
->
vs_arb_constantsF
-
3
;
break
;
case
SHADER_SW
:
gl_info
->
max_vshader_constantsF
=
96
;
/* TODO: Fixup software shaders */
...
...
dlls/wined3d/drawprim.c
View file @
46c4b88b
...
...
@@ -304,9 +304,6 @@ static void primitiveInitState(
}
/* Vertex Shader output is already transformed, so set up identity matrices */
/* FIXME: Actually, only true for software emulated ones, so when h/w ones
come along this needs to take into account whether s/w ones were
requested or not */
if
(
useVS
)
{
glMatrixMode
(
GL_MODELVIEW
);
checkGLcall
(
"glMatrixMode"
);
...
...
dlls/wined3d/vertexshader.c
View file @
46c4b88b
...
...
@@ -718,6 +718,11 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader(
This
->
usesFog
=
1
;
shader_addline
(
&
buffer
,
"gl_FogFragCoord = clamp(gl_FogFragCoord, 0.0, 1.0);
\n
"
);
}
/* Write the final position.
* 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 * gl_ProjectionMatrix[1][1];
\n
"
);
shader_addline
(
&
buffer
,
"}
\n\0
"
);
...
...
@@ -754,6 +759,12 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader(
if
(
reg_maps
->
fog
)
shader_addline
(
&
buffer
,
"MAX result.fogcoord, TMP_FOG, 0.0;
\n
"
);
/* Write the final position.
* 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
,
"MOV result.position, TMP_OUT;
\n
"
);
shader_addline
(
&
buffer
,
"MUL result.position.y, TMP_OUT.y, state.matrix.projection.row[1].y;
\n
"
);
shader_addline
(
&
buffer
,
"END
\n\0
"
);
/* TODO: change to resource.glObjectHandle or something like that */
...
...
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