Fixed compilation issues when using libstdc++
Bug:dawn:229 Change-Id: I18ce6330bc4597db4f2c4548698b38ab2c826203 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11620 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
6ac5a9250d
commit
09cc2b92c7
|
@ -117,20 +117,18 @@ namespace dawn_native {
|
|||
private:
|
||||
// Vulkan backend use uint32_t as dynamic offsets type, it is not correct.
|
||||
// Vulkan should use VkDeviceSize. Dawn vulkan backend has to handle this.
|
||||
template <typename T>
|
||||
static void SetDynamicOffsets(T* data,
|
||||
static void SetDynamicOffsets(uint32_t* data,
|
||||
uint32_t dynamicOffsetCount,
|
||||
uint64_t* dynamicOffsets) {
|
||||
for (uint32_t i = 0; i < dynamicOffsetCount; ++i) {
|
||||
ASSERT(dynamicOffsets[i] <= std::numeric_limits<T>::max());
|
||||
data[i] = static_cast<T>(dynamicOffsets[i]);
|
||||
ASSERT(dynamicOffsets[i] <= std::numeric_limits<uint32_t>::max());
|
||||
data[i] = static_cast<uint32_t>(dynamicOffsets[i]);
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
static void SetDynamicOffsets<uint64_t>(uint64_t* data,
|
||||
uint32_t dynamicOffsetCount,
|
||||
uint64_t* dynamicOffsets) {
|
||||
static void SetDynamicOffsets(uint64_t* data,
|
||||
uint32_t dynamicOffsetCount,
|
||||
uint64_t* dynamicOffsets) {
|
||||
memcpy(data, dynamicOffsets, sizeof(uint64_t) * dynamicOffsetCount);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
#define DAWNNATIVE_BUDDYALLOCATOR_H_
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <vector>
|
||||
|
||||
namespace dawn_native {
|
||||
|
@ -108,4 +110,4 @@ namespace dawn_native {
|
|||
|
||||
} // namespace dawn_native
|
||||
|
||||
#endif // DAWNNATIVE_BUDDYALLOCATOR_H_
|
||||
#endif // DAWNNATIVE_BUDDYALLOCATOR_H_
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
#include "dawn_native/Device.h"
|
||||
#include "dawn_native/ErrorScope.h"
|
||||
|
||||
#include <limits>
|
||||
|
||||
namespace dawn_native {
|
||||
|
||||
ErrorScopeTracker::ErrorScopeTracker(DeviceBase* device) : mDevice(device) {
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
#include "dawn_wire/client/Client.h"
|
||||
#include "dawn_wire/client/Device.h"
|
||||
|
||||
#include <limits>
|
||||
|
||||
namespace dawn_wire { namespace client {
|
||||
|
||||
bool Client::DoDeviceUncapturedErrorCallback(DawnErrorType errorType, const char* message) {
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
#include "dawn_wire/WireClient.h"
|
||||
#include "dawn_wire/client/Client.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
namespace dawn_wire { namespace client {
|
||||
|
||||
class InlineMemoryTransferService : public MemoryTransferService {
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
#include "dawn_wire/WireServer.h"
|
||||
#include "dawn_wire/server/Server.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
namespace dawn_wire { namespace server {
|
||||
|
||||
class InlineMemoryTransferService : public MemoryTransferService {
|
||||
|
|
Loading…
Reference in New Issue