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
c0068b33
Commit
c0068b33
authored
Oct 24, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d/glsl: Clamp ftou upper bound to UINT_MAX.
Ported from cc893a3368bd8a8a3f638ddde7b97d3819a6b43d in vkd3d.
parent
9921a236
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
adapter_gl.c
dlls/wined3d/adapter_gl.c
+2
-0
glsl_shader.c
dlls/wined3d/glsl_shader.c
+8
-3
wined3d_gl.h
dlls/wined3d/wined3d_gl.h
+1
-0
No files found.
dlls/wined3d/adapter_gl.c
View file @
c0068b33
...
...
@@ -194,6 +194,7 @@ static const struct wined3d_extension_map gl_extension_map[] =
{
"GL_EXT_polygon_offset_clamp"
,
ARB_POLYGON_OFFSET_CLAMP
},
{
"GL_EXT_provoking_vertex"
,
EXT_PROVOKING_VERTEX
},
{
"GL_EXT_secondary_color"
,
EXT_SECONDARY_COLOR
},
{
"GL_EXT_shader_integer_mix"
,
EXT_SHADER_INTEGER_MIX
},
{
"GL_EXT_stencil_two_side"
,
EXT_STENCIL_TWO_SIDE
},
{
"GL_EXT_stencil_wrap"
,
EXT_STENCIL_WRAP
},
{
"GL_EXT_texture3D"
,
EXT_TEXTURE3D
},
...
...
@@ -3391,6 +3392,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter_gl *adapter_gl,
{
ARB_DERIVATIVE_CONTROL
,
MAKEDWORD_VERSION
(
4
,
5
)},
{
ARB_SHADER_TEXTURE_IMAGE_SAMPLES
,
MAKEDWORD_VERSION
(
4
,
5
)},
{
ARB_TEXTURE_BARRIER
,
MAKEDWORD_VERSION
(
4
,
5
)},
{
EXT_SHADER_INTEGER_MIX
,
MAKEDWORD_VERSION
(
4
,
5
)},
{
ARB_PIPELINE_STATISTICS_QUERY
,
MAKEDWORD_VERSION
(
4
,
6
)},
{
ARB_POLYGON_OFFSET_CLAMP
,
MAKEDWORD_VERSION
(
4
,
6
)},
...
...
dlls/wined3d/glsl_shader.c
View file @
c0068b33
...
...
@@ -4338,9 +4338,11 @@ static void shader_glsl_to_uint(const struct wined3d_shader_instruction *ins)
shader_glsl_add_src_param
(
ins
,
&
ins
->
src
[
0
],
write_mask
,
&
src_param
);
if
(
mask_size
>
1
)
shader_addline
(
buffer
,
"uvec%u(max(%s, vec%u(0.0))));
\n
"
,
mask_size
,
src_param
.
param_str
,
mask_size
);
shader_addline
(
buffer
,
"mix(uvec%u(max(%s, vec%u(0.0))), uvec%u(0xffffffffu), greaterThanEqual(%s, vec%u(4294967296.0))));
\n
"
,
mask_size
,
src_param
.
param_str
,
mask_size
,
mask_size
,
src_param
.
param_str
,
mask_size
);
else
shader_addline
(
buffer
,
"uint(max(%s, 0)));
\n
"
,
src_param
.
param_str
);
shader_addline
(
buffer
,
"mix(uint(max(%s, 0.0)), 0xffffffffu, %s >= 4294967296.0));
\n
"
,
src_param
.
param_str
,
src_param
.
param_str
);
}
static
void
shader_glsl_to_float
(
const
struct
wined3d_shader_instruction
*
ins
)
...
...
@@ -7564,6 +7566,8 @@ static void shader_glsl_enable_extensions(struct wined3d_string_buffer *buffer,
shader_addline
(
buffer
,
"#extension GL_ARB_viewport_array : enable
\n
"
);
if
(
gl_info
->
supported
[
EXT_GPU_SHADER4
])
shader_addline
(
buffer
,
"#extension GL_EXT_gpu_shader4 : enable
\n
"
);
if
(
gl_info
->
supported
[
EXT_SHADER_INTEGER_MIX
])
shader_addline
(
buffer
,
"#extension GL_EXT_shader_integer_mix : enable
\n
"
);
if
(
gl_info
->
supported
[
EXT_TEXTURE_ARRAY
])
shader_addline
(
buffer
,
"#extension GL_EXT_texture_array : enable
\n
"
);
if
(
gl_info
->
supported
[
EXT_TEXTURE_SHADOW_LOD
])
...
...
@@ -11168,7 +11172,8 @@ static unsigned int shader_glsl_get_shader_model(const struct wined3d_gl_info *g
{
BOOL
shader_model_4
=
gl_info
->
glsl_version
>=
MAKEDWORD_VERSION
(
1
,
50
)
&&
gl_info
->
supported
[
ARB_SHADER_BIT_ENCODING
]
&&
gl_info
->
supported
[
ARB_TEXTURE_SWIZZLE
];
&&
gl_info
->
supported
[
ARB_TEXTURE_SWIZZLE
]
&&
gl_info
->
supported
[
EXT_SHADER_INTEGER_MIX
];
if
(
shader_model_4
&&
gl_info
->
supported
[
ARB_COMPUTE_SHADER
]
...
...
dlls/wined3d/wined3d_gl.h
View file @
c0068b33
...
...
@@ -184,6 +184,7 @@ enum wined3d_gl_extension
EXT_POINT_PARAMETERS
,
EXT_PROVOKING_VERTEX
,
EXT_SECONDARY_COLOR
,
EXT_SHADER_INTEGER_MIX
,
EXT_STENCIL_TWO_SIDE
,
EXT_STENCIL_WRAP
,
EXT_TEXTURE3D
,
...
...
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