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
1c2392dd
Commit
1c2392dd
authored
May 29, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
May 29, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Only write gl_PointSize for point primitives in shader_glsl_generate_ffp_vertex_shader().
parent
2014141a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
10 deletions
+37
-10
device.c
dlls/wined3d/device.c
+8
-1
glsl_shader.c
dlls/wined3d/glsl_shader.c
+8
-4
state.c
dlls/wined3d/state.c
+3
-1
stateblock.c
dlls/wined3d/stateblock.c
+8
-2
utils.c
dlls/wined3d/utils.c
+4
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+6
-2
No files found.
dlls/wined3d/device.c
View file @
1c2392dd
...
...
@@ -3981,10 +3981,17 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou
void
CDECL
wined3d_device_set_primitive_type
(
struct
wined3d_device
*
device
,
enum
wined3d_primitive_type
primitive_type
)
{
GLenum
gl_primitive_type
,
prev
;
TRACE
(
"device %p, primitive_type %s
\n
"
,
device
,
debug_d3dprimitivetype
(
primitive_type
));
device
->
updateStateBlock
->
changed
.
primitive_type
=
TRUE
;
device
->
updateStateBlock
->
state
.
gl_primitive_type
=
gl_primitive_type_from_d3d
(
primitive_type
);
gl_primitive_type
=
gl_primitive_type_from_d3d
(
primitive_type
);
prev
=
device
->
updateStateBlock
->
state
.
gl_primitive_type
;
device
->
updateStateBlock
->
state
.
gl_primitive_type
=
gl_primitive_type
;
if
(
!
device
->
isRecordingState
&&
gl_primitive_type
!=
prev
&&
(
gl_primitive_type
==
GL_POINTS
||
prev
==
GL_POINTS
))
device_invalidate_state
(
device
,
STATE_POINT_SIZE_ENABLE
);
}
void
CDECL
wined3d_device_get_primitive_type
(
const
struct
wined3d_device
*
device
,
...
...
dlls/wined3d/glsl_shader.c
View file @
1c2392dd
...
...
@@ -5007,10 +5007,13 @@ static GLhandleARB shader_glsl_generate_ffp_vertex_shader(struct wined3d_shader_
break
;
}
shader_addline
(
buffer
,
"gl_PointSize = gl_Point.size / sqrt(gl_Point.distanceConstantAttenuation"
" + gl_Point.distanceLinearAttenuation * length(ec_pos.xyz)"
" + gl_Point.distanceQuadraticAttenuation * dot(ec_pos.xyz, ec_pos.xyz));
\n
"
);
shader_addline
(
buffer
,
"gl_PointSize = clamp(gl_PointSize, gl_Point.sizeMin, gl_Point.sizeMax);
\n
"
);
if
(
settings
->
point_size
)
{
shader_addline
(
buffer
,
"gl_PointSize = gl_Point.size / sqrt(gl_Point.distanceConstantAttenuation"
" + gl_Point.distanceLinearAttenuation * length(ec_pos.xyz)"
" + gl_Point.distanceQuadraticAttenuation * dot(ec_pos.xyz, ec_pos.xyz));
\n
"
);
shader_addline
(
buffer
,
"gl_PointSize = clamp(gl_PointSize, gl_Point.sizeMin, gl_Point.sizeMax);
\n
"
);
}
shader_addline
(
buffer
,
"}
\n
"
);
...
...
@@ -6871,6 +6874,7 @@ static const struct StateEntryTemplate glsl_vertex_pipe_vp_states[] =
{
STATE_SAMPLER
(
7
),
{
0
,
NULL
},
ARB_TEXTURE_NON_POWER_OF_TWO
},
{
STATE_SAMPLER
(
7
),
{
0
,
NULL
},
WINED3D_GL_NORMALIZED_TEXRECT
},
{
STATE_SAMPLER
(
7
),
{
STATE_SAMPLER
(
7
),
sampler_texmatrix
},
WINED3D_GL_EXT_NONE
},
{
STATE_POINT_SIZE_ENABLE
,
{
STATE_RENDER
(
WINED3D_RS_FOGENABLE
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
0
/* Terminate */
,
{
0
,
NULL
},
WINED3D_GL_EXT_NONE
},
};
...
...
dlls/wined3d/state.c
View file @
1c2392dd
...
...
@@ -5526,6 +5526,7 @@ const struct StateEntryTemplate vp_ffp_states[] =
{
STATE_SAMPLER
(
7
),
{
0
,
NULL
},
ARB_TEXTURE_NON_POWER_OF_TWO
},
{
STATE_SAMPLER
(
7
),
{
0
,
NULL
},
WINED3D_GL_NORMALIZED_TEXRECT
},
{
STATE_SAMPLER
(
7
),
{
STATE_SAMPLER
(
7
),
sampler_texmatrix
},
WINED3D_GL_EXT_NONE
},
{
STATE_POINT_SIZE_ENABLE
,
{
STATE_POINT_SIZE_ENABLE
,
state_nop
},
WINED3D_GL_EXT_NONE
},
{
0
/* Terminate */
,
{
0
,
0
},
WINED3D_GL_EXT_NONE
},
};
...
...
@@ -5869,7 +5870,8 @@ static void validate_state_table(struct StateEntry *state_table)
STATE_FRONTFACE
,
STATE_POINTSPRITECOORDORIGIN
,
STATE_BASEVERTEXINDEX
,
STATE_FRAMEBUFFER
STATE_FRAMEBUFFER
,
STATE_POINT_SIZE_ENABLE
,
};
unsigned
int
i
,
current
;
...
...
dlls/wined3d/stateblock.c
View file @
1c2392dd
...
...
@@ -1073,8 +1073,14 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
if
(
stateblock
->
changed
.
primitive_type
)
{
stateblock
->
device
->
updateStateBlock
->
changed
.
primitive_type
=
TRUE
;
stateblock
->
device
->
updateStateBlock
->
state
.
gl_primitive_type
=
stateblock
->
state
.
gl_primitive_type
;
GLenum
gl_primitive_type
,
prev
;
device
->
updateStateBlock
->
changed
.
primitive_type
=
TRUE
;
gl_primitive_type
=
stateblock
->
state
.
gl_primitive_type
;
prev
=
device
->
updateStateBlock
->
state
.
gl_primitive_type
;
device
->
updateStateBlock
->
state
.
gl_primitive_type
=
gl_primitive_type
;
if
(
gl_primitive_type
!=
prev
&&
(
gl_primitive_type
==
GL_POINTS
||
prev
==
GL_POINTS
))
device_invalidate_state
(
device
,
STATE_POINT_SIZE_ENABLE
);
}
if
(
stateblock
->
changed
.
indices
)
...
...
dlls/wined3d/utils.c
View file @
1c2392dd
...
...
@@ -2588,6 +2588,8 @@ const char *debug_d3dstate(DWORD state)
return
"STATE_BASEVERTEXINDEX"
;
if
(
STATE_IS_FRAMEBUFFER
(
state
))
return
"STATE_FRAMEBUFFER"
;
if
(
STATE_IS_POINT_SIZE_ENABLE
(
state
))
return
"STATE_POINT_SIZE_ENABLE"
;
return
wine_dbg_sprintf
(
"UNKNOWN_STATE(%#x)"
,
state
);
}
...
...
@@ -3530,6 +3532,7 @@ void wined3d_ffp_get_vs_settings(const struct wined3d_state *state, const struct
{
memset
(
settings
,
0
,
sizeof
(
*
settings
));
settings
->
point_size
=
state
->
gl_primitive_type
==
GL_POINTS
;
if
(
!
state
->
render_states
[
WINED3D_RS_FOGENABLE
])
settings
->
fog_mode
=
WINED3D_FFP_VS_FOG_OFF
;
else
if
(
state
->
render_states
[
WINED3D_RS_FOGTABLEMODE
]
!=
WINED3D_FOG_NONE
)
...
...
@@ -3552,6 +3555,7 @@ void wined3d_ffp_get_vs_settings(const struct wined3d_state *state, const struct
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
->
point_size
=
state
->
gl_primitive_type
==
GL_POINTS
;
if
(
state
->
render_states
[
WINED3D_RS_COLORVERTEX
]
&&
(
si
->
use_map
&
(
1
<<
WINED3D_FFP_DIFFUSE
)))
{
...
...
dlls/wined3d/wined3d_private.h
View file @
1c2392dd
...
...
@@ -1007,7 +1007,10 @@ extern glMultiTexCoordFunc multi_texcoord_funcs[WINED3D_FFP_EMIT_COUNT] DECLSPEC
#define STATE_FRAMEBUFFER (STATE_BASEVERTEXINDEX + 1)
#define STATE_IS_FRAMEBUFFER(a) ((a) == STATE_FRAMEBUFFER)
#define STATE_HIGHEST (STATE_FRAMEBUFFER)
#define STATE_POINT_SIZE_ENABLE (STATE_FRAMEBUFFER + 1)
#define STATE_IS_POINT_SIZE_ENABLE(a) ((a) == STATE_POINT_SIZE_ENABLE)
#define STATE_HIGHEST (STATE_POINT_SIZE_ENABLE)
enum
fogsource
{
FOGSOURCE_FFP
,
...
...
@@ -1717,9 +1720,10 @@ struct wined3d_ffp_vs_settings
DWORD
normalize
:
1
;
DWORD
lighting
:
1
;
DWORD
localviewer
:
1
;
DWORD
point_size
:
1
;
DWORD
fog_mode
:
2
;
DWORD
texcoords
:
8
;
/* MAX_TEXTURES */
DWORD
padding
:
1
8
;
DWORD
padding
:
1
7
;
BYTE
texgen
[
MAX_TEXTURES
];
};
...
...
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