mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
wined3d: Honor the driver's min point size.
This commit is contained in:
parent
0183f3e305
commit
5ffea6e591
3 changed files with 14 additions and 7 deletions
|
@ -641,6 +641,7 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) {
|
|||
TRACE_(d3d_caps)("Maximum texture size support - max texture size=%d\n", gl_max);
|
||||
|
||||
glGetFloatv(GL_POINT_SIZE_RANGE, gl_floatv);
|
||||
gl_info->max_pointsizemin = gl_floatv[0];
|
||||
gl_info->max_pointsize = gl_floatv[1];
|
||||
TRACE_(d3d_caps)("Maximum point size support - max point size=%f\n", gl_floatv[1]);
|
||||
|
||||
|
|
|
@ -1312,14 +1312,18 @@ static void state_pscale(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3
|
|||
GLfloat scaleFactor;
|
||||
float h = stateblock->viewport.Height;
|
||||
|
||||
if(pointSize.f < 1.0f) {
|
||||
if(pointSize.f < GL_LIMITS(pointsizemin)) {
|
||||
/*
|
||||
* Minimum valid point size for OpenGL is 1.0f. For Direct3D it is 0.0f.
|
||||
* This means that OpenGL will clamp really small point sizes to 1.0f.
|
||||
* To correct for this we need to multiply by the scale factor when sizes
|
||||
* Minimum valid point size for OpenGL is driver specific. For Direct3D it is
|
||||
* 0.0f. This means that OpenGL will clamp really small point sizes to the
|
||||
* driver minimum. To correct for this we need to multiply by the scale factor when sizes
|
||||
* are less than 1.0f. scale_factor = 1.0f / point_size.
|
||||
*/
|
||||
scaleFactor = pointSize.f;
|
||||
scaleFactor = pointSize.f / GL_LIMITS(pointsizemin);
|
||||
/* Clamp the point size, don't rely on the driver to do it. MacOS says min point size
|
||||
* is 1.0, but then accepts points below that and draws too small points
|
||||
*/
|
||||
pointSize.f = GL_LIMITS(pointsizemin);
|
||||
} else if(pointSize.f > GL_LIMITS(pointsize)) {
|
||||
/* gl already scales the input to glPointSize,
|
||||
* d3d scales the result after the point size scale.
|
||||
|
|
|
@ -1137,6 +1137,7 @@ void (WINE_GLAPI *glVertex4s) (GLshort x, GLshort y, GLshort z, GLshort w);
|
|||
void (WINE_GLAPI *glVertex4sv) (const GLshort* v);
|
||||
void (WINE_GLAPI *glVertexPointer) (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
|
||||
void (WINE_GLAPI *glViewport) (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (WINE_GLAPI *glPointParameterfv) (GLenum pname, const GLfloat *params);
|
||||
|
||||
/* WGL functions */
|
||||
HGLRC (WINAPI *pwglCreateContext)(HDC);
|
||||
|
@ -1483,7 +1484,8 @@ BOOL (WINAPI *pwglShareLists)(HGLRC,HGLRC);
|
|||
USE_GL_FUNC(glVertex4s) \
|
||||
USE_GL_FUNC(glVertex4sv) \
|
||||
USE_GL_FUNC(glVertexPointer) \
|
||||
USE_GL_FUNC(glViewport)
|
||||
USE_GL_FUNC(glViewport) \
|
||||
USE_GL_FUNC(glPointParameterfv) \
|
||||
|
||||
#define WGL_FUNCS_GEN \
|
||||
USE_WGL_FUNC(wglCreateContext) \
|
||||
|
@ -3719,7 +3721,7 @@ typedef struct _WineD3D_GL_Info {
|
|||
UINT max_clipplanes;
|
||||
UINT max_texture_size;
|
||||
UINT max_texture3d_size;
|
||||
float max_pointsize;
|
||||
float max_pointsize, max_pointsizemin;
|
||||
UINT max_blends;
|
||||
UINT max_anisotropy;
|
||||
UINT max_aux_buffers;
|
||||
|
|
Loading…
Reference in a new issue