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
7baf7c65
Commit
7baf7c65
authored
Jun 08, 2009
by
Stefan Doesinger
Committed by
Alexandre Julliard
Jun 19, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implement vertex texture fetch in ARB.
parent
f1e97cdf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+24
-2
No files found.
dlls/wined3d/arb_program_shader.c
View file @
7baf7c65
...
...
@@ -125,6 +125,11 @@ struct arb_vs_compile_args
struct
vs_compile_args
super
;
DWORD
bools
;
/* WORD is enough, use DWORD for alignment */
DWORD
ps_signature
;
union
{
unsigned
char
vertex_samplers
[
4
];
DWORD
vertex_samplers_compare
;
};
unsigned
char
loop_ctrl
[
MAX_CONST_I
][
3
];
};
...
...
@@ -1089,6 +1094,10 @@ static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD
IWineD3DDeviceImpl
*
device
=
(
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
;
struct
shader_arb_ctx_priv
*
priv
=
ins
->
ctx
->
backend_data
;
const
char
*
mod
;
BOOL
pshader
=
shader_is_pshader_version
(
ins
->
ctx
->
reg_maps
->
shader_version
.
type
);
/* D3D vertex shader sampler IDs are vertex samplers(0-3), not global d3d samplers */
if
(
!
pshader
)
sampler_idx
+=
MAX_FRAGMENT_SAMPLERS
;
switch
(
sampler_type
)
{
case
WINED3DSTT_1D
:
...
...
@@ -1130,6 +1139,12 @@ static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD
if
(
ins
->
dst
[
0
].
modifiers
&
WINED3DSPDM_SATURATE
)
mod
=
"_SAT"
;
else
mod
=
""
;
/* Fragment samplers always have indentity mapping */
if
(
sampler_idx
>=
MAX_FRAGMENT_SAMPLERS
)
{
sampler_idx
=
priv
->
cur_vs_args
->
vertex_samplers
[
sampler_idx
-
MAX_FRAGMENT_SAMPLERS
];
}
if
(
flags
&
TEX_DERIV
)
{
if
(
flags
&
TEX_PROJ
)
FIXME
(
"Projected texture sampling with custom derivates
\n
"
);
...
...
@@ -1160,7 +1175,7 @@ static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD
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
)
)
if
(
pshader
)
{
gen_color_correction
(
buffer
,
dst_str
,
ins
->
dst
[
0
].
write_mask
,
"one"
,
"coefmul.x"
,
priv
->
cur_ps_args
->
super
.
color_fixup
[
sampler_idx
]);
...
...
@@ -3556,6 +3571,7 @@ static inline BOOL vs_args_equal(const struct arb_vs_compile_args *stored, const
if
(
stored
->
super
.
fog_src
!=
new
->
super
.
fog_src
)
return
FALSE
;
if
(
stored
->
bools
!=
new
->
bools
)
return
FALSE
;
if
(
stored
->
ps_signature
!=
new
->
ps_signature
)
return
FALSE
;
if
(
stored
->
vertex_samplers_compare
!=
new
->
vertex_samplers_compare
)
return
FALSE
;
if
(
skip_int
)
return
TRUE
;
return
memcmp
(
stored
->
loop_ctrl
,
new
->
loop_ctrl
,
sizeof
(
stored
->
loop_ctrl
))
==
0
;
...
...
@@ -3665,7 +3681,8 @@ static inline void find_arb_vs_compile_args(IWineD3DVertexShaderImpl *shader, IW
{
int
i
;
WORD
int_skip
;
const
WineD3D_GL_Info
*
gl_info
=
&
((
IWineD3DDeviceImpl
*
)
shader
->
baseShader
.
device
)
->
adapter
->
gl_info
;
IWineD3DDeviceImpl
*
dev
=
(
IWineD3DDeviceImpl
*
)
shader
->
baseShader
.
device
;
const
WineD3D_GL_Info
*
gl_info
=
&
dev
->
adapter
->
gl_info
;
find_vs_compile_args
(
shader
,
stateblock
,
&
args
->
super
);
/* This forces all local boolean constants to 1 to make them stateblock independent */
...
...
@@ -3685,6 +3702,11 @@ static inline void find_arb_vs_compile_args(IWineD3DVertexShaderImpl *shader, IW
if
(
stateblock
->
vertexShaderConstantB
[
i
])
args
->
bools
|=
(
1
<<
i
);
}
args
->
vertex_samplers
[
0
]
=
dev
->
texUnitMap
[
MAX_FRAGMENT_SAMPLERS
+
0
];
args
->
vertex_samplers
[
1
]
=
dev
->
texUnitMap
[
MAX_FRAGMENT_SAMPLERS
+
1
];
args
->
vertex_samplers
[
2
]
=
dev
->
texUnitMap
[
MAX_FRAGMENT_SAMPLERS
+
2
];
args
->
vertex_samplers
[
3
]
=
0
;
/* Skip if unused or local */
int_skip
=
~
shader
->
baseShader
.
reg_maps
.
integer_constants
|
shader
->
baseShader
.
reg_maps
.
local_int_consts
;
if
(
int_skip
==
0xffff
||
GL_SUPPORT
(
NV_VERTEX_PROGRAM2_OPTION
))
...
...
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