dawn-cmake/src/dawn_native
Corentin Wallez 48183b8f58 Vulkan: honor bufferImageGranularity the simplest way.
Vulkan requires that linear and opaque resources be placed in different
"pages" of bufferImageGranularity size, as some hardware uses the page
table to contain some compression bits or other stuff. Make Dawn honor
this limit by aligning all allocations to bufferImageGranularity. This
is pretty bad and should be improved later.

Also does some cleanups:
 - Add kMappableBufferUsage to represent all mappable usages.
 - Remove the proxy function for resource management from
   vulkan::Device and call ResourceMemoryAllocator directly.
 - Use an enum to make the difference between mappable, linear and
   opaque resources.

This issue was found while doing a change of the memory type selection
in Vulkan, that started failing some unrelated tests on Nvidia. Without
knowing the details of the HW or the driver it is really hard to write
tests, except by copy-pasting a failing test. This is why there is no
test added in this CL, and instead will rely on tests not failing with
the follow-up CL.

Bug: dawn:659

Change-Id: Ib7c1f3f1949457e04ca8e23d212dc60af7046213
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52920
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-06-22 13:41:35 +00:00
..
d3d12 Implement copies b/w 3D and 2DArray textures on D3D12 2021-06-18 07:44:12 +00:00
metal Vulkan: honor bufferImageGranularity the simplest way. 2021-06-22 13:41:35 +00:00
null Triage Dawn TODOs 2021-06-07 18:23:52 +00:00
opengl Implement internal storage for buffer usage and buffer binding type 2021-06-16 14:33:27 +00:00
vulkan Vulkan: honor bufferImageGranularity the simplest way. 2021-06-22 13:41:35 +00:00
Adapter.cpp Triage Dawn TODOs 2021-06-04 22:23:56 +00:00
Adapter.h Reset Internal D3D12 Device After Test Shutdown 2021-02-24 22:09:30 +00:00
AsyncTask.cpp D3D12: Support creating compute pipeline asynchronously 2021-06-04 05:12:06 +00:00
AsyncTask.h Triage Dawn TODOs 2021-06-04 22:23:56 +00:00
AttachmentState.cpp Removed deprecated CreateRenderPipeline path 2021-05-21 05:01:38 +00:00
AttachmentState.h Removed deprecated CreateRenderPipeline path 2021-05-21 05:01:38 +00:00
BUILD.gn Triage Dawn TODOs 2021-06-07 18:23:52 +00:00
BackendConnection.cpp Add WGPUAdapterProperties and expose it in DawnNative 2020-01-10 13:28:18 +00:00
BackendConnection.h Add WGPUAdapterProperties and expose it in DawnNative 2020-01-10 13:28:18 +00:00
BindGroup.cpp Implement internal storage for buffer usage and buffer binding type 2021-06-16 14:33:27 +00:00
BindGroup.h Implement External Texture Binding Functionality 2021-06-01 19:45:53 +00:00
BindGroupLayout.cpp Implement internal storage for buffer usage and buffer binding type 2021-06-16 14:33:27 +00:00
BindGroupLayout.h OpenGL: Use binding= for all bindings in generated GLSL 2021-05-19 18:29:37 +00:00
BindGroupTracker.h Remove kMaxBindingsPerGroup limit 2020-07-14 22:20:35 +00:00
BindingInfo.cpp Implement internal storage for buffer usage and buffer binding type 2021-06-16 14:33:27 +00:00
BindingInfo.h Implement External Texture Binding Functionality 2021-06-01 19:45:53 +00:00
BuddyAllocator.cpp Triage Dawn TODOs 2021-06-04 22:23:56 +00:00
BuddyAllocator.h Triage Dawn TODOs 2021-06-04 22:23:56 +00:00
BuddyMemoryAllocator.cpp Prevent size overflow for sub-allocation. 2020-06-11 18:58:26 +00:00
BuddyMemoryAllocator.h Add some missing #includes. 2019-10-29 18:40:12 +00:00
Buffer.cpp Implement internal storage for buffer usage and buffer binding type 2021-06-16 14:33:27 +00:00
Buffer.h Vulkan: honor bufferImageGranularity the simplest way. 2021-06-22 13:41:35 +00:00
CMakeLists.txt Implement AsyncWaitableEvent with std::condition_variable 2021-05-27 00:49:03 +00:00
CachedObject.cpp Pipeline caching: refactor object hashing 2020-12-03 18:42:13 +00:00
CachedObject.h Fix issues with roll into Skia 2020-12-08 16:32:34 +00:00
CallbackTaskManager.cpp Implement CallbackTaskManager for Create*PipelineAsync 2021-05-02 03:22:30 +00:00
CallbackTaskManager.h Implement AsyncWaitableEvent with std::condition_variable 2021-05-27 00:49:03 +00:00
CommandAllocator.cpp Triage Dawn TODOs 2021-06-04 22:23:56 +00:00
CommandAllocator.h Triage Dawn TODOs 2021-06-04 22:23:56 +00:00
CommandBuffer.cpp Implement 3D texture copy on D3D12 backend: copy to entire 3DTexture 2021-04-01 22:40:43 +00:00
CommandBuffer.h Limit Clear Color Values to 2^24 For Integer Formats 2020-10-01 19:56:49 +00:00
CommandBufferStateTracker.cpp Properly implement per-dispatch synchronization scopes. 2021-05-06 19:20:14 +00:00
CommandBufferStateTracker.h Properly implement per-dispatch synchronization scopes. 2021-05-06 19:20:14 +00:00
CommandEncoder.cpp Validate that DS attachment must cover all aspects of the texture. 2021-06-11 14:25:29 +00:00
CommandEncoder.h CommandBufferResourceUsage: track render and compute separately. 2021-05-05 15:41:13 +00:00
CommandValidation.cpp Triage Dawn TODOs 2021-06-04 22:23:56 +00:00
CommandValidation.h Remove useless function declarations 2021-06-03 07:42:15 +00:00
Commands.cpp Rename setBlendColor->setBlendConstant 2021-04-15 19:33:58 +00:00
Commands.h Rename setBlendColor->setBlendConstant 2021-04-15 19:33:58 +00:00
CompilationMessages.cpp Emit tint warning when creating shader module 2021-06-18 13:29:39 +00:00
CompilationMessages.h Emit tint warning when creating shader module 2021-06-18 13:29:39 +00:00
ComputePassEncoder.cpp Properly implement per-dispatch synchronization scopes. 2021-05-06 19:20:14 +00:00
ComputePassEncoder.h Properly implement per-dispatch synchronization scopes. 2021-05-06 19:20:14 +00:00
ComputePipeline.cpp ComputePipelineDescriptor.computeStage->compute 2021-06-09 18:07:32 +00:00
ComputePipeline.h D3D12: Support creating compute pipeline asynchronously 2021-06-04 05:12:06 +00:00
CopyTextureForBrowserHelper.cpp CopyTextureForBrowser(): Support Alpha Ops 2021-06-21 10:05:37 +00:00
CopyTextureForBrowserHelper.h Rename Buffer/TextureCopyView to ImageCopyBuffer/Texture. 2021-03-04 18:13:45 +00:00
CreatePipelineAsyncTask.cpp ComputePipelineDescriptor.computeStage->compute 2021-06-09 18:07:32 +00:00
CreatePipelineAsyncTask.h D3D12: Support creating compute pipeline asynchronously 2021-06-04 05:12:06 +00:00
DawnNative.cpp dawn_native: Prefix all API methods with API 2021-03-29 14:02:05 +00:00
Device.cpp Emit tint warning when creating shader module 2021-06-18 13:29:39 +00:00
Device.h Emit tint warning when creating shader module 2021-06-18 13:29:39 +00:00
DynamicUploader.cpp Use typed integers for the ExecutionSerial 2020-09-28 19:35:14 +00:00
DynamicUploader.h Use typed integers for the ExecutionSerial 2020-09-28 19:35:14 +00:00
EncodingContext.cpp Separate the types for compute and render pass usage data 2021-05-05 19:55:23 +00:00
EncodingContext.h Separate the types for compute and render pass usage data 2021-05-05 19:55:23 +00:00
EnumClassBitmasks.h Track depth/stencil aspects independently 2020-08-06 17:00:29 +00:00
EnumMaskIterator.h EnumMaskIterator: ASSERT when the mask is too big. 2021-01-21 10:11:54 +00:00
Error.cpp Fix AssertAndIgnoreDeviceLossError to handle errors injected by fuzzer 2020-06-16 17:53:38 +00:00
Error.h Fix Vulkan leak if vkMapMemory fails 2021-02-19 18:31:02 +00:00
ErrorData.cpp Separate device lost from internal errors. 2020-04-01 12:07:43 +00:00
ErrorData.h Separate device lost from internal errors. 2020-04-01 12:07:43 +00:00
ErrorInjector.cpp Reland "fuzzing: Add supportsErrorInjection option to DawnWireServerFuzzer" 2020-01-06 19:56:17 +00:00
ErrorInjector.h Reland "fuzzing: Add supportsErrorInjection option to DawnWireServerFuzzer" 2020-01-06 19:56:17 +00:00
ErrorScope.cpp Simplify ErrorScopes 2021-02-19 18:17:22 +00:00
ErrorScope.h Simplify ErrorScopes 2021-02-19 18:17:22 +00:00
Extensions.cpp Add depth-clamping support for Metal 2021-04-05 17:16:47 +00:00
Extensions.h Add depth-clamping support for Metal 2021-04-05 17:16:47 +00:00
ExternalTexture.cpp Implement External Texture Binding Functionality 2021-06-01 19:45:53 +00:00
ExternalTexture.h Follow-up For ExternalTexture Binding Feedback 2021-06-08 20:29:37 +00:00
Format.cpp Triage Dawn TODOs 2021-06-04 22:23:56 +00:00
Format.h Add GPUExternalTexture Types 2021-04-01 20:46:42 +00:00
Forward.h Implement External Texture Binding Functionality 2021-06-01 19:45:53 +00:00
Instance.cpp D3D12: Support creating compute pipeline asynchronously 2021-06-04 05:12:06 +00:00
Instance.h D3D12: Support creating compute pipeline asynchronously 2021-06-04 05:12:06 +00:00
IntegerTypes.h Use typed integers for the ExecutionSerial 2020-09-28 19:35:14 +00:00
InternalPipelineStore.h Reland "CopyTextureForBrowser: Support color format conversion" 2021-03-23 02:09:37 +00:00
ObjectBase.cpp Make RefCounted derived objects have private destructors 2020-04-06 18:20:02 +00:00
ObjectBase.h Move and improve RefCounted 2020-04-20 17:36:22 +00:00
ObjectContentHasher.cpp Pipeline caching: refactor object hashing 2020-12-03 18:42:13 +00:00
ObjectContentHasher.h Rename STRIDE_UNDEFINED to COPY_STRIDE_UNDEFINED 2020-12-16 07:53:30 +00:00
PassResourceUsage.h Implement External Texture Binding Functionality 2021-06-01 19:45:53 +00:00
PassResourceUsageTracker.cpp Implement internal storage for buffer usage and buffer binding type 2021-06-16 14:33:27 +00:00
PassResourceUsageTracker.h Implement External Texture Binding Functionality 2021-06-01 19:45:53 +00:00
PerStage.cpp Make dawn_native use the webgpu.h header 2019-10-23 11:57:41 +00:00
PerStage.h Make dawn_native use the webgpu.h header 2019-10-23 11:57:41 +00:00
PersistentCache.cpp D3D12: Support creating compute pipeline asynchronously 2021-06-04 05:12:06 +00:00
PersistentCache.h D3D12: Support creating compute pipeline asynchronously 2021-06-04 05:12:06 +00:00
Pipeline.cpp dawn_native: Use refcount-safe methods for reentrant object creation 2021-04-19 08:52:35 +00:00
Pipeline.h dawn_native: Use refcount-safe methods for reentrant object creation 2021-04-19 08:52:35 +00:00
PipelineLayout.cpp Implement External Texture Binding Functionality 2021-06-01 19:45:53 +00:00
PipelineLayout.h Implement validation for RenderPipelineDescriptor2 2021-03-31 08:56:02 +00:00
PooledResourceMemoryAllocator.cpp Rename STRIDE_UNDEFINED to COPY_STRIDE_UNDEFINED 2020-12-16 07:53:30 +00:00
PooledResourceMemoryAllocator.h Pool sub-allocated resource heaps. 2020-08-17 17:47:15 +00:00
ProgrammablePassEncoder.cpp Separate the types for compute and render pass usage data 2021-05-05 19:55:23 +00:00
ProgrammablePassEncoder.h Separate the types for compute and render pass usage data 2021-05-05 19:55:23 +00:00
QueryHelper.cpp Omit types in most WGSL `var` statements. 2021-06-17 21:36:11 +00:00
QueryHelper.h Fix query index of availability in timestamp shader 2021-05-18 01:13:08 +00:00
QuerySet.cpp Disallow pipeline statistics query as UnsafeAPIs 2021-06-09 08:47:37 +00:00
QuerySet.h dawn_native: Prefix all API methods with API 2021-03-29 14:02:05 +00:00
Queue.cpp Implement External Texture Binding Functionality 2021-06-01 19:45:53 +00:00
Queue.h Remove Fences 2021-05-21 00:01:08 +00:00
RenderBundle.cpp Separate the types for compute and render pass usage data 2021-05-05 19:55:23 +00:00
RenderBundle.h Separate the types for compute and render pass usage data 2021-05-05 19:55:23 +00:00
RenderBundleEncoder.cpp Separate the types for compute and render pass usage data 2021-05-05 19:55:23 +00:00
RenderBundleEncoder.h Separate the types for compute and render pass usage data 2021-05-05 19:55:23 +00:00
RenderEncoderBase.cpp Add SetIndex/VertexBuffer offset argument alignment constraints 2021-06-17 17:48:45 +00:00
RenderEncoderBase.h Remove deprecated API surface, Pt. 1 2021-05-13 17:51:23 +00:00
RenderPassEncoder.cpp Separate the types for compute and render pass usage data 2021-05-05 19:55:23 +00:00
RenderPassEncoder.h Separate the types for compute and render pass usage data 2021-05-05 19:55:23 +00:00
RenderPipeline.cpp Triage Dawn TODOs 2021-06-04 22:23:56 +00:00
RenderPipeline.h Removed deprecated CreateRenderPipeline path 2021-05-21 05:01:38 +00:00
ResourceHeap.h Autoformat everything except tests/examples 2020-07-10 18:19:38 +00:00
ResourceHeapAllocator.h Add another missing #include. 2019-10-30 00:19:43 +00:00
ResourceMemoryAllocation.cpp Autoformat everything except tests/examples 2020-07-10 18:19:38 +00:00
ResourceMemoryAllocation.h Residency 2: Create a d3d12::Heap During Direct Allocations 2020-03-09 15:53:19 +00:00
RingBufferAllocator.cpp Triage Dawn TODOs 2021-06-07 18:23:52 +00:00
RingBufferAllocator.h Use typed integers for the ExecutionSerial 2020-09-28 19:35:14 +00:00
Sampler.cpp Only allow CompareFunction::Undefined for samplerDesc.compare 2021-04-08 18:42:47 +00:00
Sampler.h Add maxAnisotropy to GPUSamplerDescriptor 2020-12-24 03:11:17 +00:00
ShaderModule.cpp Refer TODO to Dawn issue 944 2021-06-18 16:46:40 +00:00
ShaderModule.h Emit tint warning when creating shader module 2021-06-18 13:29:39 +00:00
SpirvUtils.cpp Update BindingInfo to reflect new BindGroupLayoutEntry structure 2020-12-21 20:14:26 +00:00
SpirvUtils.h Update BindingInfo to reflect new BindGroupLayoutEntry structure 2020-12-21 20:14:26 +00:00
StagingBuffer.cpp Autoformat everything except tests/examples 2020-07-10 18:19:38 +00:00
StagingBuffer.h Autoformat everything except tests/examples 2020-07-10 18:19:38 +00:00
Subresource.cpp Triage Dawn TODOs 2021-06-04 22:23:56 +00:00
Subresource.h Add GPUExternalTexture Types 2021-04-01 20:46:42 +00:00
SubresourceStorage.h Triage Dawn TODOs 2021-06-04 22:23:56 +00:00
Surface.cpp Add support for windows SwapChainPanel in SwapChain and Surface 2021-06-09 08:44:07 +00:00
Surface.h Add support for windows SwapChainPanel in SwapChain and Surface 2021-06-09 08:44:07 +00:00
Surface_metal.mm Introduce wgpu::Surface and implement it for HWND, X11 and Metal 2020-01-15 13:14:12 +00:00
SwapChain.cpp Triage Dawn TODOs 2021-06-04 22:23:56 +00:00
SwapChain.h Remove useless function declarations 2021-06-03 07:42:15 +00:00
Texture.cpp Triage Dawn TODOs 2021-06-04 22:23:56 +00:00
Texture.h Triage Dawn TODOs 2021-06-07 18:23:52 +00:00
TintUtils.cpp Allow Dawn to surface Tint internal compiler errors as uncaptured validation errors 2021-03-25 15:37:44 +00:00
TintUtils.h Allow Dawn to surface Tint internal compiler errors as uncaptured validation errors 2021-03-25 15:37:44 +00:00
ToBackend.h dawn_native: Use refcount-safe methods for reentrant object creation 2021-04-19 08:52:35 +00:00
Toggles.cpp Dump translated HLSL shaders if the toggle enabled 2021-06-08 10:03:44 +00:00
Toggles.h Dump translated HLSL shaders if the toggle enabled 2021-06-08 10:03:44 +00:00
XlibXcbFunctions.cpp Reland "Vulkan: Fallback to XCB for Xlib surfaces" 2021-02-11 08:26:38 +00:00
XlibXcbFunctions.h Reland "Vulkan: Fallback to XCB for Xlib surfaces" 2021-02-11 08:26:38 +00:00
dawn_platform.h Implement internal storage for buffer usage and buffer binding type 2021-06-16 14:33:27 +00:00