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
92fbe333
Commit
92fbe333
authored
Jun 05, 2015
by
Matteo Bruni
Committed by
Alexandre Julliard
Jun 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Handle point sprites with PS 3.0.
parent
bbcfa6b4
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
14 deletions
+22
-14
device.c
dlls/wined3d/device.c
+1
-1
glsl_shader.c
dlls/wined3d/glsl_shader.c
+9
-5
shader.c
dlls/wined3d/shader.c
+3
-0
state.c
dlls/wined3d/state.c
+2
-2
stateblock.c
dlls/wined3d/stateblock.c
+1
-1
utils.c
dlls/wined3d/utils.c
+2
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-3
No files found.
dlls/wined3d/device.c
View file @
92fbe333
...
...
@@ -3404,7 +3404,7 @@ void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device,
if
(
device
->
recording
)
device
->
recording
->
changed
.
primitive_type
=
TRUE
;
else
if
(
gl_primitive_type
!=
prev
&&
(
gl_primitive_type
==
GL_POINTS
||
prev
==
GL_POINTS
))
device_invalidate_state
(
device
,
STATE_POINT_
SIZE_
ENABLE
);
device_invalidate_state
(
device
,
STATE_POINT_ENABLE
);
}
void
CDECL
wined3d_device_get_primitive_type
(
const
struct
wined3d_device
*
device
,
...
...
dlls/wined3d/glsl_shader.c
View file @
92fbe333
...
...
@@ -4712,7 +4712,7 @@ static void shader_glsl_dp2add(const struct wined3d_shader_instruction *ins)
static
void
shader_glsl_input_pack
(
const
struct
wined3d_shader
*
shader
,
struct
wined3d_string_buffer
*
buffer
,
const
struct
wined3d_shader_signature
*
input_signature
,
const
struct
wined3d_shader_reg_maps
*
reg_maps
,
enum
vertexprocessing_mode
vertexprocessing
)
const
struct
ps_compile_args
*
args
)
{
unsigned
int
i
;
...
...
@@ -4731,11 +4731,13 @@ static void shader_glsl_input_pack(const struct wined3d_shader *shader, struct w
semantic_idx
=
input
->
semantic_idx
;
shader_glsl_write_mask_to_str
(
input
->
mask
,
reg_mask
);
if
(
vertexprocessing
==
vertexshader
)
if
(
args
->
vp_mode
==
vertexshader
)
{
if
(
input
->
sysval_semantic
==
WINED3D_SV_POSITION
)
shader_addline
(
buffer
,
"ps_in[%u]%s = vpos%s;
\n
"
,
shader
->
u
.
ps
.
input_reg_map
[
input
->
register_idx
],
reg_mask
,
reg_mask
);
else
if
(
args
->
pointsprite
&&
shader_match_semantic
(
semantic_name
,
WINED3D_DECL_USAGE_TEXCOORD
))
shader_addline
(
buffer
,
"ps_in[%u] = vec4(gl_PointCoord.xy, 0.0, 0.0);
\n
"
,
input
->
register_idx
);
else
shader_addline
(
buffer
,
"ps_in[%u]%s = ps_link[%u]%s;
\n
"
,
shader
->
u
.
ps
.
input_reg_map
[
input
->
register_idx
],
reg_mask
,
...
...
@@ -4743,7 +4745,7 @@ static void shader_glsl_input_pack(const struct wined3d_shader *shader, struct w
}
else
if
(
shader_match_semantic
(
semantic_name
,
WINED3D_DECL_USAGE_TEXCOORD
))
{
if
(
semantic_idx
<
8
&&
vertexprocessing
==
pretransformed
)
if
(
semantic_idx
<
8
&&
args
->
vp_mode
==
pretransformed
)
shader_addline
(
buffer
,
"ps_in[%u]%s = gl_TexCoord[%u]%s;
\n
"
,
shader
->
u
.
ps
.
input_reg_map
[
input
->
register_idx
],
reg_mask
,
semantic_idx
,
reg_mask
);
else
...
...
@@ -5125,7 +5127,7 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context
/* Pack 3.0 inputs */
if
(
reg_maps
->
shader_version
.
major
>=
3
)
shader_glsl_input_pack
(
shader
,
buffer
,
&
shader
->
input_signature
,
reg_maps
,
args
->
vp_mode
);
shader_glsl_input_pack
(
shader
,
buffer
,
&
shader
->
input_signature
,
reg_maps
,
args
);
/* Base Shader Body */
shader_generate_main
(
shader
,
buffer
,
reg_maps
,
function
,
&
priv_ctx
);
...
...
@@ -8036,7 +8038,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
),
glsl_vertex_pipe_texmatrix
},
WINED3D_GL_EXT_NONE
},
{
STATE_POINT_
SIZE_ENABLE
,
{
STATE_RENDER
(
WINED3D_RS_FOGENABLE
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_POINT_
ENABLE
,
{
STATE_POINT_ENABLE
,
glsl_vertex_pipe_shader
},
WINED3D_GL_EXT_NONE
},
{
0
/* Terminate */
,
{
0
,
NULL
},
WINED3D_GL_EXT_NONE
},
};
...
...
@@ -8342,6 +8344,7 @@ static const struct StateEntryTemplate glsl_fragment_pipe_state_template[] =
{
STATE_RENDER
(
WINED3D_RS_SRGBWRITEENABLE
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_FOGCOLOR
),
{
STATE_RENDER
(
WINED3D_RS_FOGCOLOR
),
state_fogcolor
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_FOGDENSITY
),
{
STATE_RENDER
(
WINED3D_RS_FOGDENSITY
),
state_fogdensity
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_POINTSPRITEENABLE
),
{
STATE_RENDER
(
WINED3D_RS_POINTSPRITEENABLE
),
glsl_fragment_pipe_shader
},
ARB_POINT_SPRITE
},
{
STATE_TEXTURESTAGE
(
0
,
WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
),
{
STATE_TEXTURESTAGE
(
0
,
WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
),
glsl_fragment_pipe_tex_transform
},
WINED3D_GL_EXT_NONE
},
{
STATE_TEXTURESTAGE
(
1
,
WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
),
{
STATE_TEXTURESTAGE
(
1
,
WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
),
glsl_fragment_pipe_tex_transform
},
WINED3D_GL_EXT_NONE
},
{
STATE_TEXTURESTAGE
(
2
,
WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
),
{
STATE_TEXTURESTAGE
(
2
,
WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
),
glsl_fragment_pipe_tex_transform
},
WINED3D_GL_EXT_NONE
},
...
...
@@ -8359,6 +8362,7 @@ static const struct StateEntryTemplate glsl_fragment_pipe_state_template[] =
{
STATE_TEXTURESTAGE
(
6
,
WINED3D_TSS_CONSTANT
),
{
STATE_TEXTURESTAGE
(
6
,
WINED3D_TSS_CONSTANT
),
glsl_fragment_pipe_invalidate_constants
},
WINED3D_GL_EXT_NONE
},
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_CONSTANT
),
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_CONSTANT
),
glsl_fragment_pipe_invalidate_constants
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_SPECULARENABLE
),
{
STATE_RENDER
(
WINED3D_RS_SPECULARENABLE
),
glsl_fragment_pipe_invalidate_constants
},
WINED3D_GL_EXT_NONE
},
{
STATE_POINT_ENABLE
,
{
STATE_POINT_ENABLE
,
glsl_fragment_pipe_shader
},
WINED3D_GL_EXT_NONE
},
{
0
/* Terminate */
,
{
0
,
0
},
WINED3D_GL_EXT_NONE
},
};
...
...
dlls/wined3d/shader.c
View file @
92fbe333
...
...
@@ -2576,6 +2576,9 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3
args
->
fog
=
WINED3D_FFP_PS_FOG_OFF
;
}
}
args
->
pointsprite
=
state
->
render_states
[
WINED3D_RS_POINTSPRITEENABLE
]
&&
state
->
gl_primitive_type
==
GL_POINTS
;
}
static
HRESULT
pixelshader_init
(
struct
wined3d_shader
*
shader
,
struct
wined3d_device
*
device
,
...
...
dlls/wined3d/state.c
View file @
92fbe333
...
...
@@ -5487,7 +5487,7 @@ static 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
},
{
STATE_POINT_
ENABLE
,
{
STATE_POINT_ENABLE
,
state_nop
},
WINED3D_GL_EXT_NONE
},
{
0
/* Terminate */
,
{
0
,
0
},
WINED3D_GL_EXT_NONE
},
};
...
...
@@ -5854,7 +5854,7 @@ static void validate_state_table(struct StateEntry *state_table)
STATE_POINTSPRITECOORDORIGIN
,
STATE_BASEVERTEXINDEX
,
STATE_FRAMEBUFFER
,
STATE_POINT_
SIZE_
ENABLE
,
STATE_POINT_ENABLE
,
STATE_COLOR_KEY
,
};
unsigned
int
i
,
current
;
...
...
dlls/wined3d/stateblock.c
View file @
92fbe333
...
...
@@ -1049,7 +1049,7 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
prev
=
device
->
update_state
->
gl_primitive_type
;
device
->
update_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
);
device_invalidate_state
(
device
,
STATE_POINT_ENABLE
);
}
if
(
stateblock
->
changed
.
indices
)
...
...
dlls/wined3d/utils.c
View file @
92fbe333
...
...
@@ -3234,8 +3234,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"
;
if
(
STATE_IS_POINT_ENABLE
(
state
))
return
"STATE_POINT_ENABLE"
;
if
(
STATE_IS_COLOR_KEY
(
state
))
return
"STATE_COLOR_KEY"
;
...
...
dlls/wined3d/wined3d_private.h
View file @
92fbe333
...
...
@@ -835,6 +835,7 @@ struct ps_compile_args {
D3D9 has a limit of 16 samplers and the fixup is superfluous
in D3D10 (unconditional NP2 support mandatory). */
WORD
shadow
;
/* MAX_FRAGMENT_SAMPLERS, 16 */
BOOL
pointsprite
;
};
enum
fog_src_type
{
...
...
@@ -1075,10 +1076,10 @@ DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN;
#define STATE_FRAMEBUFFER (STATE_BASEVERTEXINDEX + 1)
#define STATE_IS_FRAMEBUFFER(a) ((a) == STATE_FRAMEBUFFER)
#define STATE_POINT_
SIZE_
ENABLE (STATE_FRAMEBUFFER + 1)
#define STATE_IS_POINT_
SIZE_ENABLE(a) ((a) == STATE_POINT_SIZE
_ENABLE)
#define STATE_POINT_ENABLE (STATE_FRAMEBUFFER + 1)
#define STATE_IS_POINT_
ENABLE(a) ((a) == STATE_POINT
_ENABLE)
#define STATE_COLOR_KEY (STATE_POINT_
SIZE_
ENABLE + 1)
#define STATE_COLOR_KEY (STATE_POINT_ENABLE + 1)
#define STATE_IS_COLOR_KEY(a) ((a) == STATE_COLOR_KEY)
#define STATE_HIGHEST (STATE_COLOR_KEY)
...
...
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