Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d6ee7d59
Commit
d6ee7d59
authored
Apr 17, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 20, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Create a relative addressing token for 1.x shaders in the frontend.
Rather than handling this in the backends. Note that the ARB backend always assumes 1.x shaders.
parent
59cc56b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
29 deletions
+29
-29
baseshader.c
dlls/wined3d/baseshader.c
+23
-8
glsl_shader.c
dlls/wined3d/glsl_shader.c
+6
-21
No files found.
dlls/wined3d/baseshader.c
View file @
d6ee7d59
...
...
@@ -7,6 +7,7 @@
* Copyright 2005 Oliver Stieber
* Copyright 2006 Ivan Gyurdiev
* Copyright 2007-2008 Stefan Dösinger for CodeWeavers
* Copyright 2009 Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -131,17 +132,31 @@ const SHADER_OPCODE *shader_get_opcode(const SHADER_OPCODE *opcode_table, DWORD
* Return the number of tokens read */
static
int
shader_get_param
(
const
DWORD
*
pToken
,
DWORD
shader_version
,
DWORD
*
param
,
DWORD
*
addr_token
)
{
UINT
count
=
1
;
*
param
=
*
pToken
;
/* PS >= 3.0 have relative addressing (with token)
* VS >= 2.0 have relative addressing (with token)
* VS >= 1.0 < 2.0 have relative addressing (without token)
* The version check below should work in general */
if
(
*
pToken
&
WINED3DSHADER_ADDRMODE_RELATIVE
)
{
if
(
WINED3DSHADER_VERSION_MAJOR
(
shader_version
)
<
2
)
{
*
addr_token
=
(
1
<<
31
)
|
((
WINED3DSPR_ADDR
<<
WINED3DSP_REGTYPE_SHIFT2
)
&
WINED3DSP_REGTYPE_MASK2
)
|
((
WINED3DSPR_ADDR
<<
WINED3DSP_REGTYPE_SHIFT
)
&
WINED3DSP_REGTYPE_MASK
)
|
WINED3DSP_NOSWIZZLE
;
}
else
{
*
addr_token
=
*
(
pToken
+
1
);
++
count
;
}
}
char
rel_token
=
WINED3DSHADER_VERSION_MAJOR
(
shader_version
)
>=
2
&&
((
*
pToken
&
WINED3DSHADER_ADDRESSMODE_MASK
)
==
WINED3DSHADER_ADDRMODE_RELATIVE
);
*
param
=
*
pToken
;
*
addr_token
=
rel_token
?
*
(
pToken
+
1
)
:
0
;
return
rel_token
?
2
:
1
;
return
count
;
}
/* Return the number of parameters to skip for an opcode */
...
...
@@ -167,7 +182,7 @@ static int shader_skip_unrecognized(const DWORD *pToken, DWORD shader_version)
/* TODO: Think of a good name for 0x80000000 and replace it with a constant */
while
(
*
pToken
&
0x80000000
)
{
DWORD
param
,
addr_token
;
DWORD
param
,
addr_token
=
0
;
tokens_read
+=
shader_get_param
(
pToken
,
shader_version
,
&
param
,
&
addr_token
);
pToken
+=
tokens_read
;
...
...
@@ -1014,7 +1029,7 @@ void shader_trace_init(const DWORD *pFunction, const SHADER_OPCODE *opcode_table
}
else
{
DWORD
param
,
addr_token
;
DWORD
param
,
addr_token
=
0
;
int
tokens_read
;
/* Print out predication source token first - it follows
...
...
dlls/wined3d/glsl_shader.c
View file @
d6ee7d59
...
...
@@ -1105,27 +1105,12 @@ static void shader_glsl_get_register_name(WINED3DSHADER_PARAM_REGISTER_TYPE regi
/* Relative addressing */
if
(
rel_addr
)
{
/* Relative addressing on shaders 2.0+ have a relative address token,
* prior to that, it was hard-coded as "A0.x" because there's only 1 register */
if
(
WINED3DSHADER_VERSION_MAJOR
(
shader_version
)
>=
2
)
{
glsl_src_param_t
rel_param
;
shader_glsl_add_src_param
(
ins
,
addr_token
,
0
,
WINED3DSP_WRITEMASK_0
,
&
rel_param
);
if
(
register_idx
)
{
sprintf
(
register_name
,
"%cC[%s + %u]"
,
prefix
,
rel_param
.
param_str
,
register_idx
);
}
else
{
sprintf
(
register_name
,
"%cC[%s]"
,
prefix
,
rel_param
.
param_str
);
}
}
else
{
if
(
register_idx
)
{
sprintf
(
register_name
,
"%cC[A0.x + %u]"
,
prefix
,
register_idx
);
}
else
{
sprintf
(
register_name
,
"%cC[A0.x]"
,
prefix
);
}
}
glsl_src_param_t
rel_param
;
shader_glsl_add_src_param
(
ins
,
addr_token
,
0
,
WINED3DSP_WRITEMASK_0
,
&
rel_param
);
if
(
register_idx
)
sprintf
(
register_name
,
"%cC[%s + %u]"
,
prefix
,
rel_param
.
param_str
,
register_idx
);
else
sprintf
(
register_name
,
"%cC[%s]"
,
prefix
,
rel_param
.
param_str
);
}
else
{
if
(
shader_constant_is_local
(
This
,
register_idx
))
{
...
...
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