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
6fce4d45
Commit
6fce4d45
authored
May 14, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
May 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass the state and private data to shader_select.
parent
47f385ad
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
47 deletions
+31
-47
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+10
-15
context.c
dlls/wined3d/context.c
+1
-3
glsl_shader.c
dlls/wined3d/glsl_shader.c
+13
-15
shader.c
dlls/wined3d/shader.c
+5
-6
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-8
No files found.
dlls/wined3d/arb_program_shader.c
View file @
6fce4d45
...
...
@@ -640,8 +640,8 @@ static void shader_arb_vs_local_constants(const struct arb_vs_compiled_shader *g
checkGLcall
(
"Load vs int consts"
);
}
static
void
shader_arb_select
(
const
struct
wined3d_context
*
context
,
enum
wined3d_shader_mode
vertex_mode
,
enum
wined3d_shader_mode
fragment_mod
e
);
static
void
shader_arb_select
(
void
*
shader_priv
,
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
stat
e
);
/**
* Loads the app-supplied constants into the currently set ARB_[vertex/fragment]_programs.
...
...
@@ -666,9 +666,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv,
&&
(
vshader
->
reg_maps
.
integer_constants
&
~
vshader
->
reg_maps
.
local_int_consts
))))
{
TRACE
(
"bool/integer vertex shader constants potentially modified, forcing shader reselection.
\n
"
);
shader_arb_select
(
context
,
useVertexShader
?
WINED3D_SHADER_MODE_SHADER
:
WINED3D_SHADER_MODE_FFP
,
usePixelShader
?
WINED3D_SHADER_MODE_SHADER
:
WINED3D_SHADER_MODE_FFP
);
shader_arb_select
(
priv
,
context
,
state
);
}
else
if
(
pshader
&&
(
pshader
->
reg_maps
.
boolean_constants
...
...
@@ -676,9 +674,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv,
&&
(
pshader
->
reg_maps
.
integer_constants
&
~
pshader
->
reg_maps
.
local_int_consts
))))
{
TRACE
(
"bool/integer pixel shader constants potentially modified, forcing shader reselection.
\n
"
);
shader_arb_select
(
context
,
useVertexShader
?
WINED3D_SHADER_MODE_SHADER
:
WINED3D_SHADER_MODE_FFP
,
usePixelShader
?
WINED3D_SHADER_MODE_SHADER
:
WINED3D_SHADER_MODE_FFP
);
shader_arb_select
(
priv
,
context
,
state
);
}
}
...
...
@@ -4605,17 +4601,16 @@ static void find_arb_vs_compile_args(const struct wined3d_state *state,
}
/* Context activation is done by the caller. */
static
void
shader_arb_select
(
const
struct
wined3d_context
*
context
,
enum
wined3d_shader_mode
vertex_mode
,
enum
wined3d_shader_mode
fragment_mod
e
)
static
void
shader_arb_select
(
void
*
shader_priv
,
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
stat
e
)
{
struct
wined3d_device
*
device
=
context
->
swapchain
->
device
;
struct
shader_arb_priv
*
priv
=
device
->
shader_priv
;
struct
shader_arb_priv
*
priv
=
shader_priv
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
const
struct
wined3d_state
*
state
=
&
device
->
stateBlock
->
state
;
int
i
;
/* Deal with pixel shaders first so the vertex shader arg function has the input signature ready */
if
(
fragment_mode
==
WINED3D_SHADER_MODE_SHADER
)
if
(
use_ps
(
state
)
)
{
struct
wined3d_shader
*
ps
=
state
->
pixel_shader
;
struct
arb_ps_compile_args
compile_args
;
...
...
@@ -4653,7 +4648,7 @@ static void shader_arb_select(const struct wined3d_context *context, enum wined3
priv
->
pshader_const_dirty
[
i
]
=
1
;
}
/* Also takes care of loading local constants */
shader_arb_load_constants_internal
(
device
->
shader_priv
,
context
,
state
,
TRUE
,
FALSE
,
TRUE
);
shader_arb_load_constants_internal
(
shader_priv
,
context
,
state
,
TRUE
,
FALSE
,
TRUE
);
}
else
{
...
...
@@ -4680,7 +4675,7 @@ static void shader_arb_select(const struct wined3d_context *context, enum wined3
priv
->
fragment_pipe
->
enable_extension
(
gl_info
,
TRUE
);
}
if
(
vertex_mode
==
WINED3D_SHADER_MODE_SHADER
)
if
(
use_vs
(
state
)
)
{
struct
wined3d_shader
*
vs
=
state
->
vertex_shader
;
struct
arb_vs_compile_args
compile_args
;
...
...
dlls/wined3d/context.c
View file @
6fce4d45
...
...
@@ -2403,9 +2403,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de
if
(
context
->
select_shader
)
{
device
->
shader_backend
->
shader_select
(
context
,
use_vs
(
state
)
?
WINED3D_SHADER_MODE_SHADER
:
WINED3D_SHADER_MODE_FFP
,
use_ps
(
state
)
?
WINED3D_SHADER_MODE_SHADER
:
WINED3D_SHADER_MODE_FFP
);
device
->
shader_backend
->
shader_select
(
device
->
shader_priv
,
context
,
state
);
context
->
select_shader
=
0
;
}
...
...
dlls/wined3d/glsl_shader.c
View file @
6fce4d45
...
...
@@ -5480,13 +5480,11 @@ static void shader_glsl_init_ps_uniform_locations(const struct wined3d_gl_info *
}
/* Context activation is done by the caller. */
static
void
set_glsl_shader_program
(
const
struct
wined3d_context
*
context
,
struct
wined3d_device
*
devic
e
,
enum
wined3d_shader_mode
vertex_mode
,
enum
wined3d_shader_mode
fragment_mode
)
static
void
set_glsl_shader_program
(
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
stat
e
,
struct
shader_glsl_priv
*
priv
)
{
const
struct
wined3d_state
*
state
=
&
device
->
stateBlock
->
state
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
const
struct
ps_np2fixup_info
*
np2fixup_info
=
NULL
;
struct
shader_glsl_priv
*
priv
=
device
->
shader_priv
;
struct
glsl_shader_prog_link
*
entry
=
NULL
;
struct
wined3d_shader
*
vshader
=
NULL
;
struct
wined3d_shader
*
gshader
=
NULL
;
...
...
@@ -5498,8 +5496,9 @@ static void set_glsl_shader_program(const struct wined3d_context *context, struc
struct
vs_compile_args
vs_compile_args
;
GLhandleARB
vs_id
,
gs_id
,
ps_id
;
struct
list
*
ps_list
;
struct
wined3d_device
*
device
=
context
->
swapchain
->
device
;
if
(
vertex_mode
==
WINED3D_SHADER_MODE_SHADER
)
if
(
use_vs
(
state
)
)
{
vshader
=
state
->
vertex_shader
;
find_vs_compile_args
(
state
,
vshader
,
&
vs_compile_args
);
...
...
@@ -5516,7 +5515,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context, struc
gs_id
=
0
;
}
if
(
fragment_mode
==
WINED3D_SHADER_MODE_SHADER
)
if
(
use_ps
(
state
)
)
{
pshader
=
state
->
pixel_shader
;
find_ps_compile_args
(
state
,
pshader
,
&
ps_compile_args
);
...
...
@@ -5524,7 +5523,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context, struc
pshader
,
&
ps_compile_args
,
&
np2fixup_info
);
ps_list
=
&
pshader
->
linked_programs
;
}
else
if
(
fragment_mode
==
WINED3D_SHADER_MODE_FFP
&&
priv
->
fragment_pipe
==
&
glsl_fragment_pipe
)
else
if
(
priv
->
fragment_pipe
==
&
glsl_fragment_pipe
)
{
struct
glsl_ffp_fragment_shader
*
ffp_shader
;
struct
ffp_frag_settings
settings
;
...
...
@@ -5781,20 +5780,19 @@ static GLhandleARB create_glsl_blt_shader(const struct wined3d_gl_info *gl_info,
}
/* Context activation is done by the caller. */
static
void
shader_glsl_select
(
const
struct
wined3d_context
*
context
,
enum
wined3d_shader_mode
vertex_mode
,
enum
wined3d_shader_mode
fragment_mod
e
)
static
void
shader_glsl_select
(
void
*
shader_priv
,
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
stat
e
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
struct
wined3d_device
*
device
=
context
->
swapchain
->
device
;
struct
shader_glsl_priv
*
priv
=
device
->
shader_priv
;
struct
shader_glsl_priv
*
priv
=
shader_priv
;
GLhandleARB
program_id
=
0
;
GLenum
old_vertex_color_clamp
,
current_vertex_color_clamp
;
priv
->
vertex_pipe
->
vp_enable
(
gl_info
,
vertex_mode
==
WINED3D_SHADER_MODE_FFP
);
priv
->
fragment_pipe
->
enable_extension
(
gl_info
,
fragment_mode
==
WINED3D_SHADER_MODE_FFP
);
priv
->
vertex_pipe
->
vp_enable
(
gl_info
,
!
use_vs
(
state
)
);
priv
->
fragment_pipe
->
enable_extension
(
gl_info
,
!
use_ps
(
state
)
);
old_vertex_color_clamp
=
priv
->
glsl_program
?
priv
->
glsl_program
->
vs
.
vertex_color_clamp
:
GL_FIXED_ONLY_ARB
;
set_glsl_shader_program
(
context
,
device
,
vertex_mode
,
fragment_mode
);
set_glsl_shader_program
(
context
,
state
,
priv
);
current_vertex_color_clamp
=
priv
->
glsl_program
?
priv
->
glsl_program
->
vs
.
vertex_color_clamp
:
GL_FIXED_ONLY_ARB
;
if
(
old_vertex_color_clamp
!=
current_vertex_color_clamp
)
{
...
...
@@ -5819,7 +5817,7 @@ static void shader_glsl_select(const struct wined3d_context *context, enum wined
* called between selecting the shader and using it, which results in wrong fixup for some frames. */
if
(
priv
->
glsl_program
&&
priv
->
glsl_program
->
ps
.
np2_fixup_info
)
{
shader_glsl_load_np2fixup_constants
(
priv
,
gl_info
,
&
device
->
stateBlock
->
state
);
shader_glsl_load_np2fixup_constants
(
priv
,
gl_info
,
state
);
}
}
...
...
dlls/wined3d/shader.c
View file @
6fce4d45
...
...
@@ -1517,15 +1517,14 @@ static void shader_none_destroy(struct wined3d_shader *shader) {}
static
void
shader_none_context_destroyed
(
void
*
shader_priv
,
const
struct
wined3d_context
*
context
)
{}
/* Context activation is done by the caller. */
static
void
shader_none_select
(
const
struct
wined3d_context
*
context
,
enum
wined3d_shader_mode
vertex_mode
,
enum
wined3d_shader_mode
fragment_mod
e
)
static
void
shader_none_select
(
void
*
shader_priv
,
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
stat
e
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
struct
wined3d_device
*
device
=
context
->
swapchain
->
device
;
struct
shader_none_priv
*
priv
=
device
->
shader_priv
;
struct
shader_none_priv
*
priv
=
shader_priv
;
priv
->
vertex_pipe
->
vp_enable
(
gl_info
,
vertex_mode
==
WINED3D_SHADER_MODE_FFP
);
priv
->
fragment_pipe
->
enable_extension
(
gl_info
,
fragment_mode
==
WINED3D_SHADER_MODE_FFP
);
priv
->
vertex_pipe
->
vp_enable
(
gl_info
,
!
use_vs
(
state
)
);
priv
->
fragment_pipe
->
enable_extension
(
gl_info
,
!
use_ps
(
state
)
);
}
/* Context activation is done by the caller. */
...
...
dlls/wined3d/wined3d_private.h
View file @
6fce4d45
...
...
@@ -785,12 +785,6 @@ struct vs_compile_args {
WORD
swizzle_map
;
/* MAX_ATTRIBS, 16 */
};
enum
wined3d_shader_mode
{
WINED3D_SHADER_MODE_FFP
,
WINED3D_SHADER_MODE_SHADER
,
};
struct
wined3d_context
;
struct
wined3d_state
;
struct
fragment_pipeline
;
...
...
@@ -799,8 +793,8 @@ struct wined3d_vertex_pipe_ops;
struct
wined3d_shader_backend_ops
{
void
(
*
shader_handle_instruction
)(
const
struct
wined3d_shader_instruction
*
);
void
(
*
shader_select
)(
const
struct
wined3d_context
*
context
,
enum
wined3d_shader_mode
vertex_mode
,
enum
wined3d_shader_mode
fragment_mod
e
);
void
(
*
shader_select
)(
void
*
shader_priv
,
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
stat
e
);
void
(
*
shader_disable
)(
void
*
shader_priv
,
const
struct
wined3d_context
*
context
);
void
(
*
shader_select_depth_blt
)(
void
*
shader_priv
,
const
struct
wined3d_gl_info
*
gl_info
,
enum
tex_types
tex_type
,
const
SIZE
*
ds_mask_size
);
...
...
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