Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
dd094fe6
Commit
dd094fe6
authored
16 years ago
by
Henri Verbeet
Committed by
Alexandre Julliard
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
wined3d: Explicitly pass the shader version to some more functions.
parent
b9e10147
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/wined3d/baseshader.c
+9
-15
9 additions, 15 deletions
dlls/wined3d/baseshader.c
with
9 additions
and
15 deletions
dlls/wined3d/baseshader.c
+
9
−
15
View file @
dd094fe6
...
...
@@ -131,17 +131,12 @@ static int shader_get_param(const DWORD *pToken, DWORD shader_version, DWORD *pa
}
/* Return the number of parameters to skip for an opcode */
static
inline
int
shader_skip_opcode
(
IWineD3DBaseShaderImpl
*
This
,
const
SHADER_OPCODE
*
curOpcode
,
DWORD
opcode_token
)
{
static
inline
int
shader_skip_opcode
(
const
SHADER_OPCODE
*
curOpcode
,
DWORD
opcode_token
,
DWORD
shader_version
)
{
/* Shaders >= 2.0 may contain address tokens, but fortunately they
* have a useful length mask - use it here. Shaders 1.0 contain no such tokens */
return
(
WINED3DSHADER_VERSION_MAJOR
(
This
->
baseShader
.
hex_version
)
>=
2
)
?
((
opcode_token
&
WINED3DSI_INSTLENGTH_MASK
)
>>
WINED3DSI_INSTLENGTH_SHIFT
)
:
curOpcode
->
num_params
;
return
(
WINED3DSHADER_VERSION_MAJOR
(
shader_version
)
>=
2
)
?
((
opcode_token
&
WINED3DSI_INSTLENGTH_MASK
)
>>
WINED3DSI_INSTLENGTH_SHIFT
)
:
curOpcode
->
num_params
;
}
/* Read the parameters of an unrecognized opcode from the input stream
...
...
@@ -767,9 +762,8 @@ static void shader_dump_param(const DWORD param, const DWORD addr_token, int inp
}
static
void
shader_color_correction
(
IWineD3DBaseShaderImpl
*
shader
,
IWineD3DDeviceImpl
*
device
,
const
struct
SHADER_OPCODE_ARG
*
arg
)
IWineD3DDeviceImpl
*
device
,
const
struct
SHADER_OPCODE_ARG
*
arg
,
DWORD
shader_version
)
{
DWORD
hex_version
=
shader
->
baseShader
.
hex_version
;
IWineD3DBaseTextureImpl
*
texture
;
struct
color_fixup_desc
fixup
;
BOOL
recorded
=
FALSE
;
...
...
@@ -779,7 +773,7 @@ static void shader_color_correction(IWineD3DBaseShaderImpl *shader,
switch
(
arg
->
opcode
->
opcode
)
{
case
WINED3DSIO_TEX
:
if
(
hex_version
<
WINED3D
P
S_VERSION
(
2
,
0
)
)
sampler_idx
=
arg
->
dst
&
WINED3DSP_REGNUM_MASK
;
if
(
WINED3DS
HADER
_VERSION
_MAJOR
(
shader_version
)
<
2
)
sampler_idx
=
arg
->
dst
&
WINED3DSP_REGNUM_MASK
;
else
sampler_idx
=
arg
->
src
[
1
]
&
WINED3DSP_REGNUM_MASK
;
break
;
...
...
@@ -894,7 +888,7 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer,
WINED3DSIO_PHASE
==
curOpcode
->
opcode
||
WINED3DSIO_RET
==
curOpcode
->
opcode
)
{
pToken
+=
shader_skip_opcode
(
This
,
curOpcode
,
hw_arg
.
opcode_token
);
pToken
+=
shader_skip_opcode
(
curOpcode
,
hw_arg
.
opcode_token
,
shader_version
);
/* If a generator function is set for current shader target, use it */
}
else
if
(
hw_fct
!=
NULL
)
{
...
...
@@ -927,7 +921,7 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer,
hw_fct
(
&
hw_arg
);
/* Add color correction if needed */
shader_color_correction
(
This
,
device
,
&
hw_arg
);
shader_color_correction
(
This
,
device
,
&
hw_arg
,
shader_version
);
/* Process instruction modifiers for GLSL apps ( _sat, etc. ) */
/* FIXME: This should be internal to the shader backend.
...
...
@@ -939,7 +933,7 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer,
}
else
{
FIXME
(
"Can't handle opcode %s in hwShader
\n
"
,
curOpcode
->
name
);
pToken
+=
shader_skip_opcode
(
This
,
curOpcode
,
hw_arg
.
opcode_token
);
pToken
+=
shader_skip_opcode
(
curOpcode
,
hw_arg
.
opcode_token
,
shader_version
);
}
}
/* TODO: What about result.depth? */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment