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
4ed7bb35
Commit
4ed7bb35
authored
Oct 28, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 06, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d/glsl: Pass through the specular varying when SPECULARENABLE is FALSE.
parent
b5a252bc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
15 deletions
+14
-15
visual.c
dlls/d3d8/tests/visual.c
+2
-2
glsl_shader.c
dlls/wined3d/glsl_shader.c
+9
-12
utils.c
dlls/wined3d/utils.c
+1
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-1
No files found.
dlls/d3d8/tests/visual.c
View file @
4ed7bb35
...
...
@@ -12342,7 +12342,7 @@ static void test_specular_shaders(void)
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_EndScene
(
device
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
check_rt_color
_todo
(
context
.
backbuffer
,
0x00007f00
);
check_rt_color
(
context
.
backbuffer
,
0x00007f00
);
hr
=
IDirect3DDevice8_BeginScene
(
device
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
...
...
@@ -12352,7 +12352,7 @@ static void test_specular_shaders(void)
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DDevice8_EndScene
(
device
);
ok
(
hr
==
S_OK
,
"Got hr %#lx.
\n
"
,
hr
);
check_rt_color
_todo
(
context
.
backbuffer
,
0x00007f00
);
check_rt_color
(
context
.
backbuffer
,
0x00007f00
);
/* Vertex shader and pixel shader. */
...
...
dlls/wined3d/glsl_shader.c
View file @
4ed7bb35
...
...
@@ -1359,17 +1359,8 @@ static void shader_glsl_ffp_vertex_material_uniform(const struct wined3d_context
{
const
struct
wined3d_gl_info
*
gl_info
=
context_gl
->
gl_info
;
if
(
state
->
render_states
[
WINED3D_RS_SPECULARENABLE
])
{
GL_EXTCALL
(
glUniform4fv
(
prog
->
vs
.
material_specular_location
,
1
,
&
state
->
material
.
specular
.
r
));
GL_EXTCALL
(
glUniform1f
(
prog
->
vs
.
material_shininess_location
,
state
->
material
.
power
));
}
else
{
static
const
float
black
[]
=
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
};
GL_EXTCALL
(
glUniform4fv
(
prog
->
vs
.
material_specular_location
,
1
,
black
));
}
GL_EXTCALL
(
glUniform4fv
(
prog
->
vs
.
material_ambient_location
,
1
,
&
state
->
material
.
ambient
.
r
));
GL_EXTCALL
(
glUniform4fv
(
prog
->
vs
.
material_diffuse_location
,
1
,
&
state
->
material
.
diffuse
.
r
));
GL_EXTCALL
(
glUniform4fv
(
prog
->
vs
.
material_emissive_location
,
1
,
&
state
->
material
.
emissive
.
r
));
...
...
@@ -8881,6 +8872,7 @@ static void shader_glsl_ffp_vertex_lighting_footer(struct wined3d_string_buffer
shader_addline
(
buffer
,
"t = dot(normal, ffp_normalize(dir - ffp_normalize(ec_pos.xyz)));
\n
"
);
else
shader_addline
(
buffer
,
"t = dot(normal, ffp_normalize(dir + vec3(0.0, 0.0, -1.0)));
\n
"
);
if
(
settings
->
specular_enable
)
shader_addline
(
buffer
,
"if (dot(dir, normal) > 0.0 && t > 0.0%s) specular +="
" pow(t, ffp_material.shininess) * ffp_light[%u].specular * att;
\n
"
,
legacy_lighting
?
" && ffp_material.shininess > 0.0"
:
""
,
idx
);
...
...
@@ -8901,10 +8893,12 @@ static void shader_glsl_ffp_vertex_lighting(struct wined3d_string_buffer *buffer
shader_addline
(
buffer
,
"vec3 ambient = ffp_light_ambient;
\n
"
);
shader_addline
(
buffer
,
"vec3 diffuse = vec3(0.0);
\n
"
);
shader_addline
(
buffer
,
"vec4 specular = vec4(0.0);
\n
"
);
shader_addline
(
buffer
,
"vec3 dir, dst;
\n
"
);
shader_addline
(
buffer
,
"float att, t;
\n
"
);
if
(
settings
->
specular_enable
)
shader_addline
(
buffer
,
"vec4 specular = vec4(0.0);
\n
"
);
ambient
=
shader_glsl_ffp_mcs
(
settings
->
ambient_source
,
"ffp_material.ambient"
);
diffuse
=
shader_glsl_ffp_mcs
(
settings
->
diffuse_source
,
"ffp_material.diffuse"
);
specular
=
shader_glsl_ffp_mcs
(
settings
->
specular_source
,
"ffp_material.specular"
);
...
...
@@ -9006,7 +9000,10 @@ static void shader_glsl_ffp_vertex_lighting(struct wined3d_string_buffer *buffer
shader_addline
(
buffer
,
"ffp_varying_diffuse.xyz = %s.xyz * ambient + %s.xyz * diffuse + %s.xyz;
\n
"
,
ambient
,
diffuse
,
emissive
);
shader_addline
(
buffer
,
"ffp_varying_diffuse.w = %s.w;
\n
"
,
diffuse
);
if
(
settings
->
specular_enable
)
shader_addline
(
buffer
,
"ffp_varying_specular = %s * specular;
\n
"
,
specular
);
else
shader_addline
(
buffer
,
"ffp_varying_specular = ffp_attrib_specular;
\n
"
);
}
/* Context activation is done by the caller. */
...
...
@@ -11917,8 +11914,7 @@ static const struct wined3d_state_entry_template glsl_vertex_pipe_vp_states[] =
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_HULL
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_HULL
),
glsl_vertex_pipe_hs
},
WINED3D_GL_EXT_NONE
},
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_GEOMETRY
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_GEOMETRY
),
glsl_vertex_pipe_geometry_shader
},
WINED3D_GL_EXT_NONE
},
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
glsl_vertex_pipe_pixel_shader
},
WINED3D_GL_EXT_NONE
},
{
STATE_MATERIAL
,
{
STATE_RENDER
(
WINED3D_RS_SPECULARENABLE
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_SPECULARENABLE
),
{
STATE_RENDER
(
WINED3D_RS_SPECULARENABLE
),
glsl_vertex_pipe_material
},
WINED3D_GL_EXT_NONE
},
{
STATE_MATERIAL
,
{
STATE_MATERIAL
,
glsl_vertex_pipe_material
},
WINED3D_GL_EXT_NONE
},
/* Clip planes */
{
STATE_CLIPPLANE
(
0
),
{
STATE_CLIPPLANE
(
0
),
glsl_vertex_pipe_clip_plane
},
WINED3D_GLSL_130
},
{
STATE_CLIPPLANE
(
0
),
{
STATE_CLIPPLANE
(
0
),
clipplane
},
WINED3D_GL_EXT_NONE
},
...
...
@@ -11996,6 +11992,7 @@ static const struct wined3d_state_entry_template glsl_vertex_pipe_vp_states[] =
{
STATE_RENDER
(
WINED3D_RS_AMBIENTMATERIALSOURCE
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_VERTEX
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_EMISSIVEMATERIALSOURCE
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_VERTEX
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_VERTEXBLEND
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_VERTEX
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_SPECULARENABLE
),
{
STATE_RENDER
(
WINED3D_RS_SPECULARENABLE
),
glsl_vertex_pipe_shader
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_POINTSIZE
),
{
STATE_RENDER
(
WINED3D_RS_POINTSIZE_MIN
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_POINTSIZE_MIN
),
{
STATE_RENDER
(
WINED3D_RS_POINTSIZE_MIN
),
glsl_vertex_pipe_pointsize
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_POINTSPRITEENABLE
),
{
STATE_RENDER
(
WINED3D_RS_POINTSPRITEENABLE
),
state_pointsprite
},
ARB_POINT_SPRITE
},
...
...
dlls/wined3d/utils.c
View file @
4ed7bb35
...
...
@@ -6749,6 +6749,7 @@ void wined3d_ffp_get_vs_settings(const struct wined3d_context *context,
settings
->
normalize
=
settings
->
normal
&&
state
->
render_states
[
WINED3D_RS_NORMALIZENORMALS
];
settings
->
lighting
=
!!
state
->
render_states
[
WINED3D_RS_LIGHTING
];
settings
->
localviewer
=
!!
state
->
render_states
[
WINED3D_RS_LOCALVIEWER
];
settings
->
specular_enable
=
!!
state
->
render_states
[
WINED3D_RS_SPECULARENABLE
];
settings
->
point_size
=
state
->
primitive_type
==
WINED3D_PT_POINTLIST
;
settings
->
per_vertex_point_size
=
!!
(
si
->
use_map
&
1u
<<
WINED3D_FFP_PSIZE
);
...
...
dlls/wined3d/wined3d_private.h
View file @
4ed7bb35
...
...
@@ -2761,7 +2761,8 @@ struct wined3d_ffp_vs_settings
DWORD
texcoords
:
8
;
/* WINED3D_MAX_FFP_TEXTURES */
DWORD
ortho_fog
:
1
;
DWORD
flatshading
:
1
;
DWORD
padding
:
18
;
DWORD
specular_enable
:
1
;
DWORD
padding
:
17
;
DWORD
swizzle_map
;
/* MAX_ATTRIBS, 32 */
...
...
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