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
953a4530
Commit
953a4530
authored
May 28, 2015
by
Matteo Bruni
Committed by
Alexandre Julliard
May 29, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce a get_pointsize() function.
parent
36520c3e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
27 deletions
+38
-27
state.c
dlls/wined3d/state.c
+4
-27
utils.c
dlls/wined3d/utils.c
+32
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/state.c
View file @
953a4530
...
...
@@ -1458,33 +1458,10 @@ void state_psizemin_arb(struct wined3d_context *context, const struct wined3d_st
void
state_pscale
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
/* TODO: Group this with the viewport */
/*
* POINTSCALEENABLE controls how point size value is treated. If set to
* true, the point size is scaled with respect to height of viewport.
* When set to false point size is in pixels.
*/
/* Default values */
GLfloat
att
[
3
]
=
{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
};
union
{
DWORD
d
;
float
f
;
}
pointSize
,
A
,
B
,
C
;
float
att
[
3
];
float
pointsize
;
pointSize
.
d
=
state
->
render_states
[
WINED3D_RS_POINTSIZE
];
A
.
d
=
state
->
render_states
[
WINED3D_RS_POINTSCALE_A
];
B
.
d
=
state
->
render_states
[
WINED3D_RS_POINTSCALE_B
];
C
.
d
=
state
->
render_states
[
WINED3D_RS_POINTSCALE_C
];
if
(
state
->
render_states
[
WINED3D_RS_POINTSCALEENABLE
])
{
float
scale_factor
=
state
->
viewport
.
height
*
state
->
viewport
.
height
;
att
[
0
]
=
A
.
f
/
scale_factor
;
att
[
1
]
=
B
.
f
/
scale_factor
;
att
[
2
]
=
C
.
f
/
scale_factor
;
}
get_pointsize
(
context
,
state
,
&
pointsize
,
att
);
if
(
gl_info
->
supported
[
ARB_POINT_PARAMETERS
])
{
...
...
@@ -1501,7 +1478,7 @@ void state_pscale(struct wined3d_context *context, const struct wined3d_state *s
WARN
(
"POINT_PARAMETERS not supported in this version of opengl
\n
"
);
}
gl_info
->
gl_ops
.
gl
.
p_glPointSize
(
max
(
point
Size
.
f
,
FLT_MIN
));
gl_info
->
gl_ops
.
gl
.
p_glPointSize
(
max
(
point
size
,
FLT_MIN
));
checkGLcall
(
"glPointSize(...);"
);
}
...
...
dlls/wined3d/utils.c
View file @
953a4530
...
...
@@ -3622,6 +3622,38 @@ void get_pointsize_minmax(const struct wined3d_context *context, const struct wi
*
out_max
=
max
.
f
;
}
void
get_pointsize
(
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
float
*
out_pointsize
,
float
*
out_att
)
{
/* POINTSCALEENABLE controls how point size value is treated. If set to
* true, the point size is scaled with respect to height of viewport.
* When set to false point size is in pixels. */
union
{
DWORD
d
;
float
f
;
}
pointsize
,
a
,
b
,
c
;
out_att
[
0
]
=
1
.
0
f
;
out_att
[
1
]
=
0
.
0
f
;
out_att
[
2
]
=
0
.
0
f
;
pointsize
.
d
=
state
->
render_states
[
WINED3D_RS_POINTSIZE
];
a
.
d
=
state
->
render_states
[
WINED3D_RS_POINTSCALE_A
];
b
.
d
=
state
->
render_states
[
WINED3D_RS_POINTSCALE_B
];
c
.
d
=
state
->
render_states
[
WINED3D_RS_POINTSCALE_C
];
if
(
state
->
render_states
[
WINED3D_RS_POINTSCALEENABLE
])
{
float
scale_factor
=
state
->
viewport
.
height
*
state
->
viewport
.
height
;
out_att
[
0
]
=
a
.
f
/
scale_factor
;
out_att
[
1
]
=
b
.
f
/
scale_factor
;
out_att
[
2
]
=
c
.
f
/
scale_factor
;
}
*
out_pointsize
=
pointsize
.
f
;
}
/* This small helper function is used to convert a bitmask into the number of masked bits */
unsigned
int
count_bits
(
unsigned
int
mask
)
{
...
...
dlls/wined3d/wined3d_private.h
View file @
953a4530
...
...
@@ -3072,6 +3072,8 @@ void get_texture_matrix(const struct wined3d_context *context, const struct wine
unsigned
int
tex
,
struct
wined3d_matrix
*
mat
)
DECLSPEC_HIDDEN
;
void
get_pointsize_minmax
(
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
float
*
out_min
,
float
*
out_max
)
DECLSPEC_HIDDEN
;
void
get_pointsize
(
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
float
*
out_pointsize
,
float
*
out_att
)
DECLSPEC_HIDDEN
;
/* Using additional shader constants (uniforms in GLSL / program environment
* or local parameters in ARB) is costly:
...
...
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