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
534151a7
Commit
534151a7
authored
Jul 12, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass a state pointer instead of a stateblock to loadTexCoords().
parent
3d28cdb6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
state.c
dlls/wined3d/state.c
+18
-15
No files found.
dlls/wined3d/state.c
View file @
534151a7
...
...
@@ -3265,7 +3265,7 @@ static void transform_texture(DWORD state_id, struct wined3d_stateblock *statebl
}
}
static
void
unload
TexC
oords
(
const
struct
wined3d_gl_info
*
gl_info
)
static
void
unload
_tex_c
oords
(
const
struct
wined3d_gl_info
*
gl_info
)
{
unsigned
int
texture_idx
;
...
...
@@ -3276,23 +3276,25 @@ static void unloadTexCoords(const struct wined3d_gl_info *gl_info)
}
}
static
void
load
TexCoords
(
const
struct
wined3d_gl_info
*
gl_info
,
struct
wined3d_stateblock
*
stateblock
,
const
struct
wined3d_stream_info
*
si
,
GLuint
*
curVBO
)
static
void
load
_tex_coords
(
const
struct
wined3d_context
*
context
,
const
struct
wined3d_stream_info
*
si
,
GLuint
*
curVBO
,
const
struct
wined3d_state
*
state
)
{
const
struct
wined3d_device
*
device
=
context
->
swapchain
->
device
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
unsigned
int
mapped_stage
=
0
;
unsigned
int
textureNo
=
0
;
for
(
textureNo
=
0
;
textureNo
<
gl_info
->
limits
.
texture_stages
;
++
textureNo
)
{
int
coordIdx
=
state
block
->
state
.
texture_states
[
textureNo
][
WINED3DTSS_TEXCOORDINDEX
];
int
coordIdx
=
state
->
texture_states
[
textureNo
][
WINED3DTSS_TEXCOORDINDEX
];
mapped_stage
=
stateblock
->
device
->
texUnitMap
[
textureNo
];
mapped_stage
=
device
->
texUnitMap
[
textureNo
];
if
(
mapped_stage
==
WINED3D_UNMAPPED_STAGE
)
continue
;
if
(
coordIdx
<
MAX_TEXTURES
&&
(
si
->
use_map
&
(
1
<<
(
WINED3D_FFP_TEXCOORD0
+
coordIdx
))))
{
const
struct
wined3d_stream_info_element
*
e
=
&
si
->
elements
[
WINED3D_FFP_TEXCOORD0
+
coordIdx
];
const
struct
wined3d_stream_state
*
stream
=
&
state
block
->
state
.
streams
[
e
->
stream_idx
];
const
struct
wined3d_stream_state
*
stream
=
&
state
->
streams
[
e
->
stream_idx
];
TRACE
(
"Setting up texture %u, idx %d, coordindx %u, data {%#x:%p}.
\n
"
,
textureNo
,
mapped_stage
,
coordIdx
,
e
->
data
.
buffer_object
,
e
->
data
.
addr
);
...
...
@@ -3309,7 +3311,7 @@ static void loadTexCoords(const struct wined3d_gl_info *gl_info, struct wined3d_
/* The coords to supply depend completely on the fvf / vertex shader */
glTexCoordPointer
(
e
->
format
->
gl_vtx_format
,
e
->
format
->
gl_vtx_type
,
e
->
stride
,
e
->
data
.
addr
+
state
block
->
state
.
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
e
->
data
.
addr
+
state
->
load_base_vertex_index
*
e
->
stride
+
stream
->
offset
);
glEnableClientState
(
GL_TEXTURE_COORD_ARRAY
);
}
else
...
...
@@ -3329,15 +3331,16 @@ static void loadTexCoords(const struct wined3d_gl_info *gl_info, struct wined3d_
checkGLcall
(
"loadTexCoords"
);
}
static
void
tex_coordindex
(
DWORD
state
,
struct
wined3d_stateblock
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
tex_coordindex
(
DWORD
state
_id
,
struct
wined3d_stateblock
*
stateblock
,
struct
wined3d_context
*
context
)
{
DWORD
stage
=
(
state
-
STATE_TEXTURESTAGE
(
0
,
0
))
/
(
WINED3D_HIGHEST_TEXTURE_STATE
+
1
);
DWORD
stage
=
(
state
_id
-
STATE_TEXTURESTAGE
(
0
,
0
))
/
(
WINED3D_HIGHEST_TEXTURE_STATE
+
1
);
DWORD
mapped_stage
=
stateblock
->
device
->
texUnitMap
[
stage
];
static
const
GLfloat
s_plane
[]
=
{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
};
static
const
GLfloat
t_plane
[]
=
{
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
};
static
const
GLfloat
r_plane
[]
=
{
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
};
static
const
GLfloat
q_plane
[]
=
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
};
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
const
struct
wined3d_state
*
state
=
&
stateblock
->
state
;
if
(
mapped_stage
==
WINED3D_UNMAPPED_STAGE
)
{
...
...
@@ -3362,7 +3365,7 @@ static void tex_coordindex(DWORD state, struct wined3d_stateblock *stateblock, s
* state. We do not (yet) support the WINED3DRENDERSTATE_WRAPx values, nor tie them up
* to the TEXCOORDINDEX value
*/
switch
(
state
block
->
state
.
texture_states
[
stage
][
WINED3DTSS_TEXCOORDINDEX
]
&
0xffff0000
)
switch
(
state
->
texture_states
[
stage
][
WINED3DTSS_TEXCOORDINDEX
]
&
0xffff0000
)
{
case
WINED3DTSS_TCI_PASSTHRU
:
/* Use the specified texture coordinates contained within the
...
...
@@ -3477,7 +3480,7 @@ static void tex_coordindex(DWORD state, struct wined3d_stateblock *stateblock, s
default:
FIXME
(
"Unhandled WINED3DTSS_TEXCOORDINDEX %#x.
\n
"
,
state
block
->
state
.
texture_states
[
stage
][
WINED3DTSS_TEXCOORDINDEX
]);
state
->
texture_states
[
stage
][
WINED3DTSS_TEXCOORDINDEX
]);
glDisable
(
GL_TEXTURE_GEN_S
);
glDisable
(
GL_TEXTURE_GEN_T
);
glDisable
(
GL_TEXTURE_GEN_R
);
...
...
@@ -3500,8 +3503,8 @@ static void tex_coordindex(DWORD state, struct wined3d_stateblock *stateblock, s
*/
GLuint
curVBO
=
gl_info
->
supported
[
ARB_VERTEX_BUFFER_OBJECT
]
?
~
0U
:
0
;
unload
TexC
oords
(
gl_info
);
load
TexCoords
(
gl_info
,
stateblock
,
&
stateblock
->
device
->
strided_streams
,
&
curVBO
);
unload
_tex_c
oords
(
gl_info
);
load
_tex_coords
(
context
,
&
stateblock
->
device
->
strided_streams
,
&
curVBO
,
state
);
}
}
...
...
@@ -4033,7 +4036,7 @@ static inline void unloadVertexData(const struct wined3d_gl_info *gl_info)
{
glDisableClientState
(
GL_WEIGHT_ARRAY_ARB
);
}
unload
TexC
oords
(
gl_info
);
unload
_tex_c
oords
(
gl_info
);
}
static
inline
void
unload_numbered_array
(
struct
wined3d_context
*
context
,
int
i
)
...
...
@@ -4488,7 +4491,7 @@ static void loadVertexData(const struct wined3d_context *context, struct wined3d
}
/* Texture coords -------------------------------------------*/
load
TexCoords
(
gl_info
,
stateblock
,
si
,
&
curVBO
);
load
_tex_coords
(
context
,
si
,
&
curVBO
,
&
stateblock
->
state
);
}
static
void
streamsrc
(
DWORD
state
,
struct
wined3d_stateblock
*
stateblock
,
struct
wined3d_context
*
context
)
...
...
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