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
1b23dd1b
Commit
1b23dd1b
authored
Nov 06, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Nov 07, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implement the varying map.
parent
409103f8
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
2 deletions
+53
-2
baseshader.c
dlls/wined3d/baseshader.c
+17
-1
glsl_shader.c
dlls/wined3d/glsl_shader.c
+3
-0
pixelshader.c
dlls/wined3d/pixelshader.c
+32
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/baseshader.c
View file @
1b23dd1b
...
...
@@ -422,8 +422,24 @@ HRESULT shader_get_registers_used(
else
if
(
WINED3DSPR_TEMP
==
regtype
)
reg_maps
->
temporary
[
reg
]
=
1
;
else
if
(
WINED3DSPR_INPUT
==
regtype
&&
!
pshader
)
else
if
(
WINED3DSPR_INPUT
==
regtype
)
{
if
(
!
pshader
)
reg_maps
->
attributes
[
reg
]
=
1
;
else
{
if
(
param
&
WINED3DSHADER_ADDRMODE_RELATIVE
)
{
/* If relative addressing is used, we must assume that all registers
* are used. Even if it is a construct like v3[aL], we can't assume
* that v0, v1 and v2 aren't read because aL can be negative
*/
unsigned
int
i
;
for
(
i
=
0
;
i
<
MAX_REG_INPUT
;
i
++
)
{
((
IWineD3DPixelShaderImpl
*
)
This
)
->
input_reg_used
[
i
]
=
TRUE
;
}
}
else
{
((
IWineD3DPixelShaderImpl
*
)
This
)
->
input_reg_used
[
reg
]
=
TRUE
;
}
}
}
else
if
(
WINED3DSPR_RASTOUT
==
regtype
&&
reg
==
1
)
reg_maps
->
fog
=
1
;
...
...
dlls/wined3d/glsl_shader.c
View file @
1b23dd1b
...
...
@@ -2670,6 +2670,9 @@ static void handle_ps3_input(SHADER_BUFFER *buffer, semantic *semantics_in, sema
if
(
map
[
i
]
>=
(
GL_LIMITS
(
glsl_varyings
)
/
4
))
{
FIXME
(
"More input varyings declared than supported, expect issues
\n
"
);
continue
;
}
else
if
(
map
[
i
]
==
-
1
)
{
/* Declared, but not read register */
continue
;
}
register_token
=
semantics_in
[
i
].
reg
;
...
...
dlls/wined3d/pixelshader.c
View file @
1b23dd1b
...
...
@@ -543,7 +543,7 @@ static HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *i
if
(
WINED3DSHADER_VERSION_MAJOR
(
This
->
baseShader
.
hex_version
)
>
1
)
{
shader_reg_maps
*
reg_maps
=
&
This
->
baseShader
.
reg_maps
;
HRESULT
hr
;
unsigned
int
i
;
unsigned
int
i
,
j
,
highest_reg_used
=
0
,
num_regs_used
=
0
;
/* Second pass: figure out which registers are used, what the semantics are, etc.. */
memset
(
reg_maps
,
0
,
sizeof
(
shader_reg_maps
));
...
...
@@ -553,8 +553,39 @@ static HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *i
/* FIXME: validate reg_maps against OpenGL */
for
(
i
=
0
;
i
<
MAX_REG_INPUT
;
i
++
)
{
if
(
This
->
input_reg_used
[
i
])
{
num_regs_used
++
;
highest_reg_used
=
i
;
}
}
/* Don't do any register mapping magic if it is not needed, or if we can't
* achive anything anyway
*/
if
(
highest_reg_used
<
(
GL_LIMITS
(
glsl_varyings
)
/
4
)
||
num_regs_used
>=
(
GL_LIMITS
(
glsl_varyings
)
/
4
)
)
{
if
(
num_regs_used
>=
(
GL_LIMITS
(
glsl_varyings
)
/
4
))
{
/* This happens with relative addressing. The input mapper function
* warns about this if the higher registers are declared too, so
* don't write a FIXME here
*/
WARN
(
"More varying registers used than supported
\n
"
);
}
for
(
i
=
0
;
i
<
MAX_REG_INPUT
;
i
++
)
{
This
->
input_reg_map
[
i
]
=
i
;
}
}
else
{
j
=
0
;
for
(
i
=
0
;
i
<
MAX_REG_INPUT
;
i
++
)
{
if
(
This
->
input_reg_used
[
i
])
{
This
->
input_reg_map
[
i
]
=
j
;
j
++
;
}
else
{
This
->
input_reg_map
[
i
]
=
-
1
;
}
}
}
}
This
->
baseShader
.
shader_mode
=
deviceImpl
->
ps_selected_mode
;
...
...
dlls/wined3d/wined3d_private.h
View file @
1b23dd1b
...
...
@@ -2084,6 +2084,7 @@ typedef struct IWineD3DPixelShaderImpl {
/* Pixel shader input semantics */
semantic
semantics_in
[
MAX_REG_INPUT
];
DWORD
input_reg_map
[
MAX_REG_INPUT
];
BOOL
input_reg_used
[
MAX_REG_INPUT
];
/* run time data */
PSHADERDATA
*
data
;
...
...
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