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
0183f3e3
Commit
0183f3e3
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: Avoid NOP additions.
parent
c7c78586
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
17 deletions
+23
-17
glsl_shader.c
dlls/wined3d/glsl_shader.c
+23
-17
No files found.
dlls/wined3d/glsl_shader.c
View file @
0183f3e3
...
...
@@ -802,8 +802,15 @@ static void shader_glsl_get_register_name(
glsl_src_param_t
rel_param
;
shader_glsl_add_src_param
(
arg
,
addr_token
,
0
,
WINED3DSP_WRITEMASK_0
,
&
rel_param
);
sprintf
(
tmpStr
,
"IN[%s + %u]"
,
rel_param
.
param_str
,
((
IWineD3DPixelShaderImpl
*
)
This
)
->
input_reg_map
[
reg
]);
/* Removing a + 0 would be an obvious optimization, but macos doesn't see the NOP
* operation there
*/
if
(((
IWineD3DPixelShaderImpl
*
)
This
)
->
input_reg_map
[
reg
])
{
sprintf
(
tmpStr
,
"IN[%s + %u]"
,
rel_param
.
param_str
,
((
IWineD3DPixelShaderImpl
*
)
This
)
->
input_reg_map
[
reg
]);
}
else
{
sprintf
(
tmpStr
,
"IN[%s]"
,
rel_param
.
param_str
);
}
}
else
{
sprintf
(
tmpStr
,
"IN[%u]"
,
((
IWineD3DPixelShaderImpl
*
)
This
)
->
input_reg_map
[
reg
]);
...
...
@@ -832,9 +839,18 @@ static void shader_glsl_get_register_name(
if
(
WINED3DSHADER_VERSION_MAJOR
(
This
->
baseShader
.
hex_version
)
>=
2
)
{
glsl_src_param_t
rel_param
;
shader_glsl_add_src_param
(
arg
,
addr_token
,
0
,
WINED3DSP_WRITEMASK_0
,
&
rel_param
);
sprintf
(
tmpStr
,
"%s[%s + %u]"
,
prefix
,
rel_param
.
param_str
,
reg
);
}
else
sprintf
(
tmpStr
,
"%s[A0.x + %u]"
,
prefix
,
reg
);
if
(
reg
)
{
sprintf
(
tmpStr
,
"%s[%s + %u]"
,
prefix
,
rel_param
.
param_str
,
reg
);
}
else
{
sprintf
(
tmpStr
,
"%s[%s]"
,
prefix
,
rel_param
.
param_str
);
}
}
else
{
if
(
reg
)
{
sprintf
(
tmpStr
,
"%s[A0.x + %u]"
,
prefix
,
reg
);
}
else
{
sprintf
(
tmpStr
,
"%s[A0.x]"
,
prefix
);
}
}
}
else
sprintf
(
tmpStr
,
"%s[%u]"
,
prefix
,
reg
);
...
...
@@ -1299,18 +1315,8 @@ void shader_glsl_mov(SHADER_OPCODE_ARG* arg) {
* shader versions WINED3DSIO_MOVA is used for this. */
if
((
WINED3DSHADER_VERSION_MAJOR
(
shader
->
baseShader
.
hex_version
)
==
1
&&
!
shader_is_pshader_version
(
shader
->
baseShader
.
hex_version
)
&&
shader_get_regtype
(
arg
->
dst
)
==
WINED3DSPR_ADDR
))
{
/* This is a simple floor(). Msdn claims it is a round to nearest, but our test shows
* that it is just a floor(). ATI docs confirm that, and the test succeeds on the
* reference rasterizer too
*/
size_t
mask_size
=
shader_glsl_get_write_mask_size
(
write_mask
);
if
(
mask_size
>
1
)
{
shader_addline
(
buffer
,
"ivec%d(floor(%s)));
\n
"
,
mask_size
,
src0_param
.
param_str
);
}
else
{
shader_addline
(
buffer
,
"int(floor(%s)));
\n
"
,
src0_param
.
param_str
);
}
}
else
if
(
arg
->
opcode
->
opcode
==
WINED3DSIO_MOVA
)
{
shader_get_regtype
(
arg
->
dst
)
==
WINED3DSPR_ADDR
)
||
arg
->
opcode
->
opcode
==
WINED3DSIO_MOVA
)
{
/* We need to *round* to the nearest int here. */
size_t
mask_size
=
shader_glsl_get_write_mask_size
(
write_mask
);
if
(
mask_size
>
1
)
{
...
...
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