Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c186939f
Commit
c186939f
authored
Jun 02, 2015
by
Matteo Bruni
Committed by
Alexandre Julliard
Jun 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Clamp per-vertex point size in vertex shaders.
parent
e8cb3bdb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
glsl_shader.c
dlls/wined3d/glsl_shader.c
+17
-6
No files found.
dlls/wined3d/glsl_shader.c
View file @
c186939f
...
...
@@ -4925,7 +4925,7 @@ static void handle_ps3_input(struct shader_glsl_priv *priv,
/* Context activation is done by the caller. */
static
GLuint
generate_param_reorder_function
(
struct
shader_glsl_priv
*
priv
,
const
struct
wined3d_shader
*
vs
,
const
struct
wined3d_shader
*
ps
,
const
struct
wined3d_gl_info
*
gl_info
)
BOOL
per_vertex_point_size
,
const
struct
wined3d_gl_info
*
gl_info
)
{
struct
wined3d_string_buffer
*
buffer
=
&
priv
->
shader_buffer
;
GLuint
ret
=
0
;
...
...
@@ -4939,6 +4939,14 @@ static GLuint generate_param_reorder_function(struct shader_glsl_priv *priv,
shader_addline
(
buffer
,
"%s
\n
"
,
shader_glsl_get_version
(
gl_info
,
&
vs
->
reg_maps
.
shader_version
));
if
(
per_vertex_point_size
)
{
shader_addline
(
buffer
,
"uniform struct
\n
{
\n
"
);
shader_addline
(
buffer
,
" float size_min;
\n
"
);
shader_addline
(
buffer
,
" float size_max;
\n
"
);
shader_addline
(
buffer
,
"} ffp_point;
\n
"
);
}
if
(
ps_major
<
3
)
{
shader_addline
(
buffer
,
"void order_ps_input(in vec4 vs_out[%u])
\n
{
\n
"
,
vs
->
limits
->
packed_output
);
...
...
@@ -4983,9 +4991,10 @@ static GLuint generate_param_reorder_function(struct shader_glsl_priv *priv,
shader_addline
(
buffer
,
"gl_TexCoord[%u].w = 1.0;
\n
"
,
semantic_idx
);
}
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D_DECL_USAGE_PSIZE
))
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D_DECL_USAGE_PSIZE
)
&&
per_vertex_point_size
)
{
shader_addline
(
buffer
,
"gl_PointSize = vs_out[%u].%c;
\n
"
,
output
->
register_idx
,
reg_mask
[
1
]);
shader_addline
(
buffer
,
"gl_PointSize = clamp(vs_out[%u].%c, ffp_point.size_min, ffp_point.size_max);
\n
"
,
output
->
register_idx
,
reg_mask
[
1
]);
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D_DECL_USAGE_FOG
))
{
...
...
@@ -5019,9 +5028,10 @@ static GLuint generate_param_reorder_function(struct shader_glsl_priv *priv,
shader_addline
(
buffer
,
"gl_Position%s = vs_out[%u]%s;
\n
"
,
reg_mask
,
output
->
register_idx
,
reg_mask
);
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D_DECL_USAGE_PSIZE
))
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D_DECL_USAGE_PSIZE
)
&&
per_vertex_point_size
)
{
shader_addline
(
buffer
,
"gl_PointSize = vs_out[%u].%c;
\n
"
,
output
->
register_idx
,
reg_mask
[
1
]);
shader_addline
(
buffer
,
"gl_PointSize = clamp(vs_out[%u].%c, ffp_point.size_min, ffp_point.size_max);
\n
"
,
output
->
register_idx
,
reg_mask
[
1
]);
}
}
...
...
@@ -6711,7 +6721,8 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const
WORD
map
=
vshader
->
reg_maps
.
input_registers
;
struct
wined3d_string_buffer
*
tmp_name
=
string_buffer_get
(
&
priv
->
string_buffers
);
reorder_shader_id
=
generate_param_reorder_function
(
priv
,
vshader
,
pshader
,
gl_info
);
reorder_shader_id
=
generate_param_reorder_function
(
priv
,
vshader
,
pshader
,
state
->
gl_primitive_type
==
GL_POINTS
&&
vshader
->
reg_maps
.
point_size
,
gl_info
);
TRACE
(
"Attaching GLSL shader object %u to program %u.
\n
"
,
reorder_shader_id
,
program_id
);
GL_EXTCALL
(
glAttachShader
(
program_id
,
reorder_shader_id
));
checkGLcall
(
"glAttachShader"
);
...
...
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