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
e71a360f
Commit
e71a360f
authored
May 17, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
May 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store pixel shader integer constants as wined3d_ivec4 structures.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
43c31e68
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
20 deletions
+14
-20
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+6
-6
device.c
dlls/wined3d/device.c
+2
-2
glsl_shader.c
dlls/wined3d/glsl_shader.c
+1
-1
stateblock.c
dlls/wined3d/stateblock.c
+4
-10
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/arb_program_shader.c
View file @
e71a360f
...
...
@@ -595,9 +595,9 @@ static void shader_arb_ps_local_constants(const struct arb_ps_compiled_shader *g
if
(
gl_shader
->
int_consts
[
i
]
!=
WINED3D_CONST_NUM_UNUSED
)
{
float
val
[
4
];
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
[
0
]
=
(
float
)
state
->
ps_consts_i
[
i
].
x
;
val
[
1
]
=
(
float
)
state
->
ps_consts_i
[
i
].
y
;
val
[
2
]
=
(
float
)
state
->
ps_consts_i
[
i
].
z
;
val
[
3
]
=
-
1
.
0
f
;
GL_EXTCALL
(
glProgramLocalParameter4fvARB
(
GL_FRAGMENT_PROGRAM_ARB
,
gl_shader
->
int_consts
[
i
],
val
));
...
...
@@ -4598,9 +4598,9 @@ static void find_arb_ps_compile_args(const struct wined3d_state *state,
}
else
{
args
->
loop_ctrl
[
i
][
0
]
=
state
->
ps_consts_i
[
i
*
4
]
;
args
->
loop_ctrl
[
i
][
1
]
=
state
->
ps_consts_i
[
i
*
4
+
1
]
;
args
->
loop_ctrl
[
i
][
2
]
=
state
->
ps_consts_i
[
i
*
4
+
2
]
;
args
->
loop_ctrl
[
i
][
0
]
=
state
->
ps_consts_i
[
i
].
x
;
args
->
loop_ctrl
[
i
][
1
]
=
state
->
ps_consts_i
[
i
].
y
;
args
->
loop_ctrl
[
i
][
2
]
=
state
->
ps_consts_i
[
i
].
z
;
}
}
}
...
...
dlls/wined3d/device.c
View file @
e71a360f
...
...
@@ -2657,7 +2657,7 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device,
if
(
!
constants
||
start_register
>=
WINED3D_MAX_CONSTS_I
)
return
WINED3DERR_INVALIDCALL
;
memcpy
(
&
device
->
update_state
->
ps_consts_i
[
start_register
*
4
],
constants
,
count
*
sizeof
(
int
)
*
4
);
memcpy
(
&
device
->
update_state
->
ps_consts_i
[
start_register
],
constants
,
count
*
sizeof
(
int
)
*
4
);
for
(
i
=
0
;
i
<
count
;
++
i
)
TRACE
(
"Set INT constant %u to {%d, %d, %d, %d}.
\n
"
,
start_register
+
i
,
constants
[
i
*
4
],
constants
[
i
*
4
+
1
],
...
...
@@ -2687,7 +2687,7 @@ HRESULT CDECL wined3d_device_get_ps_consts_i(const struct wined3d_device *device
if
(
!
constants
||
start_register
>=
WINED3D_MAX_CONSTS_I
)
return
WINED3DERR_INVALIDCALL
;
memcpy
(
constants
,
&
device
->
state
.
ps_consts_i
[
start_register
*
4
],
count
*
sizeof
(
int
)
*
4
);
memcpy
(
constants
,
&
device
->
state
.
ps_consts_i
[
start_register
],
count
*
sizeof
(
int
)
*
4
);
return
WINED3D_OK
;
}
...
...
dlls/wined3d/glsl_shader.c
View file @
e71a360f
...
...
@@ -1408,7 +1408,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
prog
->
ps
.
uniform_f_locations
,
&
priv
->
pconst_heap
,
priv
->
stack
,
constant_version
);
if
(
update_mask
&
WINED3D_SHADER_CONST_PS_I
)
shader_glsl_load_constants_i
(
pshader
,
gl_info
,
(
const
struct
wined3d_ivec4
*
)
state
->
ps_consts_i
,
shader_glsl_load_constants_i
(
pshader
,
gl_info
,
state
->
ps_consts_i
,
prog
->
ps
.
uniform_i_locations
,
pshader
->
reg_maps
.
integer_constants
);
if
(
update_mask
&
WINED3D_SHADER_CONST_PS_B
)
...
...
dlls/wined3d/stateblock.c
View file @
e71a360f
...
...
@@ -673,16 +673,10 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock)
for
(
i
=
0
;
i
<
stateblock
->
num_contained_ps_consts_i
;
++
i
)
{
unsigned
int
idx
=
stateblock
->
contained_ps_consts_i
[
i
];
TRACE
(
"Setting ps_consts_i[%u] to {%d, %d, %d, %d}.
\n
"
,
idx
,
src_state
->
ps_consts_i
[
idx
*
4
+
0
],
src_state
->
ps_consts_i
[
idx
*
4
+
1
],
src_state
->
ps_consts_i
[
idx
*
4
+
2
],
src_state
->
ps_consts_i
[
idx
*
4
+
3
]);
stateblock
->
state
.
ps_consts_i
[
idx
*
4
+
0
]
=
src_state
->
ps_consts_i
[
idx
*
4
+
0
];
stateblock
->
state
.
ps_consts_i
[
idx
*
4
+
1
]
=
src_state
->
ps_consts_i
[
idx
*
4
+
1
];
stateblock
->
state
.
ps_consts_i
[
idx
*
4
+
2
]
=
src_state
->
ps_consts_i
[
idx
*
4
+
2
];
stateblock
->
state
.
ps_consts_i
[
idx
*
4
+
3
]
=
src_state
->
ps_consts_i
[
idx
*
4
+
3
];
TRACE
(
"Setting ps_consts_i[%u] to %s.
\n
"
,
idx
,
debug_ivec4
(
&
src_state
->
ps_consts_i
[
idx
]));
stateblock
->
state
.
ps_consts_i
[
idx
]
=
src_state
->
ps_consts_i
[
idx
];
}
/* Pixel shader boolean constants. */
...
...
@@ -934,7 +928,7 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
for
(
i
=
0
;
i
<
stateblock
->
num_contained_ps_consts_i
;
++
i
)
{
wined3d_device_set_ps_consts_i
(
device
,
stateblock
->
contained_ps_consts_i
[
i
],
stateblock
->
state
.
ps_consts_i
+
stateblock
->
contained_ps_consts_i
[
i
]
*
4
,
1
);
&
stateblock
->
state
.
ps_consts_i
[
stateblock
->
contained_ps_consts_i
[
i
]].
x
,
1
);
}
for
(
i
=
0
;
i
<
stateblock
->
num_contained_ps_consts_b
;
++
i
)
{
...
...
dlls/wined3d/wined3d_private.h
View file @
e71a360f
...
...
@@ -2217,7 +2217,7 @@ struct wined3d_state
struct
wined3d_vec4
vs_consts_f
[
WINED3D_MAX_VS_CONSTS_F
];
BOOL
ps_consts_b
[
MAX_CONST_B
];
INT
ps_consts_i
[
WINED3D_MAX_CONSTS_I
*
4
];
struct
wined3d_ivec4
ps_consts_i
[
WINED3D_MAX_CONSTS_I
];
struct
wined3d_vec4
ps_consts_f
[
WINED3D_MAX_PS_CONSTS_F
];
struct
wined3d_texture
*
textures
[
MAX_COMBINED_SAMPLERS
];
...
...
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