mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-06 22:53:35 +00:00
D3D12: Allocate renderable 2D textures as committed resources on Intel GPUs
This patch adds a workaround on Intel Gen9.5 and Gen11 GPUs to always allocate renderable 2D textures as committed resources instead of placed resources to mitigate a driver bug about CreatePlacedResource(). Bug: dawn:1628 Change-Id: I38062115d94933bd58e571c812ff6888e9781df6 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/100640 Commit-Queue: Austin Eng <enga@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
ad73301856
commit
c272282e97
@ -320,11 +320,11 @@ static constexpr ToggleEnumAndInfoList kToggleNameAndInfoList = {{
|
|||||||
"default on Qualcomm GPUs, which have been observed experiencing a driver crash in this "
|
"default on Qualcomm GPUs, which have been observed experiencing a driver crash in this "
|
||||||
"situation.",
|
"situation.",
|
||||||
"https://crbug.com/dawn/1564"}},
|
"https://crbug.com/dawn/1564"}},
|
||||||
{Toggle::D3D12Allocate2DTexturewithCopyDstAsCommittedResource,
|
{Toggle::D3D12Allocate2DTextureWithCopyDstOrRenderAttachmentAsCommittedResource,
|
||||||
{"d3d12_allocate_2d_texture_with_copy_dst_as_committed_resource",
|
{"d3d12_allocate_2d_texture_with_copy_dst_or_render_attachment_as_committed_resource",
|
||||||
"Allocate each 2D texture with CopyDst usage as committed resources instead of placed "
|
"Allocate each 2D texture with CopyDst or RenderAttachment usage as committed resources "
|
||||||
"resources. This toggle is enabled by default on D3D12 backends using Intel Gen9.5 and Gen11 "
|
"instead of placed resources. This toggle is enabled by default on D3D12 backends using "
|
||||||
"GPUs due to a driver issue on Intel D3D12 driver.",
|
"Intel Gen9.5 and Gen11 GPUs due to a driver issue on Intel D3D12 driver.",
|
||||||
"https://crbug.com/1237175"}},
|
"https://crbug.com/1237175"}},
|
||||||
{Toggle::MetalUseCombinedDepthStencilFormatForStencil8,
|
{Toggle::MetalUseCombinedDepthStencilFormatForStencil8,
|
||||||
{"metal_use_combined_depth_stencil_format_for_stencil8",
|
{"metal_use_combined_depth_stencil_format_for_stencil8",
|
||||||
|
@ -81,7 +81,7 @@ enum class Toggle {
|
|||||||
ApplyClearBigIntegerColorValueWithDraw,
|
ApplyClearBigIntegerColorValueWithDraw,
|
||||||
MetalUseMockBlitEncoderForWriteTimestamp,
|
MetalUseMockBlitEncoderForWriteTimestamp,
|
||||||
VulkanSplitCommandBufferOnDepthStencilComputeSampleAfterRenderPass,
|
VulkanSplitCommandBufferOnDepthStencilComputeSampleAfterRenderPass,
|
||||||
D3D12Allocate2DTexturewithCopyDstAsCommittedResource,
|
D3D12Allocate2DTextureWithCopyDstOrRenderAttachmentAsCommittedResource,
|
||||||
MetalUseCombinedDepthStencilFormatForStencil8,
|
MetalUseCombinedDepthStencilFormatForStencil8,
|
||||||
MetalUseBothDepthAndStencilAttachmentsForCombinedDepthStencilFormats,
|
MetalUseBothDepthAndStencilAttachmentsForCombinedDepthStencilFormats,
|
||||||
UseBlitForBufferToDepthTextureCopy,
|
UseBlitForBufferToDepthTextureCopy,
|
||||||
|
@ -721,11 +721,12 @@ void Device::InitTogglesFromDriver() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Currently this workaround is only needed on Intel Gen9.5 and Gen11 GPUs.
|
// Currently these workarounds are only needed on Intel Gen9.5 and Gen11 GPUs.
|
||||||
// See http://crbug.com/1237175 for more information.
|
// See http://crbug.com/1237175 and http://crbug.com/dawn/1628 for more information.
|
||||||
if ((gpu_info::IsIntelGen9(vendorId, deviceId) && !gpu_info::IsSkylake(deviceId)) ||
|
if ((gpu_info::IsIntelGen9(vendorId, deviceId) && !gpu_info::IsSkylake(deviceId)) ||
|
||||||
gpu_info::IsIntelGen11(vendorId, deviceId)) {
|
gpu_info::IsIntelGen11(vendorId, deviceId)) {
|
||||||
SetToggle(Toggle::D3D12Allocate2DTexturewithCopyDstAsCommittedResource, true);
|
SetToggle(Toggle::D3D12Allocate2DTextureWithCopyDstOrRenderAttachmentAsCommittedResource,
|
||||||
|
true);
|
||||||
// Now we don't need to force clearing depth stencil textures with CopyDst as all the depth
|
// Now we don't need to force clearing depth stencil textures with CopyDst as all the depth
|
||||||
// stencil textures (can only be 2D textures) will be created with CreateCommittedResource()
|
// stencil textures (can only be 2D textures) will be created with CreateCommittedResource()
|
||||||
// instead of CreatePlacedResource().
|
// instead of CreatePlacedResource().
|
||||||
|
@ -611,9 +611,10 @@ MaybeError Texture::InitializeAsInternalTexture() {
|
|||||||
bytesPerBlock = GetFormat().GetAspectInfo(wgpu::TextureAspect::All).block.byteSize;
|
bytesPerBlock = GetFormat().GetAspectInfo(wgpu::TextureAspect::All).block.byteSize;
|
||||||
}
|
}
|
||||||
bool forceAllocateAsCommittedResource =
|
bool forceAllocateAsCommittedResource =
|
||||||
device->IsToggleEnabled(Toggle::D3D12Allocate2DTexturewithCopyDstAsCommittedResource) &&
|
(device->IsToggleEnabled(
|
||||||
|
Toggle::D3D12Allocate2DTextureWithCopyDstOrRenderAttachmentAsCommittedResource)) &&
|
||||||
GetDimension() == wgpu::TextureDimension::e2D &&
|
GetDimension() == wgpu::TextureDimension::e2D &&
|
||||||
(GetInternalUsage() & wgpu::TextureUsage::CopyDst);
|
(GetInternalUsage() & (wgpu::TextureUsage::CopyDst | wgpu::TextureUsage::RenderAttachment));
|
||||||
DAWN_TRY_ASSIGN(mResourceAllocation,
|
DAWN_TRY_ASSIGN(mResourceAllocation,
|
||||||
device->AllocateMemory(D3D12_HEAP_TYPE_DEFAULT, resourceDescriptor,
|
device->AllocateMemory(D3D12_HEAP_TYPE_DEFAULT, resourceDescriptor,
|
||||||
D3D12_RESOURCE_STATE_COMMON, bytesPerBlock,
|
D3D12_RESOURCE_STATE_COMMON, bytesPerBlock,
|
||||||
|
@ -312,12 +312,6 @@ crbug.com/dawn/1500 [ intel-gen-9 monterey ] webgpu:api,operation,command_buffer
|
|||||||
################################################################################
|
################################################################################
|
||||||
crbug.com/dawn/1599 [ webgpu-adapter-swiftshader ] webgpu:web_platform,copyToTexture,canvas:color_space_conversion:* [ Failure ]
|
crbug.com/dawn/1599 [ webgpu-adapter-swiftshader ] webgpu:web_platform,copyToTexture,canvas:color_space_conversion:* [ Failure ]
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# webgpu:api,operation,render_pass,storeOp:render_pass_store_op,color_attachment_only:* fail on win10 Intel
|
|
||||||
# KEEP
|
|
||||||
################################################################################
|
|
||||||
crbug.com/dawn/1628 [ intel-gen-9 win10 ] webgpu:api,operation,render_pass,storeOp:render_pass_store_op,color_attachment_only:* [ Failure ]
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# untriaged failures
|
# untriaged failures
|
||||||
################################################################################
|
################################################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user