mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-08 07:33:33 +00:00
Member rename: src/backend/null
This commit is contained in:
parent
fbecc28ac4
commit
903c563b43
@ -104,10 +104,10 @@ namespace null {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Device::AddPendingOperation(std::unique_ptr<PendingOperation> operation) {
|
void Device::AddPendingOperation(std::unique_ptr<PendingOperation> operation) {
|
||||||
pendingOperations.emplace_back(std::move(operation));
|
mPendingOperations.emplace_back(std::move(operation));
|
||||||
}
|
}
|
||||||
std::vector<std::unique_ptr<PendingOperation>> Device::AcquirePendingOperations() {
|
std::vector<std::unique_ptr<PendingOperation>> Device::AcquirePendingOperations() {
|
||||||
return std::move(pendingOperations);
|
return std::move(mPendingOperations);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Buffer
|
// Buffer
|
||||||
@ -125,7 +125,7 @@ namespace null {
|
|||||||
Buffer::Buffer(BufferBuilder* builder)
|
Buffer::Buffer(BufferBuilder* builder)
|
||||||
: BufferBase(builder) {
|
: BufferBase(builder) {
|
||||||
if (GetAllowedUsage() & (nxt::BufferUsageBit::TransferDst | nxt::BufferUsageBit::MapRead | nxt::BufferUsageBit::MapWrite)) {
|
if (GetAllowedUsage() & (nxt::BufferUsageBit::TransferDst | nxt::BufferUsageBit::MapRead | nxt::BufferUsageBit::MapWrite)) {
|
||||||
backingData = std::unique_ptr<char[]>(new char[GetSize()]);
|
mBackingData = std::unique_ptr<char[]>(new char[GetSize()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,17 +138,17 @@ namespace null {
|
|||||||
|
|
||||||
void Buffer::SetSubDataImpl(uint32_t start, uint32_t count, const uint32_t* data) {
|
void Buffer::SetSubDataImpl(uint32_t start, uint32_t count, const uint32_t* data) {
|
||||||
ASSERT(start + count <= GetSize());
|
ASSERT(start + count <= GetSize());
|
||||||
ASSERT(backingData);
|
ASSERT(mBackingData);
|
||||||
memcpy(backingData.get() + start, data, count);
|
memcpy(mBackingData.get() + start, data, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Buffer::MapReadAsyncImpl(uint32_t serial, uint32_t start, uint32_t count) {
|
void Buffer::MapReadAsyncImpl(uint32_t serial, uint32_t start, uint32_t count) {
|
||||||
ASSERT(start + count <= GetSize());
|
ASSERT(start + count <= GetSize());
|
||||||
ASSERT(backingData);
|
ASSERT(mBackingData);
|
||||||
|
|
||||||
auto operation = new BufferMapReadOperation;
|
auto operation = new BufferMapReadOperation;
|
||||||
operation->buffer = this;
|
operation->buffer = this;
|
||||||
operation->ptr = backingData.get() + start;
|
operation->ptr = mBackingData.get() + start;
|
||||||
operation->serial = serial;
|
operation->serial = serial;
|
||||||
|
|
||||||
ToBackend(GetDevice())->AddPendingOperation(std::unique_ptr<PendingOperation>(operation));
|
ToBackend(GetDevice())->AddPendingOperation(std::unique_ptr<PendingOperation>(operation));
|
||||||
@ -163,31 +163,31 @@ namespace null {
|
|||||||
// CommandBuffer
|
// CommandBuffer
|
||||||
|
|
||||||
CommandBuffer::CommandBuffer(CommandBufferBuilder* builder)
|
CommandBuffer::CommandBuffer(CommandBufferBuilder* builder)
|
||||||
: CommandBufferBase(builder), commands(builder->AcquireCommands()) {
|
: CommandBufferBase(builder), mCommands(builder->AcquireCommands()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
CommandBuffer::~CommandBuffer() {
|
CommandBuffer::~CommandBuffer() {
|
||||||
FreeCommands(&commands);
|
FreeCommands(&mCommands);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandBuffer::Execute() {
|
void CommandBuffer::Execute() {
|
||||||
Command type;
|
Command type;
|
||||||
while (commands.NextCommandId(&type)) {
|
while (mCommands.NextCommandId(&type)) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Command::TransitionBufferUsage:
|
case Command::TransitionBufferUsage:
|
||||||
{
|
{
|
||||||
TransitionBufferUsageCmd* cmd = commands.NextCommand<TransitionBufferUsageCmd>();
|
TransitionBufferUsageCmd* cmd = mCommands.NextCommand<TransitionBufferUsageCmd>();
|
||||||
cmd->buffer->UpdateUsageInternal(cmd->usage);
|
cmd->buffer->UpdateUsageInternal(cmd->usage);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Command::TransitionTextureUsage:
|
case Command::TransitionTextureUsage:
|
||||||
{
|
{
|
||||||
TransitionTextureUsageCmd* cmd = commands.NextCommand<TransitionTextureUsageCmd>();
|
TransitionTextureUsageCmd* cmd = mCommands.NextCommand<TransitionTextureUsageCmd>();
|
||||||
cmd->texture->UpdateUsageInternal(cmd->usage);
|
cmd->texture->UpdateUsageInternal(cmd->usage);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SkipCommand(&commands, type);
|
SkipCommand(&mCommands, type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ namespace null {
|
|||||||
std::vector<std::unique_ptr<PendingOperation>> AcquirePendingOperations();
|
std::vector<std::unique_ptr<PendingOperation>> AcquirePendingOperations();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<std::unique_ptr<PendingOperation>> pendingOperations;
|
std::vector<std::unique_ptr<PendingOperation>> mPendingOperations;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Buffer : public BufferBase {
|
class Buffer : public BufferBase {
|
||||||
@ -141,7 +141,7 @@ namespace null {
|
|||||||
void UnmapImpl() override;
|
void UnmapImpl() override;
|
||||||
void TransitionUsageImpl(nxt::BufferUsageBit currentUsage, nxt::BufferUsageBit targetUsage) override;
|
void TransitionUsageImpl(nxt::BufferUsageBit currentUsage, nxt::BufferUsageBit targetUsage) override;
|
||||||
|
|
||||||
std::unique_ptr<char[]> backingData;
|
std::unique_ptr<char[]> mBackingData;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CommandBuffer : public CommandBufferBase {
|
class CommandBuffer : public CommandBufferBase {
|
||||||
@ -152,7 +152,7 @@ namespace null {
|
|||||||
void Execute();
|
void Execute();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CommandIterator commands;
|
CommandIterator mCommands;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Queue : public QueueBase {
|
class Queue : public QueueBase {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user