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
6a97f220
Commit
6a97f220
authored
Jul 17, 2006
by
Jason Green
Committed by
Alexandre Julliard
Jul 17, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Fix for vertex shaders.
parent
d51faa74
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
4 deletions
+35
-4
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+1
-1
baseshader.c
dlls/wined3d/baseshader.c
+3
-0
drawprim.c
dlls/wined3d/drawprim.c
+11
-2
vertexshader.c
dlls/wined3d/vertexshader.c
+15
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+5
-1
No files found.
dlls/wined3d/arb_program_shader.c
View file @
6a97f220
...
...
@@ -339,7 +339,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"
,
"
result.fogcoord
"
,
"result.pointsize"
};
static
const
char
*
hwrastout_reg_names
[]
=
{
"result.position"
,
"
TMP_FOG
"
,
"result.pointsize"
};
DWORD
reg
=
param
&
D3DSP_REGNUM_MASK
;
DWORD
regtype
=
shader_get_regtype
(
param
);
...
...
dlls/wined3d/baseshader.c
View file @
6a97f220
...
...
@@ -343,6 +343,9 @@ HRESULT shader_get_registers_used(
else
if
(
D3DSPR_INPUT
==
regtype
&&
!
pshader
)
reg_maps
->
attributes
[
reg
]
=
1
;
else
if
(
D3DSPR_RASTOUT
==
regtype
&&
reg
==
1
)
reg_maps
->
fog
=
1
;
}
}
}
...
...
dlls/wined3d/drawprim.c
View file @
6a97f220
...
...
@@ -327,8 +327,17 @@ static void primitiveInitState(
}
This
->
last_was_rhw
=
FALSE
;
/* Restore fogging */
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGENABLE
]
&&
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGVERTEXMODE
]
!=
D3DFOG_NONE
)
{
/* Setup fogging */
if
(
useVS
&&
((
IWineD3DVertexShaderImpl
*
)
This
->
stateBlock
->
vertexShader
)
->
usesFog
)
{
/* In D3D vertex shader return the 'final' fog value, while in OpenGL it is the 'input' fog value.
* The code below 'disables' the OpenGL postprocessing by setting the formula to '1'. */
glFogi
(
GL_FOG_MODE
,
GL_LINEAR
);
glFogf
(
GL_FOG_START
,
1
.
0
f
);
glFogf
(
GL_FOG_END
,
0
.
0
f
);
}
else
if
(
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGENABLE
]
&&
This
->
stateBlock
->
renderState
[
WINED3DRS_FOGVERTEXMODE
]
!=
D3DFOG_NONE
)
{
if
(
GL_SUPPORT
(
EXT_FOG_COORD
))
{
glFogi
(
GL_FOG_COORDINATE_SOURCE_EXT
,
GL_FRAGMENT_DEPTH_EXT
);
checkGLcall
(
"glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT)
\n
"
);
...
...
dlls/wined3d/vertexshader.c
View file @
6a97f220
...
...
@@ -712,6 +712,12 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader(
if
(
This
->
baseShader
.
hex_version
>=
D3DVS_VERSION
(
3
,
0
))
vshader_glsl_output_unpack
(
&
buffer
,
This
->
semantics_out
);
/* Clamp the fog from 0 to 1 if it's used */
if
(
reg_maps
->
fog
)
{
This
->
usesFog
=
1
;
shader_addline
(
&
buffer
,
"gl_FogFragCoord = clamp(gl_FogFragCoord, 0.0, 1.0);
\n
"
);
}
shader_addline
(
&
buffer
,
"}
\n\0
"
);
TRACE
(
"Compiling shader object %u
\n
"
,
shader_obj
);
...
...
@@ -735,9 +741,18 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader(
/* Base Declarations */
shader_generate_arb_declarations
(
(
IWineD3DBaseShader
*
)
This
,
reg_maps
,
&
buffer
);
if
(
reg_maps
->
fog
)
{
This
->
usesFog
=
1
;
shader_addline
(
&
buffer
,
"TEMP TMP_FOG;
\n
"
);
}
/* Base Shader Body */
shader_generate_main
(
(
IWineD3DBaseShader
*
)
This
,
&
buffer
,
reg_maps
,
pFunction
);
/* Make sure the fog value is positive - values above 1.0 are ignored */
if
(
reg_maps
->
fog
)
shader_addline
(
&
buffer
,
"MAX result.fogcoord, TMP_FOG, 0.0;
\n
"
);
shader_addline
(
&
buffer
,
"END
\n\0
"
);
/* TODO: change to resource.glObjectHandle or something like that */
...
...
dlls/wined3d/wined3d_private.h
View file @
6a97f220
...
...
@@ -1314,6 +1314,9 @@ typedef struct shader_reg_maps {
/* Whether or not a loop is used in this shader */
char
loop
;
/* Whether or not this shader uses fog */
char
fog
;
}
shader_reg_maps
;
#define SHADER_PGMSIZE 65535
...
...
@@ -1608,7 +1611,8 @@ typedef struct IWineD3DVertexShaderImpl {
IUnknown
*
parent
;
IWineD3DDeviceImpl
*
wineD3DDevice
;
DWORD
usage
;
char
usesFog
;
DWORD
usage
;
/* Vertex shader input and output semantics */
semantic
semantics_in
[
MAX_ATTRIBS
];
...
...
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