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
b5cec576
Commit
b5cec576
authored
May 25, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
May 25, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Set the state.c GLINFO_LOCATION to *gl_info.
parent
4d4654a0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
31 deletions
+45
-31
state.c
dlls/wined3d/state.c
+45
-31
No files found.
dlls/wined3d/state.c
View file @
b5cec576
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d
);
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d
);
WINE_DECLARE_DEBUG_CHANNEL
(
d3d_shader
);
WINE_DECLARE_DEBUG_CHANNEL
(
d3d_shader
);
#define GLINFO_LOCATION (*
context->
gl_info)
#define GLINFO_LOCATION (*gl_info)
/* GL locking for state handlers is done by the caller. */
/* GL locking for state handlers is done by the caller. */
...
@@ -234,6 +234,7 @@ static void state_ambient(DWORD state, IWineD3DStateBlockImpl *stateblock, struc
...
@@ -234,6 +234,7 @@ static void state_ambient(DWORD state, IWineD3DStateBlockImpl *stateblock, struc
static
void
state_blend
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
state_blend
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
{
IWineD3DSurfaceImpl
*
target
=
stateblock
->
device
->
render_targets
[
0
];
IWineD3DSurfaceImpl
*
target
=
stateblock
->
device
->
render_targets
[
0
];
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
int
srcBlend
=
GL_ZERO
;
int
srcBlend
=
GL_ZERO
;
int
dstBlend
=
GL_ZERO
;
int
dstBlend
=
GL_ZERO
;
...
@@ -451,6 +452,7 @@ static void state_blendfactor_w(DWORD state, IWineD3DStateBlockImpl *stateblock,
...
@@ -451,6 +452,7 @@ static void state_blendfactor_w(DWORD state, IWineD3DStateBlockImpl *stateblock,
static
void
state_blendfactor
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
state_blendfactor
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
float
col
[
4
];
float
col
[
4
];
TRACE
(
"Setting BlendFactor to %d
\n
"
,
stateblock
->
renderState
[
WINED3DRS_BLENDFACTOR
]);
TRACE
(
"Setting BlendFactor to %d
\n
"
,
stateblock
->
renderState
[
WINED3DRS_BLENDFACTOR
]);
...
@@ -605,12 +607,13 @@ static void state_blendop_w(DWORD state, IWineD3DStateBlockImpl *stateblock, str
...
@@ -605,12 +607,13 @@ static void state_blendop_w(DWORD state, IWineD3DStateBlockImpl *stateblock, str
static
void
state_blendop
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
state_blendop
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
int
blendEquation
=
GL_FUNC_ADD
;
int
blendEquation
=
GL_FUNC_ADD
;
int
blendEquationAlpha
=
GL_FUNC_ADD
;
int
blendEquationAlpha
=
GL_FUNC_ADD
;
/* BLENDOPALPHA requires GL_EXT_blend_equation_separate, so make sure it is around */
/* BLENDOPALPHA requires GL_EXT_blend_equation_separate, so make sure it is around */
if
(
stateblock
->
renderState
[
WINED3DRS_BLENDOPALPHA
]
if
(
stateblock
->
renderState
[
WINED3DRS_BLENDOPALPHA
]
&&
!
context
->
gl_info
->
supported
[
EXT_BLEND_EQUATION_SEPARATE
])
&&
!
gl_info
->
supported
[
EXT_BLEND_EQUATION_SEPARATE
])
{
{
WARN
(
"Unsupported in local OpenGL implementation: glBlendEquationSeparateEXT
\n
"
);
WARN
(
"Unsupported in local OpenGL implementation: glBlendEquationSeparateEXT
\n
"
);
return
;
return
;
...
@@ -763,6 +766,7 @@ static void state_specularenable(DWORD state, IWineD3DStateBlockImpl *stateblock
...
@@ -763,6 +766,7 @@ static void state_specularenable(DWORD state, IWineD3DStateBlockImpl *stateblock
static
void
state_texfactor
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
state_texfactor
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
unsigned
int
i
;
unsigned
int
i
;
/* Note the texture color applies to all textures whereas
/* Note the texture color applies to all textures whereas
...
@@ -772,7 +776,7 @@ static void state_texfactor(DWORD state, IWineD3DStateBlockImpl *stateblock, str
...
@@ -772,7 +776,7 @@ static void state_texfactor(DWORD state, IWineD3DStateBlockImpl *stateblock, str
D3DCOLORTOGLFLOAT4
(
stateblock
->
renderState
[
WINED3DRS_TEXTUREFACTOR
],
col
);
D3DCOLORTOGLFLOAT4
(
stateblock
->
renderState
[
WINED3DRS_TEXTUREFACTOR
],
col
);
/* And now the default texture color as well */
/* And now the default texture color as well */
for
(
i
=
0
;
i
<
context
->
gl_info
->
limits
.
texture_stages
;
++
i
)
for
(
i
=
0
;
i
<
gl_info
->
limits
.
texture_stages
;
++
i
)
{
{
/* Note the WINED3DRS value applies to all textures, but GL has one
/* Note the WINED3DRS value applies to all textures, but GL has one
* per texture, so apply it now ready to be used!
* per texture, so apply it now ready to be used!
...
@@ -788,6 +792,8 @@ static void state_texfactor(DWORD state, IWineD3DStateBlockImpl *stateblock, str
...
@@ -788,6 +792,8 @@ static void state_texfactor(DWORD state, IWineD3DStateBlockImpl *stateblock, str
static
void
renderstate_stencil_twosided
(
struct
wined3d_context
*
context
,
GLint
face
,
static
void
renderstate_stencil_twosided
(
struct
wined3d_context
*
context
,
GLint
face
,
GLint
func
,
GLint
ref
,
GLuint
mask
,
GLint
stencilFail
,
GLint
depthFail
,
GLint
stencilPass
)
GLint
func
,
GLint
ref
,
GLuint
mask
,
GLint
stencilFail
,
GLint
depthFail
,
GLint
stencilPass
)
{
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
glEnable
(
GL_STENCIL_TEST_TWO_SIDE_EXT
);
glEnable
(
GL_STENCIL_TEST_TWO_SIDE_EXT
);
checkGLcall
(
"glEnable(GL_STENCIL_TEST_TWO_SIDE_EXT)"
);
checkGLcall
(
"glEnable(GL_STENCIL_TEST_TWO_SIDE_EXT)"
);
GL_EXTCALL
(
glActiveStencilFaceEXT
(
face
));
GL_EXTCALL
(
glActiveStencilFaceEXT
(
face
));
...
@@ -899,6 +905,7 @@ static void state_stencil(DWORD state, IWineD3DStateBlockImpl *stateblock, struc
...
@@ -899,6 +905,7 @@ static void state_stencil(DWORD state, IWineD3DStateBlockImpl *stateblock, struc
static
void
state_stencilwrite2s
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
state_stencilwrite2s
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
{
DWORD
mask
=
stateblock
->
device
->
depth_stencil
?
stateblock
->
renderState
[
WINED3DRS_STENCILWRITEMASK
]
:
0
;
DWORD
mask
=
stateblock
->
device
->
depth_stencil
?
stateblock
->
renderState
[
WINED3DRS_STENCILWRITEMASK
]
:
0
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
GL_EXTCALL
(
glActiveStencilFaceEXT
(
GL_BACK
));
GL_EXTCALL
(
glActiveStencilFaceEXT
(
GL_BACK
));
checkGLcall
(
"glActiveStencilFaceEXT(GL_BACK)"
);
checkGLcall
(
"glActiveStencilFaceEXT(GL_BACK)"
);
...
@@ -1386,7 +1393,9 @@ static void state_psizemin_w(DWORD state, IWineD3DStateBlockImpl *stateblock, st
...
@@ -1386,7 +1393,9 @@ static void state_psizemin_w(DWORD state, IWineD3DStateBlockImpl *stateblock, st
static
void
state_psizemin_ext
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
state_psizemin_ext
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
{
union
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
union
{
DWORD
d
;
DWORD
d
;
float
f
;
float
f
;
}
min
,
max
;
}
min
,
max
;
...
@@ -1407,7 +1416,9 @@ static void state_psizemin_ext(DWORD state, IWineD3DStateBlockImpl *stateblock,
...
@@ -1407,7 +1416,9 @@ static void state_psizemin_ext(DWORD state, IWineD3DStateBlockImpl *stateblock,
static
void
state_psizemin_arb
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
state_psizemin_arb
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
{
union
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
union
{
DWORD
d
;
DWORD
d
;
float
f
;
float
f
;
}
min
,
max
;
}
min
,
max
;
...
@@ -1534,7 +1545,7 @@ static void state_colorwrite(DWORD state, IWineD3DStateBlockImpl *stateblock, st
...
@@ -1534,7 +1545,7 @@ static void state_colorwrite(DWORD state, IWineD3DStateBlockImpl *stateblock, st
}
}
}
}
static
void
set_color_mask
(
struct
wined3d_context
*
context
,
UINT
index
,
DWORD
mask
)
static
void
set_color_mask
(
const
struct
wined3d_gl_info
*
gl_info
,
UINT
index
,
DWORD
mask
)
{
{
GL_EXTCALL
(
glColorMaskIndexedEXT
(
index
,
GL_EXTCALL
(
glColorMaskIndexedEXT
(
index
,
mask
&
WINED3DCOLORWRITEENABLE_RED
?
GL_TRUE
:
GL_FALSE
,
mask
&
WINED3DCOLORWRITEENABLE_RED
?
GL_TRUE
:
GL_FALSE
,
...
@@ -1545,22 +1556,22 @@ static void set_color_mask(struct wined3d_context *context, UINT index, DWORD ma
...
@@ -1545,22 +1556,22 @@ static void set_color_mask(struct wined3d_context *context, UINT index, DWORD ma
static
void
state_colorwrite0
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
state_colorwrite0
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
{
set_color_mask
(
context
,
0
,
stateblock
->
renderState
[
WINED3DRS_COLORWRITEENABLE
]);
set_color_mask
(
context
->
gl_info
,
0
,
stateblock
->
renderState
[
WINED3DRS_COLORWRITEENABLE
]);
}
}
static
void
state_colorwrite1
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
state_colorwrite1
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
{
set_color_mask
(
context
,
1
,
stateblock
->
renderState
[
WINED3DRS_COLORWRITEENABLE1
]);
set_color_mask
(
context
->
gl_info
,
1
,
stateblock
->
renderState
[
WINED3DRS_COLORWRITEENABLE1
]);
}
}
static
void
state_colorwrite2
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
state_colorwrite2
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
{
set_color_mask
(
context
,
2
,
stateblock
->
renderState
[
WINED3DRS_COLORWRITEENABLE2
]);
set_color_mask
(
context
->
gl_info
,
2
,
stateblock
->
renderState
[
WINED3DRS_COLORWRITEENABLE2
]);
}
}
static
void
state_colorwrite3
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
state_colorwrite3
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
{
set_color_mask
(
context
,
3
,
stateblock
->
renderState
[
WINED3DRS_COLORWRITEENABLE3
]);
set_color_mask
(
context
->
gl_info
,
3
,
stateblock
->
renderState
[
WINED3DRS_COLORWRITEENABLE3
]);
}
}
static
void
state_localviewer
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
state_localviewer
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
...
@@ -3169,6 +3180,7 @@ static void transform_texture(DWORD state, IWineD3DStateBlockImpl *stateblock, s
...
@@ -3169,6 +3180,7 @@ static void transform_texture(DWORD state, IWineD3DStateBlockImpl *stateblock, s
{
{
DWORD
texUnit
=
(
state
-
STATE_TEXTURESTAGE
(
0
,
0
))
/
(
WINED3D_HIGHEST_TEXTURE_STATE
+
1
);
DWORD
texUnit
=
(
state
-
STATE_TEXTURESTAGE
(
0
,
0
))
/
(
WINED3D_HIGHEST_TEXTURE_STATE
+
1
);
DWORD
mapped_stage
=
stateblock
->
device
->
texUnitMap
[
texUnit
];
DWORD
mapped_stage
=
stateblock
->
device
->
texUnitMap
[
texUnit
];
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
BOOL
generated
;
BOOL
generated
;
int
coordIdx
;
int
coordIdx
;
...
@@ -3180,7 +3192,7 @@ static void transform_texture(DWORD state, IWineD3DStateBlockImpl *stateblock, s
...
@@ -3180,7 +3192,7 @@ static void transform_texture(DWORD state, IWineD3DStateBlockImpl *stateblock, s
}
}
if
(
mapped_stage
==
WINED3D_UNMAPPED_STAGE
)
return
;
if
(
mapped_stage
==
WINED3D_UNMAPPED_STAGE
)
return
;
if
(
mapped_stage
>=
context
->
gl_info
->
limits
.
textures
)
return
;
if
(
mapped_stage
>=
gl_info
->
limits
.
textures
)
return
;
GL_EXTCALL
(
glActiveTextureARB
(
GL_TEXTURE0_ARB
+
mapped_stage
));
GL_EXTCALL
(
glActiveTextureARB
(
GL_TEXTURE0_ARB
+
mapped_stage
));
checkGLcall
(
"glActiveTextureARB"
);
checkGLcall
(
"glActiveTextureARB"
);
...
@@ -3209,21 +3221,20 @@ static void transform_texture(DWORD state, IWineD3DStateBlockImpl *stateblock, s
...
@@ -3209,21 +3221,20 @@ static void transform_texture(DWORD state, IWineD3DStateBlockImpl *stateblock, s
}
}
}
}
static
void
unloadTexCoords
(
const
struct
wined3d_
context
*
context
)
static
void
unloadTexCoords
(
const
struct
wined3d_
gl_info
*
gl_info
)
{
{
unsigned
int
texture_idx
;
unsigned
int
texture_idx
;
for
(
texture_idx
=
0
;
texture_idx
<
context
->
gl_info
->
limits
.
texture_stages
;
++
texture_idx
)
for
(
texture_idx
=
0
;
texture_idx
<
gl_info
->
limits
.
texture_stages
;
++
texture_idx
)
{
{
GL_EXTCALL
(
glClientActiveTextureARB
(
GL_TEXTURE0_ARB
+
texture_idx
));
GL_EXTCALL
(
glClientActiveTextureARB
(
GL_TEXTURE0_ARB
+
texture_idx
));
glDisableClientState
(
GL_TEXTURE_COORD_ARRAY
);
glDisableClientState
(
GL_TEXTURE_COORD_ARRAY
);
}
}
}
}
static
void
loadTexCoords
(
const
struct
wined3d_
context
*
context
,
IWineD3DStateBlockImpl
*
stateblock
,
static
void
loadTexCoords
(
const
struct
wined3d_
gl_info
*
gl_info
,
IWineD3DStateBlockImpl
*
stateblock
,
const
struct
wined3d_stream_info
*
si
,
GLuint
*
curVBO
)
const
struct
wined3d_stream_info
*
si
,
GLuint
*
curVBO
)
{
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
const
UINT
*
offset
=
stateblock
->
streamOffset
;
const
UINT
*
offset
=
stateblock
->
streamOffset
;
unsigned
int
mapped_stage
=
0
;
unsigned
int
mapped_stage
=
0
;
unsigned
int
textureNo
=
0
;
unsigned
int
textureNo
=
0
;
...
@@ -3443,8 +3454,8 @@ static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock, stru
...
@@ -3443,8 +3454,8 @@ static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock, stru
*/
*/
GLuint
curVBO
=
gl_info
->
supported
[
ARB_VERTEX_BUFFER_OBJECT
]
?
~
0U
:
0
;
GLuint
curVBO
=
gl_info
->
supported
[
ARB_VERTEX_BUFFER_OBJECT
]
?
~
0U
:
0
;
unloadTexCoords
(
context
);
unloadTexCoords
(
gl_info
);
loadTexCoords
(
context
,
stateblock
,
&
stateblock
->
device
->
strided_streams
,
&
curVBO
);
loadTexCoords
(
gl_info
,
stateblock
,
&
stateblock
->
device
->
strided_streams
,
&
curVBO
);
}
}
}
}
...
@@ -3772,6 +3783,7 @@ static void state_vertexblend_w(DWORD state, IWineD3DStateBlockImpl *stateblock,
...
@@ -3772,6 +3783,7 @@ static void state_vertexblend_w(DWORD state, IWineD3DStateBlockImpl *stateblock,
static
void
state_vertexblend
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
state_vertexblend
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
{
WINED3DVERTEXBLENDFLAGS
val
=
stateblock
->
renderState
[
WINED3DRS_VERTEXBLEND
];
WINED3DVERTEXBLENDFLAGS
val
=
stateblock
->
renderState
[
WINED3DRS_VERTEXBLEND
];
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
static
unsigned
int
once
;
static
unsigned
int
once
;
switch
(
val
)
{
switch
(
val
)
{
...
@@ -3789,7 +3801,7 @@ static void state_vertexblend(DWORD state, IWineD3DStateBlockImpl *stateblock, s
...
@@ -3789,7 +3801,7 @@ static void state_vertexblend(DWORD state, IWineD3DStateBlockImpl *stateblock, s
if
(
!
stateblock
->
device
->
vertexBlendUsed
)
if
(
!
stateblock
->
device
->
vertexBlendUsed
)
{
{
unsigned
int
i
;
unsigned
int
i
;
for
(
i
=
1
;
i
<
context
->
gl_info
->
limits
.
blends
;
++
i
)
for
(
i
=
1
;
i
<
gl_info
->
limits
.
blends
;
++
i
)
{
{
if
(
!
isStateDirty
(
context
,
STATE_TRANSFORM
(
WINED3DTS_WORLDMATRIX
(
i
))))
if
(
!
isStateDirty
(
context
,
STATE_TRANSFORM
(
WINED3DTS_WORLDMATRIX
(
i
))))
{
{
...
@@ -3973,10 +3985,8 @@ static void transform_projection(DWORD state, IWineD3DStateBlockImpl *stateblock
...
@@ -3973,10 +3985,8 @@ static void transform_projection(DWORD state, IWineD3DStateBlockImpl *stateblock
/* This should match any arrays loaded in loadVertexData.
/* This should match any arrays loaded in loadVertexData.
* TODO: Only load / unload arrays if we have to.
* TODO: Only load / unload arrays if we have to.
*/
*/
static
inline
void
unloadVertexData
(
const
struct
wined3d_
context
*
context
)
static
inline
void
unloadVertexData
(
const
struct
wined3d_
gl_info
*
gl_info
)
{
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
glDisableClientState
(
GL_VERTEX_ARRAY
);
glDisableClientState
(
GL_VERTEX_ARRAY
);
glDisableClientState
(
GL_NORMAL_ARRAY
);
glDisableClientState
(
GL_NORMAL_ARRAY
);
glDisableClientState
(
GL_COLOR_ARRAY
);
glDisableClientState
(
GL_COLOR_ARRAY
);
...
@@ -3988,11 +3998,13 @@ static inline void unloadVertexData(const struct wined3d_context *context)
...
@@ -3988,11 +3998,13 @@ static inline void unloadVertexData(const struct wined3d_context *context)
{
{
glDisableClientState
(
GL_WEIGHT_ARRAY_ARB
);
glDisableClientState
(
GL_WEIGHT_ARRAY_ARB
);
}
}
unloadTexCoords
(
context
);
unloadTexCoords
(
gl_info
);
}
}
static
inline
void
unload_numbered_array
(
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
,
int
i
)
static
inline
void
unload_numbered_array
(
struct
wined3d_context
*
context
,
int
i
)
{
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
GL_EXTCALL
(
glDisableVertexAttribArrayARB
(
i
));
GL_EXTCALL
(
glDisableVertexAttribArrayARB
(
i
));
checkGLcall
(
"glDisableVertexAttribArrayARB(reg)"
);
checkGLcall
(
"glDisableVertexAttribArrayARB(reg)"
);
...
@@ -4002,7 +4014,7 @@ static inline void unload_numbered_array(IWineD3DStateBlockImpl *stateblock, str
...
@@ -4002,7 +4014,7 @@ static inline void unload_numbered_array(IWineD3DStateBlockImpl *stateblock, str
/* This should match any arrays loaded in loadNumberedArrays
/* This should match any arrays loaded in loadNumberedArrays
* TODO: Only load / unload arrays if we have to.
* TODO: Only load / unload arrays if we have to.
*/
*/
static
inline
void
unloadNumberedArrays
(
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
inline
void
unloadNumberedArrays
(
struct
wined3d_context
*
context
)
{
{
/* disable any attribs (this is the same for both GLSL and ARB modes) */
/* disable any attribs (this is the same for both GLSL and ARB modes) */
GLint
maxAttribs
=
16
;
GLint
maxAttribs
=
16
;
...
@@ -4014,7 +4026,7 @@ static inline void unloadNumberedArrays(IWineD3DStateBlockImpl *stateblock, stru
...
@@ -4014,7 +4026,7 @@ static inline void unloadNumberedArrays(IWineD3DStateBlockImpl *stateblock, stru
if
(
glGetError
()
!=
GL_NO_ERROR
)
if
(
glGetError
()
!=
GL_NO_ERROR
)
maxAttribs
=
16
;
maxAttribs
=
16
;
for
(
i
=
0
;
i
<
maxAttribs
;
++
i
)
{
for
(
i
=
0
;
i
<
maxAttribs
;
++
i
)
{
unload_numbered_array
(
stateblock
,
context
,
i
);
unload_numbered_array
(
context
,
i
);
}
}
}
}
...
@@ -4034,14 +4046,14 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock,
...
@@ -4034,14 +4046,14 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock,
for
(
i
=
0
;
i
<
MAX_ATTRIBS
;
i
++
)
{
for
(
i
=
0
;
i
<
MAX_ATTRIBS
;
i
++
)
{
if
(
!
(
stream_info
->
use_map
&
(
1
<<
i
)))
if
(
!
(
stream_info
->
use_map
&
(
1
<<
i
)))
{
{
if
(
context
->
numbered_array_mask
&
(
1
<<
i
))
unload_numbered_array
(
stateblock
,
context
,
i
);
if
(
context
->
numbered_array_mask
&
(
1
<<
i
))
unload_numbered_array
(
context
,
i
);
continue
;
continue
;
}
}
/* Do not load instance data. It will be specified using glTexCoord by drawprim */
/* Do not load instance data. It will be specified using glTexCoord by drawprim */
if
(
stateblock
->
streamFlags
[
stream_info
->
elements
[
i
].
stream_idx
]
&
WINED3DSTREAMSOURCE_INSTANCEDATA
)
if
(
stateblock
->
streamFlags
[
stream_info
->
elements
[
i
].
stream_idx
]
&
WINED3DSTREAMSOURCE_INSTANCEDATA
)
{
{
if
(
context
->
numbered_array_mask
&
(
1
<<
i
))
unload_numbered_array
(
stateblock
,
context
,
i
);
if
(
context
->
numbered_array_mask
&
(
1
<<
i
))
unload_numbered_array
(
context
,
i
);
stateblock
->
device
->
instancedDraw
=
TRUE
;
stateblock
->
device
->
instancedDraw
=
TRUE
;
continue
;
continue
;
}
}
...
@@ -4103,7 +4115,7 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock,
...
@@ -4103,7 +4115,7 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock,
ptr
+=
(
ULONG_PTR
)
buffer_get_sysmem
(
vb
,
gl_info
);
ptr
+=
(
ULONG_PTR
)
buffer_get_sysmem
(
vb
,
gl_info
);
}
}
if
(
context
->
numbered_array_mask
&
(
1
<<
i
))
unload_numbered_array
(
stateblock
,
context
,
i
);
if
(
context
->
numbered_array_mask
&
(
1
<<
i
))
unload_numbered_array
(
context
,
i
);
switch
(
stream_info
->
elements
[
i
].
format_desc
->
format
)
switch
(
stream_info
->
elements
[
i
].
format_desc
->
format
)
{
{
...
@@ -4445,7 +4457,7 @@ static void loadVertexData(const struct wined3d_context *context, IWineD3DStateB
...
@@ -4445,7 +4457,7 @@ static void loadVertexData(const struct wined3d_context *context, IWineD3DStateB
}
}
/* Texture coords -------------------------------------------*/
/* Texture coords -------------------------------------------*/
loadTexCoords
(
context
,
stateblock
,
si
,
&
curVBO
);
loadTexCoords
(
gl_info
,
stateblock
,
si
,
&
curVBO
);
}
}
static
void
streamsrc
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
streamsrc
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
...
@@ -4456,13 +4468,13 @@ static void streamsrc(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wi
...
@@ -4456,13 +4468,13 @@ static void streamsrc(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wi
if
(
context
->
numberedArraysLoaded
&&
!
load_numbered
)
if
(
context
->
numberedArraysLoaded
&&
!
load_numbered
)
{
{
unloadNumberedArrays
(
stateblock
,
context
);
unloadNumberedArrays
(
context
);
context
->
numberedArraysLoaded
=
FALSE
;
context
->
numberedArraysLoaded
=
FALSE
;
context
->
numbered_array_mask
=
0
;
context
->
numbered_array_mask
=
0
;
}
}
else
if
(
context
->
namedArraysLoaded
)
else
if
(
context
->
namedArraysLoaded
)
{
{
unloadVertexData
(
context
);
unloadVertexData
(
context
->
gl_info
);
context
->
namedArraysLoaded
=
FALSE
;
context
->
namedArraysLoaded
=
FALSE
;
}
}
...
@@ -4823,6 +4835,8 @@ static void scissorrect(DWORD state, IWineD3DStateBlockImpl *stateblock, struct
...
@@ -4823,6 +4835,8 @@ static void scissorrect(DWORD state, IWineD3DStateBlockImpl *stateblock, struct
static
void
indexbuffer
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
indexbuffer
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
if
(
stateblock
->
streamIsUP
||
stateblock
->
pIndexData
==
NULL
)
{
if
(
stateblock
->
streamIsUP
||
stateblock
->
pIndexData
==
NULL
)
{
GL_EXTCALL
(
glBindBufferARB
(
GL_ELEMENT_ARRAY_BUFFER_ARB
,
0
));
GL_EXTCALL
(
glBindBufferARB
(
GL_ELEMENT_ARRAY_BUFFER_ARB
,
0
));
}
else
{
}
else
{
...
...
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