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
95bbaa62
Commit
95bbaa62
authored
Nov 29, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9/effect: Split parameters data from effect object.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
26e1293d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
11 deletions
+22
-11
d3dx9_private.h
dlls/d3dx9_36/d3dx9_private.h
+12
-2
effect.c
dlls/d3dx9_36/effect.c
+0
-0
preshader.c
dlls/d3dx9_36/preshader.c
+10
-9
No files found.
dlls/d3dx9_36/d3dx9_private.h
View file @
95bbaa62
...
...
@@ -386,14 +386,24 @@ static inline BOOL is_param_dirty(struct d3dx_parameter *param, ULONG64 update_v
return
is_top_level_param_dirty
(
param
->
top_level_param
,
update_version
);
}
struct
d3dx_parameter
*
get_parameter_by_name
(
struct
d3dx_effect
*
effect
,
struct
d3dx_parameters_store
{
struct
wine_rb_tree
tree
;
struct
d3dx_top_level_parameter
*
parameters
;
unsigned
int
count
;
char
*
full_name_tmp
;
unsigned
int
full_name_tmp_size
;
};
struct
d3dx_parameter
*
get_parameter_by_name
(
struct
d3dx_parameters_store
*
store
,
struct
d3dx_parameter
*
parameter
,
const
char
*
name
)
DECLSPEC_HIDDEN
;
#define SET_D3D_STATE_(manager, device, method, args...) (manager ? manager->lpVtbl->method(manager, args) \
: device->lpVtbl->method(device, args))
#define SET_D3D_STATE(base_effect, args...) SET_D3D_STATE_(base_effect->manager, base_effect->device, args)
HRESULT
d3dx_create_param_eval
(
struct
d3dx_
effect
*
effect
,
void
*
byte_code
,
HRESULT
d3dx_create_param_eval
(
struct
d3dx_
parameters_store
*
parameters
,
void
*
byte_code
,
unsigned
int
byte_code_size
,
D3DXPARAMETER_TYPE
type
,
struct
d3dx_param_eval
**
peval
,
ULONG64
*
version_counter
,
const
char
**
skip_constants
,
unsigned
int
skip_constants_count
)
DECLSPEC_HIDDEN
;
...
...
dlls/d3dx9_36/effect.c
View file @
95bbaa62
This diff is collapsed.
Click to expand it.
dlls/d3dx9_36/preshader.c
View file @
95bbaa62
...
...
@@ -851,7 +851,7 @@ static HRESULT init_set_constants_param(struct d3dx_const_tab *const_tab, ID3DXC
}
static
HRESULT
get_constants_desc
(
unsigned
int
*
byte_code
,
struct
d3dx_const_tab
*
out
,
struct
d3dx_
effect
*
effect
,
const
char
**
skip_constants
,
struct
d3dx_
parameters_store
*
parameters
,
const
char
**
skip_constants
,
unsigned
int
skip_constants_count
,
struct
d3dx_preshader
*
pres
)
{
ID3DXConstantTable
*
ctab
;
...
...
@@ -896,7 +896,7 @@ static HRESULT get_constants_desc(unsigned int *byte_code, struct d3dx_const_tab
}
if
(
FAILED
(
hr
=
get_ctab_constant_desc
(
ctab
,
hc
,
&
cdesc
[
index
],
&
constantinfo_reserved
)))
goto
cleanup
;
inputs_param
[
index
]
=
get_parameter_by_name
(
effect
,
NULL
,
cdesc
[
index
].
Name
);
inputs_param
[
index
]
=
get_parameter_by_name
(
parameters
,
NULL
,
cdesc
[
index
].
Name
);
if
(
!
inputs_param
[
index
])
{
WARN
(
"Could not find parameter %s in effect.
\n
"
,
cdesc
[
index
].
Name
);
...
...
@@ -1106,7 +1106,8 @@ static void dump_preshader(struct d3dx_preshader *pres)
dump_ins
(
&
pres
->
regs
,
&
pres
->
ins
[
i
]);
}
static
HRESULT
parse_preshader
(
struct
d3dx_preshader
*
pres
,
unsigned
int
*
ptr
,
unsigned
int
count
,
struct
d3dx_effect
*
effect
)
static
HRESULT
parse_preshader
(
struct
d3dx_preshader
*
pres
,
unsigned
int
*
ptr
,
unsigned
int
count
,
struct
d3dx_parameters_store
*
parameters
)
{
unsigned
int
*
p
;
unsigned
int
i
,
j
,
const_count
;
...
...
@@ -1173,7 +1174,7 @@ static HRESULT parse_preshader(struct d3dx_preshader *pres, unsigned int *ptr, u
saved_word
=
*
ptr
;
*
ptr
=
0xfffe0000
;
hr
=
get_constants_desc
(
ptr
,
&
pres
->
inputs
,
effect
,
NULL
,
0
,
NULL
);
hr
=
get_constants_desc
(
ptr
,
&
pres
->
inputs
,
parameters
,
NULL
,
0
,
NULL
);
*
ptr
=
saved_word
;
if
(
FAILED
(
hr
))
return
hr
;
...
...
@@ -1226,7 +1227,7 @@ static HRESULT parse_preshader(struct d3dx_preshader *pres, unsigned int *ptr, u
return
D3D_OK
;
}
HRESULT
d3dx_create_param_eval
(
struct
d3dx_
effect
*
effect
,
void
*
byte_code
,
unsigned
int
byte_code_size
,
HRESULT
d3dx_create_param_eval
(
struct
d3dx_
parameters_store
*
parameters
,
void
*
byte_code
,
unsigned
int
byte_code_size
,
D3DXPARAMETER_TYPE
type
,
struct
d3dx_param_eval
**
peval_out
,
ULONG64
*
version_counter
,
const
char
**
skip_constants
,
unsigned
int
skip_constants_count
)
{
...
...
@@ -1237,8 +1238,8 @@ HRESULT d3dx_create_param_eval(struct d3dx_effect *effect, void *byte_code, unsi
unsigned
int
count
,
pres_size
;
HRESULT
ret
;
TRACE
(
"
effect
%p, byte_code %p, byte_code_size %u, type %u, peval_out %p.
\n
"
,
effect
,
byte_code
,
byte_code_size
,
type
,
peval_out
);
TRACE
(
"
parameters
%p, byte_code %p, byte_code_size %u, type %u, peval_out %p.
\n
"
,
parameters
,
byte_code
,
byte_code_size
,
type
,
peval_out
);
count
=
byte_code_size
/
sizeof
(
unsigned
int
);
if
(
!
byte_code
||
!
count
)
...
...
@@ -1288,7 +1289,7 @@ HRESULT d3dx_create_param_eval(struct d3dx_effect *effect, void *byte_code, unsi
pres_size
=
count
;
}
if
(
ptr
&&
FAILED
(
ret
=
parse_preshader
(
&
peval
->
pres
,
ptr
,
pres_size
,
effect
)))
if
(
ptr
&&
FAILED
(
ret
=
parse_preshader
(
&
peval
->
pres
,
ptr
,
pres_size
,
parameters
)))
{
FIXME
(
"Failed parsing preshader, byte code for analysis follows.
\n
"
);
dump_bytecode
(
byte_code
,
byte_code_size
);
...
...
@@ -1297,7 +1298,7 @@ HRESULT d3dx_create_param_eval(struct d3dx_effect *effect, void *byte_code, unsi
if
(
shader
)
{
if
(
FAILED
(
ret
=
get_constants_desc
(
shader_ptr
,
&
peval
->
shader_inputs
,
effect
,
if
(
FAILED
(
ret
=
get_constants_desc
(
shader_ptr
,
&
peval
->
shader_inputs
,
parameters
,
skip_constants
,
skip_constants_count
,
&
peval
->
pres
)))
{
TRACE
(
"Could not get shader constant table, hr %#lx.
\n
"
,
ret
);
...
...
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