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
dfd338de
Commit
dfd338de
authored
May 28, 2009
by
Stefan Doesinger
Committed by
Alexandre Julliard
Jun 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add modifier support to tex and friends.
parent
7856c1c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
31 deletions
+37
-31
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+37
-31
No files found.
dlls/wined3d/arb_program_shader.c
View file @
dfd338de
...
...
@@ -910,6 +910,35 @@ static void gen_color_correction(SHADER_BUFFER *buffer, const char *reg, DWORD d
}
}
static
const
char
*
shader_arb_get_modifier
(
const
struct
wined3d_shader_instruction
*
ins
)
{
DWORD
mod
;
const
char
*
ret
=
""
;
if
(
!
ins
->
dst_count
)
return
""
;
mod
=
ins
->
dst
[
0
].
modifiers
;
if
(
mod
&
WINED3DSPDM_SATURATE
)
{
ret
=
"_SAT"
;
mod
&=
~
WINED3DSPDM_SATURATE
;
}
if
(
mod
&
WINED3DSPDM_PARTIALPRECISION
)
{
FIXME
(
"Unhandled modifier WINED3DSPDM_PARTIALPRECISION
\n
"
);
mod
&=
~
WINED3DSPDM_PARTIALPRECISION
;
}
if
(
mod
&
WINED3DSPDM_MSAMPCENTROID
)
{
FIXME
(
"Unhandled modifier WINED3DSPDM_MSAMPCENTROID
\n
"
);
mod
&=
~
WINED3DSPDM_MSAMPCENTROID
;
}
if
(
mod
)
{
FIXME
(
"Unknown modifiers 0x%08x
\n
"
,
mod
);
}
return
ret
;
}
#define TEX_PROJ 0x1
#define TEX_BIAS 0x2
#define TEX_LOD 0x4
...
...
@@ -924,6 +953,7 @@ static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD
IWineD3DBaseShaderImpl
*
This
=
(
IWineD3DBaseShaderImpl
*
)
ins
->
ctx
->
shader
;
IWineD3DDeviceImpl
*
device
=
(
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
;
struct
shader_arb_ctx_priv
*
priv
=
ins
->
ctx
->
backend_data
;
const
char
*
mod
=
shader_arb_get_modifier
(
ins
);
switch
(
sampler_type
)
{
case
WINED3DSTT_1D
:
...
...
@@ -963,29 +993,30 @@ static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD
{
if
(
flags
&
TEX_PROJ
)
FIXME
(
"Projected texture sampling with custom derivates
\n
"
);
if
(
flags
&
TEX_BIAS
)
FIXME
(
"Biased texture sampling with custom derivates
\n
"
);
shader_addline
(
buffer
,
"TXD
%s, %s, %s, %s, texture[%u], %s;
\n
"
,
dst_str
,
coord_reg
,
dsx
,
dsy
,
sampler_idx
,
tex_type
);
shader_addline
(
buffer
,
"TXD
%s %s, %s, %s, %s, texture[%u], %s;
\n
"
,
mod
,
dst_str
,
coord_reg
,
dsx
,
dsy
,
sampler_idx
,
tex_type
);
}
else
if
(
flags
&
TEX_LOD
)
{
if
(
flags
&
TEX_PROJ
)
FIXME
(
"Projected texture sampling with explicit lod
\n
"
);
if
(
flags
&
TEX_BIAS
)
FIXME
(
"Biased texture sampling with explicit lod
\n
"
);
shader_addline
(
buffer
,
"TXL %s, %s, texture[%u], %s;
\n
"
,
dst_str
,
coord_reg
,
sampler_idx
,
tex_type
);
shader_addline
(
buffer
,
"TXL%s %s, %s, texture[%u], %s;
\n
"
,
mod
,
dst_str
,
coord_reg
,
sampler_idx
,
tex_type
);
}
else
if
(
flags
&
TEX_BIAS
)
{
/* Shouldn't be possible, but let's check for it */
if
(
flags
&
TEX_PROJ
)
FIXME
(
"Biased and Projected texture sampling
\n
"
);
/* TXB takes the 4th component of the source vector automatically, as d3d. Nothing more to do */
shader_addline
(
buffer
,
"TXB
%s, %s, texture[%u], %s;
\n
"
,
dst_str
,
coord_reg
,
sampler_idx
,
tex_type
);
shader_addline
(
buffer
,
"TXB
%s %s, %s, texture[%u], %s;
\n
"
,
mod
,
dst_str
,
coord_reg
,
sampler_idx
,
tex_type
);
}
else
if
(
flags
&
TEX_PROJ
)
{
shader_addline
(
buffer
,
"TXP
%s, %s, texture[%u], %s;
\n
"
,
dst_str
,
coord_reg
,
sampler_idx
,
tex_type
);
shader_addline
(
buffer
,
"TXP
%s %s, %s, texture[%u], %s;
\n
"
,
mod
,
dst_str
,
coord_reg
,
sampler_idx
,
tex_type
);
}
else
{
shader_addline
(
buffer
,
"TEX
%s, %s, texture[%u], %s;
\n
"
,
dst_str
,
coord_reg
,
sampler_idx
,
tex_type
);
shader_addline
(
buffer
,
"TEX
%s %s, %s, texture[%u], %s;
\n
"
,
mod
,
dst_str
,
coord_reg
,
sampler_idx
,
tex_type
);
}
if
(
shader_is_pshader_version
(
ins
->
ctx
->
reg_maps
->
shader_version
.
type
))
...
...
@@ -1079,31 +1110,6 @@ static void shader_arb_get_src_param(const struct wined3d_shader_instruction *in
sprintf
(
outregstr
,
"T%c%s"
,
'A'
+
tmpreg
,
swzstr
);
}
static
const
char
*
shader_arb_get_modifier
(
const
struct
wined3d_shader_instruction
*
ins
)
{
DWORD
mod
;
const
char
*
ret
=
""
;
if
(
!
ins
->
dst_count
)
return
""
;
mod
=
ins
->
dst
[
0
].
modifiers
;
if
(
mod
&
WINED3DSPDM_SATURATE
)
{
ret
=
"_SAT"
;
mod
&=
~
WINED3DSPDM_SATURATE
;
}
if
(
mod
&
WINED3DSPDM_PARTIALPRECISION
)
{
FIXME
(
"Unhandled modifier WINED3DSPDM_PARTIALPRECISION
\n
"
);
mod
&=
~
WINED3DSPDM_PARTIALPRECISION
;
}
if
(
mod
&
WINED3DSPDM_MSAMPCENTROID
)
{
FIXME
(
"Unhandled modifier WINED3DSPDM_MSAMPCENTROID
\n
"
);
mod
&=
~
WINED3DSPDM_MSAMPCENTROID
;
}
if
(
mod
)
{
FIXME
(
"Unknown modifiers 0x%08x
\n
"
,
mod
);
}
return
ret
;
}
static
void
pshader_hw_bem
(
const
struct
wined3d_shader_instruction
*
ins
)
{
const
struct
wined3d_shader_dst_param
*
dst
=
&
ins
->
dst
[
0
];
...
...
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