Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
vkd3d
Manage
Activity
Members
Labels
Plan
Wiki
Bugzilla
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wine
vkd3d
Commits
f4f803c7
Commit
f4f803c7
authored
7 years ago
by
Józef Kucia
Browse files
Options
Downloads
Patches
Plain Diff
libs/vkd3d: Add initial implementation for d3d12_device_GetCopyableFootprints().
parent
9e181110
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/d3d12.idl
+1
-0
1 addition, 0 deletions
include/d3d12.idl
libs/vkd3d/device.c
+72
-12
72 additions, 12 deletions
libs/vkd3d/device.c
with
73 additions
and
12 deletions
include/d3d12.idl
+
1
−
0
View file @
f4f803c7
...
...
@@ -49,6 +49,7 @@ const UINT D3D12_SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAK
=
1
<<
(
D3D12_SHADER_COMPONENT_MAPPING_SHIFT
*
4
)
;
const
UINT
D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT
=
8
;
const
UINT
D3D12_TEXTURE_DATA_PITCH_ALIGNMENT
=
256
;
const
UINT
D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT
=
512
;
const
UINT
D3D12_VS_INPUT_REGISTER_COUNT
=
32
;
const
UINT
D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE
=
16
;
...
...
This diff is collapsed.
Click to expand it.
libs/vkd3d/device.c
+
72
−
12
View file @
f4f803c7
...
...
@@ -1026,19 +1026,79 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_GetDeviceRemovedReason(ID3D12Devic
}
static
void
STDMETHODCALLTYPE
d3d12_device_GetCopyableFootprints
(
ID3D12Device
*
iface
,
const
D3D12_RESOURCE_DESC
*
desc
,
UINT
first_sub_resource
,
UINT
sub_resource_count
,
UINT64
base_offset
,
D3D12_PLACED_SUBRESOURCE_FOOTPRINT
*
layouts
,
UINT
*
row_count
,
UINT64
*
row_size
,
UINT64
*
total_bytes
)
const
D3D12_RESOURCE_DESC
*
desc
,
UINT
first_sub_resource
,
UINT
sub_resource_count
,
UINT64
base_offset
,
D3D12_PLACED_SUBRESOURCE_FOOTPRINT
*
layouts
,
UINT
*
row_counts
,
UINT64
*
row_sizes
,
UINT64
*
total_bytes
)
{
FIXME
(
"iface %p, desc %p, first_sub_resource %u, sub_resource_count %u, base_offset %#"
PRIx64
", "
"layouts %p, row_count %p, row_size %p, total_bytes %p stub!
\n
"
,
iface
,
desc
,
first_sub_resource
,
sub_resource_count
,
base_offset
,
layouts
,
row_count
,
row_size
,
total_bytes
);
unsigned
int
i
,
sub_resource_idx
,
miplevel_idx
,
width
,
height
,
row_size
,
row_pitch
;
const
struct
vkd3d_format
*
format
;
UINT64
offset
,
total
;
TRACE
(
"iface %p, desc %p, first_sub_resource %u, sub_resource_count %u, base_offset %#"
PRIx64
", "
"layouts %p, row_counts %p, row_sizes %p, total_bytes %p.
\n
"
,
iface
,
desc
,
first_sub_resource
,
sub_resource_count
,
base_offset
,
layouts
,
row_counts
,
row_sizes
,
total_bytes
);
if
(
layouts
)
memset
(
layouts
,
0xff
,
sizeof
(
*
layouts
)
*
sub_resource_count
);
if
(
row_counts
)
memset
(
row_counts
,
0xff
,
sizeof
(
*
row_counts
)
*
sub_resource_count
);
if
(
row_sizes
)
memset
(
row_sizes
,
0xff
,
sizeof
(
*
row_sizes
)
*
sub_resource_count
);
if
(
total_bytes
)
*
total_bytes
=
~
(
UINT64
)
0
;
if
(
!
(
format
=
vkd3d_get_format
(
desc
->
Format
)))
{
WARN
(
"Invalid format %#x.
\n
"
,
desc
->
Format
);
return
;
}
if
(
desc
->
Dimension
!=
D3D12_RESOURCE_DIMENSION_TEXTURE2D
)
{
FIXME
(
"Unhandled resource dimension %#x.
\n
"
,
desc
->
Dimension
);
return
;
}
if
(
first_sub_resource
>=
desc
->
MipLevels
*
desc
->
DepthOrArraySize
||
sub_resource_count
>
desc
->
MipLevels
*
desc
->
DepthOrArraySize
-
first_sub_resource
)
{
WARN
(
"Invalid sub-resource range %u-%u for resource.
\n
"
,
first_sub_resource
,
sub_resource_count
);
return
;
}
if
(
base_offset
)
FIXME
(
"Ignoring base offset %#"
PRIx64
".
\n
"
,
base_offset
);
offset
=
0
;
total
=
0
;
for
(
i
=
0
;
i
<
sub_resource_count
;
++
i
)
{
sub_resource_idx
=
first_sub_resource
+
i
;
miplevel_idx
=
sub_resource_idx
%
desc
->
MipLevels
;
width
=
max
(
1
,
desc
->
Width
>>
miplevel_idx
);
height
=
max
(
1
,
desc
->
Height
>>
miplevel_idx
);
row_size
=
width
*
format
->
byte_count
;
row_pitch
=
align
(
row_size
,
D3D12_TEXTURE_DATA_PITCH_ALIGNMENT
);
if
(
layouts
)
{
layouts
[
i
].
Offset
=
offset
;
layouts
[
i
].
Footprint
.
Format
=
desc
->
Format
;
layouts
[
i
].
Footprint
.
Width
=
width
;
layouts
[
i
].
Footprint
.
Height
=
height
;
layouts
[
i
].
Footprint
.
Depth
=
1
;
layouts
[
i
].
Footprint
.
RowPitch
=
row_pitch
;
}
if
(
row_counts
)
row_counts
[
i
]
=
height
;
if
(
row_sizes
)
row_sizes
[
i
]
=
row_size
;
total
=
offset
+
max
(
0
,
height
-
1
)
*
row_pitch
+
row_size
;
offset
=
align
(
total
,
D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT
);
}
if
(
total_bytes
)
*
total_bytes
=
total
;
}
static
HRESULT
STDMETHODCALLTYPE
d3d12_device_CreateQueryHeap
(
ID3D12Device
*
iface
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment