[GPU] GCC build fix for render target cache
This commit is contained in:
parent
247cb91ac5
commit
cfd18b89f8
|
@ -1342,7 +1342,7 @@ void RenderTargetCache::ChangeOwnership(
|
||||||
nullptr, resolve_clear_cutout)) {
|
nullptr, resolve_clear_cutout)) {
|
||||||
RenderTargetKey transfer_host_depth_source =
|
RenderTargetKey transfer_host_depth_source =
|
||||||
host_depth_encoding_different
|
host_depth_encoding_different
|
||||||
? it->second.host_depth_render_targets[dest.resource_format]
|
? it->second.GetHostDepthRenderTarget(dest.GetDepthFormat())
|
||||||
: RenderTargetKey();
|
: RenderTargetKey();
|
||||||
if (transfer_host_depth_source == transfer_source) {
|
if (transfer_host_depth_source == transfer_source) {
|
||||||
// Same render target, don't provide a separate host depth source.
|
// Same render target, don't provide a separate host depth source.
|
||||||
|
@ -1387,7 +1387,7 @@ void RenderTargetCache::ChangeOwnership(
|
||||||
// Claim the current range.
|
// Claim the current range.
|
||||||
it->second.render_target = dest;
|
it->second.render_target = dest;
|
||||||
if (host_depth_encoding_different) {
|
if (host_depth_encoding_different) {
|
||||||
it->second.host_depth_render_targets[dest.resource_format] = dest;
|
it->second.GetHostDepthRenderTarget(dest.GetDepthFormat()) = dest;
|
||||||
}
|
}
|
||||||
// Check if can merge with the next range after claiming.
|
// Check if can merge with the next range after claiming.
|
||||||
std::map<uint32_t, OwnershipRange>::iterator it_next;
|
std::map<uint32_t, OwnershipRange>::iterator it_next;
|
||||||
|
|
|
@ -538,13 +538,8 @@ class RenderTargetCache {
|
||||||
// float32 value to that of an unorm24 with a totally wrong value). If the
|
// float32 value to that of an unorm24 with a totally wrong value). If the
|
||||||
// range hasn't been used yet (render_target.IsEmpty() == true), these are
|
// range hasn't been used yet (render_target.IsEmpty() == true), these are
|
||||||
// empty too.
|
// empty too.
|
||||||
union {
|
|
||||||
struct {
|
|
||||||
RenderTargetKey host_depth_render_target_unorm24;
|
RenderTargetKey host_depth_render_target_unorm24;
|
||||||
RenderTargetKey host_depth_render_target_float24;
|
RenderTargetKey host_depth_render_target_float24;
|
||||||
};
|
|
||||||
RenderTargetKey host_depth_render_targets[2];
|
|
||||||
};
|
|
||||||
OwnershipRange(uint32_t end_tiles, RenderTargetKey render_target,
|
OwnershipRange(uint32_t end_tiles, RenderTargetKey render_target,
|
||||||
RenderTargetKey host_depth_render_target_unorm24,
|
RenderTargetKey host_depth_render_target_unorm24,
|
||||||
RenderTargetKey host_depth_render_target_float24)
|
RenderTargetKey host_depth_render_target_float24)
|
||||||
|
@ -552,6 +547,22 @@ class RenderTargetCache {
|
||||||
render_target(render_target),
|
render_target(render_target),
|
||||||
host_depth_render_target_unorm24(host_depth_render_target_unorm24),
|
host_depth_render_target_unorm24(host_depth_render_target_unorm24),
|
||||||
host_depth_render_target_float24(host_depth_render_target_float24) {}
|
host_depth_render_target_float24(host_depth_render_target_float24) {}
|
||||||
|
const RenderTargetKey& GetHostDepthRenderTarget(
|
||||||
|
xenos::DepthRenderTargetFormat resource_format) const {
|
||||||
|
assert_true(
|
||||||
|
resource_format == xenos::DepthRenderTargetFormat::kD24S8 ||
|
||||||
|
resource_format == xenos::DepthRenderTargetFormat::kD24FS8,
|
||||||
|
"Illegal resource format");
|
||||||
|
return resource_format == xenos::DepthRenderTargetFormat::kD24S8
|
||||||
|
? host_depth_render_target_unorm24
|
||||||
|
: host_depth_render_target_float24;
|
||||||
|
}
|
||||||
|
RenderTargetKey& GetHostDepthRenderTarget(
|
||||||
|
xenos::DepthRenderTargetFormat resource_format) {
|
||||||
|
return const_cast<RenderTargetKey&>(
|
||||||
|
const_cast<const OwnershipRange*>(this)->GetHostDepthRenderTarget(
|
||||||
|
resource_format));
|
||||||
|
}
|
||||||
bool IsOwnedBy(RenderTargetKey key,
|
bool IsOwnedBy(RenderTargetKey key,
|
||||||
bool host_depth_encoding_different) const {
|
bool host_depth_encoding_different) const {
|
||||||
if (render_target != key) {
|
if (render_target != key) {
|
||||||
|
@ -561,7 +572,7 @@ class RenderTargetCache {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (host_depth_encoding_different && !key.is_depth &&
|
if (host_depth_encoding_different && !key.is_depth &&
|
||||||
host_depth_render_targets[key.resource_format] != key) {
|
GetHostDepthRenderTarget(key.GetDepthFormat()) != key) {
|
||||||
// Depth encoding is the same, but different addressing is needed.
|
// Depth encoding is the same, but different addressing is needed.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue