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
4ff5736e
Commit
4ff5736e
authored
Mar 09, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Don't compare texUnitMap entries to -1.
parent
a3df4767
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
17 deletions
+30
-17
ati_fragment_shader.c
dlls/wined3d/ati_fragment_shader.c
+2
-1
device.c
dlls/wined3d/device.c
+2
-1
glsl_shader.c
dlls/wined3d/glsl_shader.c
+6
-4
nvidia_texture_shader.c
dlls/wined3d/nvidia_texture_shader.c
+5
-3
state.c
dlls/wined3d/state.c
+12
-7
utils.c
dlls/wined3d/utils.c
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/ati_fragment_shader.c
View file @
4ff5736e
...
...
@@ -834,7 +834,8 @@ static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, Wi
*/
for
(
i
=
0
;
i
<
desc
->
num_textures_used
;
i
++
)
{
mapped_stage
=
This
->
texUnitMap
[
i
];
if
(
mapped_stage
!=
-
1
)
{
if
(
mapped_stage
!=
WINED3D_UNMAPPED_STAGE
)
{
GL_EXTCALL
(
glActiveTextureARB
(
GL_TEXTURE0_ARB
+
mapped_stage
));
checkGLcall
(
"glActiveTextureARB"
);
texture_activate_dimensions
(
i
,
stateblock
,
context
);
...
...
dlls/wined3d/device.c
View file @
4ff5736e
...
...
@@ -4059,7 +4059,8 @@ static void device_map_vsamplers(IWineD3DDeviceImpl *This, BOOL ps) {
for
(
i
=
0
;
i
<
MAX_VERTEX_SAMPLERS
;
++
i
)
{
int
vsampler_idx
=
i
+
MAX_FRAGMENT_SAMPLERS
;
if
(
vshader_sampler_tokens
[
i
])
{
if
(
This
->
texUnitMap
[
vsampler_idx
]
!=
-
1
)
{
if
(
This
->
texUnitMap
[
vsampler_idx
]
!=
WINED3D_UNMAPPED_STAGE
)
{
/* Already mapped somewhere */
continue
;
}
...
...
dlls/wined3d/glsl_shader.c
View file @
4ff5736e
...
...
@@ -189,8 +189,9 @@ static void shader_glsl_load_psamplers(const WineD3D_GL_Info *gl_info, IWineD3DS
snprintf
(
sampler_name
,
sizeof
(
sampler_name
),
"Psampler%d"
,
i
);
name_loc
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
sampler_name
));
if
(
name_loc
!=
-
1
)
{
int
mapped_unit
=
stateBlock
->
wineD3DDevice
->
texUnitMap
[
i
];
if
(
mapped_unit
!=
-
1
&&
mapped_unit
<
GL_LIMITS
(
fragment_samplers
))
{
DWORD
mapped_unit
=
stateBlock
->
wineD3DDevice
->
texUnitMap
[
i
];
if
(
mapped_unit
!=
WINED3D_UNMAPPED_STAGE
&&
mapped_unit
<
GL_LIMITS
(
fragment_samplers
))
{
TRACE
(
"Loading %s for texture %d
\n
"
,
sampler_name
,
mapped_unit
);
GL_EXTCALL
(
glUniform1iARB
(
name_loc
,
mapped_unit
));
checkGLcall
(
"glUniform1iARB"
);
...
...
@@ -212,8 +213,9 @@ static void shader_glsl_load_vsamplers(const WineD3D_GL_Info *gl_info, IWineD3DS
snprintf
(
sampler_name
,
sizeof
(
sampler_name
),
"Vsampler%d"
,
i
);
name_loc
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
sampler_name
));
if
(
name_loc
!=
-
1
)
{
int
mapped_unit
=
stateBlock
->
wineD3DDevice
->
texUnitMap
[
MAX_FRAGMENT_SAMPLERS
+
i
];
if
(
mapped_unit
!=
-
1
&&
mapped_unit
<
GL_LIMITS
(
combined_samplers
))
{
DWORD
mapped_unit
=
stateBlock
->
wineD3DDevice
->
texUnitMap
[
MAX_FRAGMENT_SAMPLERS
+
i
];
if
(
mapped_unit
!=
WINED3D_UNMAPPED_STAGE
&&
mapped_unit
<
GL_LIMITS
(
combined_samplers
))
{
TRACE
(
"Loading %s for texture %d
\n
"
,
sampler_name
,
mapped_unit
);
GL_EXTCALL
(
glUniform1iARB
(
name_loc
,
mapped_unit
));
checkGLcall
(
"glUniform1iARB"
);
...
...
dlls/wined3d/nvidia_texture_shader.c
View file @
4ff5736e
...
...
@@ -462,7 +462,8 @@ static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3
if
(
stage
!=
mapped_stage
)
WARN
(
"Using non 1:1 mapping: %d -> %d!
\n
"
,
stage
,
mapped_stage
);
if
(
mapped_stage
!=
-
1
)
{
if
(
mapped_stage
!=
WINED3D_UNMAPPED_STAGE
)
{
if
(
tex_used
&&
mapped_stage
>=
GL_LIMITS
(
textures
))
{
FIXME
(
"Attempt to enable unsupported stage!
\n
"
);
return
;
...
...
@@ -479,7 +480,8 @@ static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3
}
if
(
stage
>=
stateblock
->
lowest_disabled_stage
)
{
TRACE
(
"Stage disabled
\n
"
);
if
(
mapped_stage
!=
-
1
)
{
if
(
mapped_stage
!=
WINED3D_UNMAPPED_STAGE
)
{
/* Disable everything here */
glDisable
(
GL_TEXTURE_2D
);
checkGLcall
(
"glDisable(GL_TEXTURE_2D)"
);
...
...
@@ -548,7 +550,7 @@ static void nvts_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
* handler takes care. Also no action is needed with pixel shaders, or if tex_colorop
* will take care of this business
*/
if
(
mapped_stage
==
-
1
||
mapped_stage
>=
GL_LIMITS
(
textures
))
return
;
if
(
mapped_stage
==
WINED3D_UNMAPPED_STAGE
||
mapped_stage
>=
GL_LIMITS
(
textures
))
return
;
if
(
sampler
>=
stateblock
->
lowest_disabled_stage
)
return
;
if
(
isStateDirty
(
context
,
STATE_TEXTURESTAGE
(
sampler
,
WINED3DTSS_COLOROP
)))
return
;
...
...
dlls/wined3d/state.c
View file @
4ff5736e
...
...
@@ -2852,7 +2852,8 @@ static void tex_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
if
(
stage
!=
mapped_stage
)
WARN
(
"Using non 1:1 mapping: %d -> %d!
\n
"
,
stage
,
mapped_stage
);
if
(
mapped_stage
!=
-
1
)
{
if
(
mapped_stage
!=
WINED3D_UNMAPPED_STAGE
)
{
if
(
tex_used
&&
mapped_stage
>=
GL_LIMITS
(
textures
))
{
FIXME
(
"Attempt to enable unsupported stage!
\n
"
);
return
;
...
...
@@ -2863,7 +2864,8 @@ static void tex_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
if
(
stage
>=
stateblock
->
lowest_disabled_stage
)
{
TRACE
(
"Stage disabled
\n
"
);
if
(
mapped_stage
!=
-
1
)
{
if
(
mapped_stage
!=
WINED3D_UNMAPPED_STAGE
)
{
/* Disable everything here */
glDisable
(
GL_TEXTURE_2D
);
checkGLcall
(
"glDisable(GL_TEXTURE_2D)"
);
...
...
@@ -2904,7 +2906,8 @@ void tex_alphaop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext
TRACE
(
"Setting alpha op for stage %d
\n
"
,
stage
);
/* Do not care for enabled / disabled stages, just assign the settings. colorop disables / enables required stuff */
if
(
mapped_stage
!=
-
1
)
{
if
(
mapped_stage
!=
WINED3D_UNMAPPED_STAGE
)
{
if
(
tex_used
&&
mapped_stage
>=
GL_LIMITS
(
textures
))
{
FIXME
(
"Attempt to enable unsupported stage!
\n
"
);
return
;
...
...
@@ -3008,7 +3011,7 @@ static void transform_texture(DWORD state, IWineD3DStateBlockImpl *stateblock, W
return
;
}
if
(
mapped_stage
==
-
1
)
return
;
if
(
mapped_stage
==
WINED3D_UNMAPPED_STAGE
)
return
;
if
(
mapped_stage
>=
GL_LIMITS
(
textures
))
{
return
;
...
...
@@ -3057,7 +3060,7 @@ static void loadTexCoords(IWineD3DStateBlockImpl *stateblock, const WineDirect3D
int
coordIdx
=
stateblock
->
textureState
[
textureNo
][
WINED3DTSS_TEXCOORDINDEX
];
mapped_stage
=
stateblock
->
wineD3DDevice
->
texUnitMap
[
textureNo
];
if
(
mapped_stage
==
-
1
)
continue
;
if
(
mapped_stage
==
WINED3D_UNMAPPED_STAGE
)
continue
;
if
(
coordIdx
<
MAX_TEXTURES
&&
(
sd
->
u
.
s
.
texCoords
[
coordIdx
].
lpData
||
sd
->
u
.
s
.
texCoords
[
coordIdx
].
VBO
))
{
TRACE
(
"Setting up texture %u, idx %d, cordindx %u, data %p
\n
"
,
...
...
@@ -3101,7 +3104,8 @@ static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
static
const
GLfloat
r_plane
[]
=
{
0
.
0
,
0
.
0
,
1
.
0
,
0
.
0
};
static
const
GLfloat
q_plane
[]
=
{
0
.
0
,
0
.
0
,
0
.
0
,
1
.
0
};
if
(
mapped_stage
==
-
1
)
{
if
(
mapped_stage
==
WINED3D_UNMAPPED_STAGE
)
{
TRACE
(
"No texture unit mapped to stage %d. Skipping texture coordinates.
\n
"
,
stage
);
return
;
}
...
...
@@ -3341,7 +3345,8 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont
* only has to bind textures and set the per texture states
*/
if
(
mapped_stage
==
-
1
)
{
if
(
mapped_stage
==
WINED3D_UNMAPPED_STAGE
)
{
TRACE
(
"No sampler mapped to stage %d. Returning.
\n
"
,
sampler
);
return
;
}
...
...
dlls/wined3d/utils.c
View file @
4ff5736e
...
...
@@ -2385,7 +2385,7 @@ void sampler_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont
* handler takes care. Also no action is needed with pixel shaders, or if tex_colorop
* will take care of this business
*/
if
(
mapped_stage
==
-
1
||
mapped_stage
>=
GL_LIMITS
(
textures
))
return
;
if
(
mapped_stage
==
WINED3D_UNMAPPED_STAGE
||
mapped_stage
>=
GL_LIMITS
(
textures
))
return
;
if
(
sampler
>=
stateblock
->
lowest_disabled_stage
)
return
;
if
(
isStateDirty
(
context
,
STATE_TEXTURESTAGE
(
sampler
,
WINED3DTSS_COLOROP
)))
return
;
...
...
dlls/wined3d/wined3d_private.h
View file @
4ff5736e
...
...
@@ -1039,6 +1039,8 @@ void dumpResources(struct list *list);
/*****************************************************************************
* IWineD3DDevice implementation structure
*/
#define WINED3D_UNMAPPED_STAGE ~0U
struct
IWineD3DDeviceImpl
{
/* IUnknown fields */
...
...
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