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
ef0f3588
Commit
ef0f3588
authored
Jan 07, 2011
by
Matteo Bruni
Committed by
Alexandre Julliard
Jan 07, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Don't call glPointParameter with a random context.
parent
0a973877
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
37 deletions
+39
-37
context.c
dlls/wined3d/context.c
+1
-36
state.c
dlls/wined3d/state.c
+32
-0
utils.c
dlls/wined3d/utils.c
+2
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-1
No files found.
dlls/wined3d/context.c
View file @
ef0f3588
...
...
@@ -1575,23 +1575,6 @@ struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain,
checkGLcall
(
"glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE)"
);
}
if
(
gl_info
->
supported
[
WINED3D_GL_VERSION_2_0
])
{
/* Windows doesn't support to query the glPointParameteri function pointer, so use the
* NV_POINT_SPRITE extension.
*/
if
(
glPointParameteri
)
{
glPointParameteri
(
GL_POINT_SPRITE_COORD_ORIGIN
,
GL_UPPER_LEFT
);
checkGLcall
(
"glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_UPPER_LEFT)"
);
}
else
if
(
gl_info
->
supported
[
NV_POINT_SPRITE
])
{
GL_EXTCALL
(
glPointParameteriNV
(
GL_POINT_SPRITE_COORD_ORIGIN
,
GL_UPPER_LEFT
));
checkGLcall
(
"glPointParameteriNV(GL_POINT_SPRITE_COORD_ORIGIN, GL_UPPER_LEFT)"
);
}
}
if
(
gl_info
->
supported
[
ARB_PROVOKING_VERTEX
])
{
GL_EXTCALL
(
glProvokingVertex
(
GL_FIRST_VERTEX_CONVENTION
));
...
...
@@ -2019,27 +2002,9 @@ void context_set_draw_buffer(struct wined3d_context *context, GLenum buffer)
static
inline
void
context_set_render_offscreen
(
struct
wined3d_context
*
context
,
const
struct
StateEntry
*
StateTable
,
BOOL
offscreen
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
if
(
context
->
render_offscreen
==
offscreen
)
return
;
if
(
gl_info
->
supported
[
WINED3D_GL_VERSION_2_0
])
{
/* Windows doesn't support to query the glPointParameteri function pointer, so use the
* NV_POINT_SPRITE extension.
*/
if
(
glPointParameteri
)
{
glPointParameteri
(
GL_POINT_SPRITE_COORD_ORIGIN
,
offscreen
?
GL_LOWER_LEFT
:
GL_UPPER_LEFT
);
checkGLcall
(
"glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, ...)"
);
}
else
if
(
gl_info
->
supported
[
NV_POINT_SPRITE
])
{
GL_EXTCALL
(
glPointParameteriNV
(
GL_POINT_SPRITE_COORD_ORIGIN
,
offscreen
?
GL_LOWER_LEFT
:
GL_UPPER_LEFT
));
checkGLcall
(
"glPointParameteriNV(GL_POINT_SPRITE_COORD_ORIGIN, ...)"
);
}
}
Context_MarkStateDirty
(
context
,
STATE_POINTSPRITECOORDORIGIN
,
StateTable
);
Context_MarkStateDirty
(
context
,
STATE_TRANSFORM
(
WINED3DTS_PROJECTION
),
StateTable
);
Context_MarkStateDirty
(
context
,
STATE_VDECL
,
StateTable
);
Context_MarkStateDirty
(
context
,
STATE_VIEWPORT
,
StateTable
);
...
...
dlls/wined3d/state.c
View file @
ef0f3588
...
...
@@ -4963,6 +4963,34 @@ static void frontface(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wi
}
}
static
void
psorigin_w
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
static
BOOL
warned
;
if
(
!
warned
)
{
WARN
(
"Point sprite coordinate origin switching not supported.
\n
"
);
warned
=
TRUE
;
}
}
static
void
psorigin
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
GLint
origin
=
context
->
render_offscreen
?
GL_LOWER_LEFT
:
GL_UPPER_LEFT
;
if
(
glPointParameteri
)
{
glPointParameteri
(
GL_POINT_SPRITE_COORD_ORIGIN
,
origin
);
checkGLcall
(
"glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, ...)"
);
}
else
if
(
gl_info
->
supported
[
NV_POINT_SPRITE
])
{
GL_EXTCALL
(
glPointParameteriNV
(
GL_POINT_SPRITE_COORD_ORIGIN
,
origin
));
checkGLcall
(
"glPointParameteriNV(GL_POINT_SPRITE_COORD_ORIGIN, ...)"
);
}
}
const
struct
StateEntryTemplate
misc_state_template
[]
=
{
{
STATE_RENDER
(
WINED3DRS_SRCBLEND
),
{
STATE_RENDER
(
WINED3DRS_ALPHABLENDENABLE
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3DRS_DESTBLEND
),
{
STATE_RENDER
(
WINED3DRS_ALPHABLENDENABLE
),
NULL
},
WINED3D_GL_EXT_NONE
},
...
...
@@ -4978,6 +5006,9 @@ const struct StateEntryTemplate misc_state_template[] = {
{
STATE_VDECL
,
{
STATE_VDECL
,
streamsrc
},
WINED3D_GL_EXT_NONE
},
{
STATE_FRONTFACE
,
{
STATE_FRONTFACE
,
frontface
},
WINED3D_GL_EXT_NONE
},
{
STATE_SCISSORRECT
,
{
STATE_SCISSORRECT
,
scissorrect
},
WINED3D_GL_EXT_NONE
},
{
STATE_POINTSPRITECOORDORIGIN
,
{
STATE_POINTSPRITECOORDORIGIN
,
psorigin
},
WINED3D_GL_VERSION_2_0
},
{
STATE_POINTSPRITECOORDORIGIN
,
{
STATE_POINTSPRITECOORDORIGIN
,
psorigin_w
},
WINED3D_GL_EXT_NONE
},
/* TODO: Move shader constant loading to vertex and fragment pipeline repectively, as soon as the pshader and
* vshader loadings are untied from each other
*/
...
...
@@ -5810,6 +5841,7 @@ static void validate_state_table(struct StateEntry *state_table)
STATE_VIEWPORT
,
STATE_SCISSORRECT
,
STATE_FRONTFACE
,
STATE_POINTSPRITECOORDORIGIN
,
};
unsigned
int
i
,
current
;
...
...
dlls/wined3d/utils.c
View file @
ef0f3588
...
...
@@ -2212,6 +2212,8 @@ const char *debug_d3dstate(DWORD state)
return
"STATE_MATERIAL"
;
if
(
STATE_IS_FRONTFACE
(
state
))
return
"STATE_FRONTFACE"
;
if
(
STATE_IS_POINTSPRITECOORDORIGIN
(
state
))
return
"STATE_POINTSPRITECOORDORIGIN"
;
return
wine_dbg_sprintf
(
"UNKNOWN_STATE(%#x)"
,
state
);
}
...
...
dlls/wined3d/wined3d_private.h
View file @
ef0f3588
...
...
@@ -992,7 +992,10 @@ extern glMultiTexCoordFunc multi_texcoord_funcs[WINED3D_FFP_EMIT_COUNT] DECLSPEC
#define STATE_FRONTFACE (STATE_MATERIAL + 1)
#define STATE_IS_FRONTFACE(a) ((a) == STATE_FRONTFACE)
#define STATE_HIGHEST (STATE_FRONTFACE)
#define STATE_POINTSPRITECOORDORIGIN (STATE_FRONTFACE + 1)
#define STATE_IS_POINTSPRITECOORDORIGIN(a) ((a) == STATE_POINTSPRITECOORDORIGIN)
#define STATE_HIGHEST (STATE_POINTSPRITECOORDORIGIN)
enum
fogsource
{
FOGSOURCE_FFP
,
...
...
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