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
036a62a2
Commit
036a62a2
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: Explicitly pass the state to shader_load_constants.
parent
5d138799
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
20 deletions
+21
-20
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+5
-5
context.c
dlls/wined3d/context.c
+2
-1
glsl_shader.c
dlls/wined3d/glsl_shader.c
+9
-12
shader.c
dlls/wined3d/shader.c
+2
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-1
No files found.
dlls/wined3d/arb_program_shader.c
View file @
036a62a2
...
...
@@ -719,13 +719,13 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv,
}
}
static
void
shader_arb_load_constants
(
const
struct
wined3d_context
*
context
,
BOOL
ps
,
BOOL
vs
)
static
void
shader_arb_load_constants
(
void
*
shader_priv
,
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
)
{
struct
wined3d_device
*
device
=
context
->
swapchain
->
device
;
const
struct
wined3d_stateblock
*
stateblock
=
device
->
stateBlock
;
const
struct
wined3d_state
*
state
=
&
stateblock
->
state
;
BOOL
vs
=
use_vs
(
state
);
BOOL
ps
=
use_ps
(
state
);
shader_arb_load_constants_internal
(
device
->
shader_priv
,
context
,
state
,
ps
,
vs
,
FALSE
);
shader_arb_load_constants_internal
(
shader_priv
,
context
,
state
,
ps
,
vs
,
FALSE
);
}
static
void
shader_arb_update_float_vertex_constants
(
struct
wined3d_device
*
device
,
UINT
start
,
UINT
count
)
...
...
dlls/wined3d/context.c
View file @
036a62a2
...
...
@@ -2411,7 +2411,8 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de
if
(
context
->
load_constants
)
{
device
->
shader_backend
->
shader_load_constants
(
context
,
use_ps
(
state
),
use_vs
(
state
));
device
->
shader_backend
->
shader_load_constants
(
device
->
shader_priv
,
context
,
state
);
context
->
load_constants
=
0
;
}
...
...
dlls/wined3d/glsl_shader.c
View file @
036a62a2
...
...
@@ -725,14 +725,11 @@ static void shader_glsl_load_np2fixup_constants(void *shader_priv,
}
/* Context activation is done by the caller (state handler). */
static
void
shader_glsl_load_constants
(
const
struct
wined3d_context
*
context
,
BOOL
usePixelShader
,
BOOL
useVertexShader
)
static
void
shader_glsl_load_constants
(
void
*
shader_priv
,
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
struct
wined3d_device
*
device
=
context
->
swapchain
->
device
;
struct
wined3d_stateblock
*
stateBlock
=
device
->
stateBlock
;
const
struct
wined3d_state
*
state
=
&
stateBlock
->
state
;
struct
shader_glsl_priv
*
priv
=
device
->
shader_priv
;
struct
shader_glsl_priv
*
priv
=
shader_priv
;
float
position_fixup
[
4
];
GLhandleARB
programId
;
...
...
@@ -747,7 +744,7 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
programId
=
prog
->
programId
;
constant_version
=
prog
->
constant_version
;
if
(
use
VertexShader
)
if
(
use
_vs
(
state
)
)
{
const
struct
wined3d_shader
*
vshader
=
state
->
vertex_shader
;
...
...
@@ -757,11 +754,11 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
/* Load DirectX 9 integer constants/uniforms for vertex shader */
shader_glsl_load_constantsI
(
vshader
,
gl_info
,
prog
->
vs
.
uniform_i_locations
,
state
->
vs_consts_i
,
stateBlock
->
changed
.
vertexShaderConstantsI
&
vshader
->
reg_maps
.
integer_constants
);
vshader
->
reg_maps
.
integer_constants
);
/* Load DirectX 9 boolean constants/uniforms for vertex shader */
shader_glsl_load_constantsB
(
vshader
,
gl_info
,
programId
,
state
->
vs_consts_b
,
stateBlock
->
changed
.
vertexShaderConstantsB
&
vshader
->
reg_maps
.
boolean_constants
);
vshader
->
reg_maps
.
boolean_constants
);
/* Upload the position fixup params */
shader_get_position_fixup
(
context
,
state
,
position_fixup
);
...
...
@@ -769,7 +766,7 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
checkGLcall
(
"glUniform4fvARB"
);
}
if
(
use
PixelShader
)
if
(
use
_ps
(
state
)
)
{
const
struct
wined3d_shader
*
pshader
=
state
->
pixel_shader
;
...
...
@@ -779,11 +776,11 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
/* Load DirectX 9 integer constants/uniforms for pixel shader */
shader_glsl_load_constantsI
(
pshader
,
gl_info
,
prog
->
ps
.
uniform_i_locations
,
state
->
ps_consts_i
,
stateBlock
->
changed
.
pixelShaderConstantsI
&
pshader
->
reg_maps
.
integer_constants
);
pshader
->
reg_maps
.
integer_constants
);
/* Load DirectX 9 boolean constants/uniforms for pixel shader */
shader_glsl_load_constantsB
(
pshader
,
gl_info
,
programId
,
state
->
ps_consts_b
,
stateBlock
->
changed
.
pixelShaderConstantsB
&
pshader
->
reg_maps
.
boolean_constants
);
pshader
->
reg_maps
.
boolean_constants
);
/* Upload the environment bump map matrix if needed. The needsbumpmat
* member specifies the texture stage to load the matrix from. It
...
...
dlls/wined3d/shader.c
View file @
036a62a2
...
...
@@ -1509,7 +1509,8 @@ static void shader_none_select_depth_blt(void *shader_priv, const struct wined3d
static
void
shader_none_deselect_depth_blt
(
void
*
shader_priv
,
const
struct
wined3d_gl_info
*
gl_info
)
{}
static
void
shader_none_update_float_vertex_constants
(
struct
wined3d_device
*
device
,
UINT
start
,
UINT
count
)
{}
static
void
shader_none_update_float_pixel_constants
(
struct
wined3d_device
*
device
,
UINT
start
,
UINT
count
)
{}
static
void
shader_none_load_constants
(
const
struct
wined3d_context
*
context
,
BOOL
usePS
,
BOOL
useVS
)
{}
static
void
shader_none_load_constants
(
void
*
shader_priv
,
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
)
{}
static
void
shader_none_load_np2fixup_constants
(
void
*
shader_priv
,
const
struct
wined3d_gl_info
*
gl_info
,
const
struct
wined3d_state
*
state
)
{}
static
void
shader_none_destroy
(
struct
wined3d_shader
*
shader
)
{}
...
...
dlls/wined3d/wined3d_private.h
View file @
036a62a2
...
...
@@ -5,6 +5,7 @@
* Copyright 2002-2003 Raphael Junqueira
* Copyright 2002-2003, 2004 Jason Edmeades
* Copyright 2005 Oliver Stieber
* Copyright 2006-2011, 2013 Stefan Dösinger for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -806,7 +807,8 @@ struct wined3d_shader_backend_ops
void
(
*
shader_deselect_depth_blt
)(
void
*
shader_priv
,
const
struct
wined3d_gl_info
*
gl_info
);
void
(
*
shader_update_float_vertex_constants
)(
struct
wined3d_device
*
device
,
UINT
start
,
UINT
count
);
void
(
*
shader_update_float_pixel_constants
)(
struct
wined3d_device
*
device
,
UINT
start
,
UINT
count
);
void
(
*
shader_load_constants
)(
const
struct
wined3d_context
*
context
,
BOOL
usePS
,
BOOL
useVS
);
void
(
*
shader_load_constants
)(
void
*
shader_priv
,
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
);
void
(
*
shader_load_np2fixup_constants
)(
void
*
shader_priv
,
const
struct
wined3d_gl_info
*
gl_info
,
const
struct
wined3d_state
*
state
);
void
(
*
shader_destroy
)(
struct
wined3d_shader
*
shader
);
...
...
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