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
67f6073b
Commit
67f6073b
authored
Feb 18, 2022
by
Matteo Bruni
Committed by
Alexandre Julliard
Feb 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Handle D3DXCONSTTABLE_LARGEADDRESSAWARE flag.
Signed-off-by:
Matteo Bruni
<
mbruni@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
514bac00
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
4 deletions
+40
-4
shader.c
dlls/d3dx9_36/shader.c
+12
-4
shader.c
dlls/d3dx9_36/tests/shader.c
+28
-0
No files found.
dlls/d3dx9_36/shader.c
View file @
67f6073b
...
...
@@ -681,11 +681,13 @@ HRESULT WINAPI D3DXPreprocessShaderFromResourceW(HMODULE module, const WCHAR *re
}
struct
ID3DXConstantTableImpl
{
struct
ID3DXConstantTableImpl
{
ID3DXConstantTable
ID3DXConstantTable_iface
;
LONG
ref
;
char
*
ctab
;
DWORD
size
;
DWORD
flags
;
D3DXCONSTANTTABLE_DESC
desc
;
struct
ctab_constant
*
constants
;
};
...
...
@@ -860,6 +862,9 @@ static inline struct ctab_constant *get_valid_constant(struct ID3DXConstantTable
if
(
c
)
return
c
;
}
if
(
table
->
flags
&
D3DXCONSTTABLE_LARGEADDRESSAWARE
)
return
NULL
;
return
get_constant_by_name
(
table
,
NULL
,
handle
);
}
...
...
@@ -1959,9 +1964,10 @@ HRESULT WINAPI D3DXGetShaderConstantTableEx(const DWORD *byte_code, DWORD flags,
const
D3DXSHADER_CONSTANTINFO
*
constant_info
;
DWORD
i
;
TRACE
(
"byte_code %p, flags %
x, constant_table %p
\n
"
,
byte_code
,
flags
,
constant_table
);
TRACE
(
"byte_code %p, flags %
#x, constant_table %p.
\n
"
,
byte_code
,
flags
,
constant_table
);
if
(
constant_table
)
*
constant_table
=
NULL
;
if
(
constant_table
)
*
constant_table
=
NULL
;
if
(
!
byte_code
||
!
constant_table
)
{
...
...
@@ -1975,7 +1981,8 @@ HRESULT WINAPI D3DXGetShaderConstantTableEx(const DWORD *byte_code, DWORD flags,
return
D3D_OK
;
}
if
(
flags
)
FIXME
(
"Flags (%#x) are not handled, yet!
\n
"
,
flags
);
if
(
flags
&
~
D3DXCONSTTABLE_LARGEADDRESSAWARE
)
FIXME
(
"Flags %#x not handled.
\n
"
,
flags
);
hr
=
D3DXFindShaderComment
(
byte_code
,
MAKEFOURCC
(
'C'
,
'T'
,
'A'
,
'B'
),
&
data
,
&
size
);
if
(
hr
!=
D3D_OK
)
...
...
@@ -2014,6 +2021,7 @@ HRESULT WINAPI D3DXGetShaderConstantTableEx(const DWORD *byte_code, DWORD flags,
object
->
size
=
size
;
memcpy
(
object
->
ctab
,
data
,
object
->
size
);
object
->
flags
=
flags
;
object
->
desc
.
Creator
=
ctab_header
->
Creator
?
object
->
ctab
+
ctab_header
->
Creator
:
NULL
;
object
->
desc
.
Version
=
ctab_header
->
Version
;
object
->
desc
.
Constants
=
ctab_header
->
Constants
;
...
...
dlls/d3dx9_36/tests/shader.c
View file @
67f6073b
...
...
@@ -556,6 +556,34 @@ static void test_get_shader_constant_table_ex(void)
ID3DXConstantTable_Release
(
constant_table
);
hr
=
D3DXGetShaderConstantTableEx
(
shader_with_ctab_constants
,
D3DXCONSTTABLE_LARGEADDRESSAWARE
,
&
constant_table
);
ok
(
hr
==
D3D_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!!
constant_table
,
"Unexpected constant table %p.
\n
"
,
constant_table
);
hr
=
ID3DXConstantTable_GetDesc
(
constant_table
,
&
desc
);
ok
(
hr
==
D3D_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
strcmp
(
desc
.
Creator
,
"Wine project"
),
"Unexpected Creator %s.
\n
"
,
debugstr_a
(
desc
.
Creator
));
ok
(
desc
.
Version
==
D3DVS_VERSION
(
3
,
0
),
"Unexpected Version %#x.
\n
"
,
desc
.
Version
);
ok
(
desc
.
Constants
==
3
,
"Unexpected Constants %u.
\n
"
,
desc
.
Constants
);
constant
=
ID3DXConstantTable_GetConstant
(
constant_table
,
NULL
,
0
);
ok
(
!!
constant
,
"No constant found.
\n
"
);
hr
=
ID3DXConstantTable_GetConstantDesc
(
constant_table
,
constant
,
&
constant_desc
,
&
nb
);
ok
(
hr
==
D3D_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
strcmp
(
constant_desc
.
Name
,
"Constant1"
),
"Unexpected Name %s.
\n
"
,
debugstr_a
(
constant_desc
.
Name
));
ok
(
constant_desc
.
Class
==
D3DXPC_VECTOR
,
"Unexpected Class %u.
\n
"
,
constant_desc
.
Class
);
ok
(
constant_desc
.
Type
==
D3DXPT_FLOAT
,
"Unexpected Type %u.
\n
"
,
constant_desc
.
Type
);
ok
(
constant_desc
.
Rows
==
1
,
"Unexpected Rows %u.
\n
"
,
constant_desc
.
Rows
);
ok
(
constant_desc
.
Columns
==
4
,
"Unexpected Columns %u.
\n
"
,
constant_desc
.
Columns
);
if
(
0
)
{
/* Native d3dx crashes with this. */
hr
=
ID3DXConstantTable_GetConstantDesc
(
constant_table
,
"Constant3"
,
&
constant_desc
,
&
nb
);
}
ID3DXConstantTable_Release
(
constant_table
);
hr
=
D3DXGetShaderConstantTableEx
(
fx_shader_with_ctab
,
0
,
&
constant_table
);
ok
(
hr
==
D3D_OK
,
"Got result %x, expected 0 (D3D_OK).
\n
"
,
hr
);
ok
(
!
constant_table
,
"D3DXGetShaderConstantTableEx() returned a non-NULL constant table.
\n
"
);
...
...
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