Title: [220145] trunk/Source/WebCore
- Revision
- 220145
- Author
- [email protected]
- Date
- 2017-08-02 11:24:19 -0700 (Wed, 02 Aug 2017)
Log Message
GPUBuffer::length() should return the size of the array buffer backing the GPU buffer, not the rounded-up GPU buffer length
https://bugs.webkit.org/show_bug.cgi?id=175079
Reviewed by Simon Fraser.
This fixes a failure in the GPU.BufferCreate unit test.
The problem is that in order to have a Metal buffer wrap memory we allocated, we have to tell Metal
that the memory is page-aligned. This means that the Metal buffer reports back a page-aligned size,
which is different than what the test expected.
It seems that it's most convenient for our GPUBuffer class to return the unaligned length, rather
than the aligned length. This is just a simple matter of returning the length from the ArrayBuffer
rather than the Metal buffer.
This fixes the unit test and is probably more sensible for actual users of this class, since the page
alignment of the length is a goofy implementation detail.
* platform/graphics/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::length const):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (220144 => 220145)
--- trunk/Source/WebCore/ChangeLog 2017-08-02 18:15:14 UTC (rev 220144)
+++ trunk/Source/WebCore/ChangeLog 2017-08-02 18:24:19 UTC (rev 220145)
@@ -1,3 +1,26 @@
+2017-08-02 Filip Pizlo <[email protected]>
+
+ GPUBuffer::length() should return the size of the array buffer backing the GPU buffer, not the rounded-up GPU buffer length
+ https://bugs.webkit.org/show_bug.cgi?id=175079
+
+ Reviewed by Simon Fraser.
+
+ This fixes a failure in the GPU.BufferCreate unit test.
+
+ The problem is that in order to have a Metal buffer wrap memory we allocated, we have to tell Metal
+ that the memory is page-aligned. This means that the Metal buffer reports back a page-aligned size,
+ which is different than what the test expected.
+
+ It seems that it's most convenient for our GPUBuffer class to return the unaligned length, rather
+ than the aligned length. This is just a simple matter of returning the length from the ArrayBuffer
+ rather than the Metal buffer.
+
+ This fixes the unit test and is probably more sensible for actual users of this class, since the page
+ alignment of the length is a goofy implementation detail.
+
+ * platform/graphics/cocoa/GPUBufferMetal.mm:
+ (WebCore::GPUBuffer::length const):
+
2017-08-01 Brian Burg <[email protected]>
HTML file input elements do not support file extensions in the "accept" attribute
Modified: trunk/Source/WebCore/platform/graphics/cocoa/GPUBufferMetal.mm (220144 => 220145)
--- trunk/Source/WebCore/platform/graphics/cocoa/GPUBufferMetal.mm 2017-08-02 18:15:14 UTC (rev 220144)
+++ trunk/Source/WebCore/platform/graphics/cocoa/GPUBufferMetal.mm 2017-08-02 18:24:19 UTC (rev 220145)
@@ -64,7 +64,7 @@
if (!m_buffer)
return 0;
- return [m_buffer length];
+ return m_contents->byteLength();
}
RefPtr<ArrayBuffer> GPUBuffer::contents()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes