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
8c36e4ce
Commit
8c36e4ce
authored
Oct 26, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 26, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Explicitly pass parameters to shader_arb_ps_local_constants().
parent
5afb593c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+13
-14
No files found.
dlls/wined3d/arb_program_shader.c
View file @
8c36e4ce
...
...
@@ -522,21 +522,18 @@ static void shader_arb_load_np2fixup_constants(void *shader_priv,
}
/* GL locking is done by the caller. */
static
inline
void
shader_arb_ps_local_constants
(
IWineD3DDeviceImpl
*
deviceImpl
)
static
void
shader_arb_ps_local_constants
(
const
struct
arb_ps_compiled_shader
*
gl_shader
,
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
float
rt_height
)
{
const
struct
wined3d_context
*
context
=
context_get_current
();
IWineD3DStateBlockImpl
*
stateBlock
=
deviceImpl
->
stateBlock
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
unsigned
char
i
;
struct
shader_arb_priv
*
priv
=
deviceImpl
->
shader_priv
;
const
struct
arb_ps_compiled_shader
*
gl_shader
=
priv
->
compiled_fprog
;
for
(
i
=
0
;
i
<
gl_shader
->
numbumpenvmatconsts
;
i
++
)
{
int
texunit
=
gl_shader
->
bumpenvmatconst
[
i
].
texunit
;
/* The state manager takes care that this function is always called if the bump env matrix changes */
const
float
*
data
=
(
const
float
*
)
&
state
Block
->
state
.
texture_states
[
texunit
][
WINED3DTSS_BUMPENVMAT00
];
const
float
*
data
=
(
const
float
*
)
&
state
->
texture_states
[
texunit
][
WINED3DTSS_BUMPENVMAT00
];
GL_EXTCALL
(
glProgramLocalParameter4fvARB
(
GL_FRAGMENT_PROGRAM_ARB
,
gl_shader
->
bumpenvmatconst
[
i
].
const_num
,
data
));
...
...
@@ -547,7 +544,7 @@ static inline void shader_arb_ps_local_constants(IWineD3DDeviceImpl* deviceImpl)
* don't care about them. The pointers are valid for sure because the stateblock is bigger.
* (they're WINED3DTSS_TEXTURETRANSFORMFLAGS and WINED3DTSS_ADDRESSW, so most likely 0 or NaN
*/
const
float
*
scale
=
(
const
float
*
)
&
state
Block
->
state
.
texture_states
[
texunit
][
WINED3DTSS_BUMPENVLSCALE
];
const
float
*
scale
=
(
const
float
*
)
&
state
->
texture_states
[
texunit
][
WINED3DTSS_BUMPENVLSCALE
];
GL_EXTCALL
(
glProgramLocalParameter4fvARB
(
GL_FRAGMENT_PROGRAM_ARB
,
gl_shader
->
luminanceconst
[
i
].
const_num
,
scale
));
}
...
...
@@ -562,8 +559,7 @@ static inline void shader_arb_ps_local_constants(IWineD3DDeviceImpl* deviceImpl)
* ycorrection.w: 0.0
*/
float
val
[
4
];
val
[
0
]
=
context
->
render_offscreen
?
0
.
0
f
:
deviceImpl
->
render_targets
[
0
]
->
currentDesc
.
Height
;
val
[
0
]
=
context
->
render_offscreen
?
0
.
0
f
:
rt_height
;
val
[
1
]
=
context
->
render_offscreen
?
1
.
0
f
:
-
1
.
0
f
;
val
[
2
]
=
1
.
0
f
;
val
[
3
]
=
0
.
0
f
;
...
...
@@ -578,9 +574,9 @@ static inline void shader_arb_ps_local_constants(IWineD3DDeviceImpl* deviceImpl)
if
(
gl_shader
->
int_consts
[
i
]
!=
WINED3D_CONST_NUM_UNUSED
)
{
float
val
[
4
];
val
[
0
]
=
(
float
)
state
Block
->
state
.
ps_consts_i
[
4
*
i
];
val
[
1
]
=
(
float
)
state
Block
->
state
.
ps_consts_i
[
4
*
i
+
1
];
val
[
2
]
=
(
float
)
state
Block
->
state
.
ps_consts_i
[
4
*
i
+
2
];
val
[
0
]
=
(
float
)
state
->
ps_consts_i
[
4
*
i
];
val
[
1
]
=
(
float
)
state
->
ps_consts_i
[
4
*
i
+
1
];
val
[
2
]
=
(
float
)
state
->
ps_consts_i
[
4
*
i
+
2
];
val
[
3
]
=
-
1
.
0
f
;
GL_EXTCALL
(
glProgramLocalParameter4fvARB
(
GL_FRAGMENT_PROGRAM_ARB
,
gl_shader
->
int_consts
[
i
],
val
));
...
...
@@ -647,11 +643,13 @@ static void shader_arb_load_constants(const struct wined3d_context *context, cha
if
(
usePixelShader
)
{
IWineD3DBaseShaderImpl
*
pshader
=
(
IWineD3DBaseShaderImpl
*
)
stateBlock
->
state
.
pixel_shader
;
const
struct
arb_ps_compiled_shader
*
gl_shader
=
priv
->
compiled_fprog
;
float
rt_height
=
device
->
render_targets
[
0
]
->
currentDesc
.
Height
;
/* Load DirectX 9 float constants for pixel shader */
device
->
highest_dirty_ps_const
=
shader_arb_load_constantsF
(
pshader
,
gl_info
,
GL_FRAGMENT_PROGRAM_ARB
,
device
->
highest_dirty_ps_const
,
stateBlock
->
state
.
ps_consts_f
,
context
->
pshader_const_dirty
);
shader_arb_ps_local_constants
(
device
);
shader_arb_ps_local_constants
(
gl_shader
,
context
,
&
stateBlock
->
state
,
rt_height
);
}
}
...
...
@@ -4563,7 +4561,8 @@ static void shader_arb_select(const struct wined3d_context *context, BOOL usePS,
}
else
{
shader_arb_ps_local_constants
(
This
);
float
rt_height
=
This
->
render_targets
[
0
]
->
currentDesc
.
Height
;
shader_arb_ps_local_constants
(
compiled
,
context
,
state
,
rt_height
);
}
/* Force constant reloading for the NP2 fixup (see comment in shader_glsl_select for more info) */
...
...
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