You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
* All standard buffers now implement IComputeBuffer directly, and do not need to have ToSharedInstance() called to create a ref-counted version. * Workers can now construct a socket directly, allowing multiple buffers to be attached. * Control messages are sent whenever a receive buffer is attached, allowing the remote to wait for it to be available. #preflight none [CL 25169238 by Ben Marsh in ue5-main branch]
28 lines
692 B
C++
28 lines
692 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "SharedMemoryBuffer.h"
|
|
#include "ComputeSocket.h"
|
|
|
|
class FComputeChannel
|
|
{
|
|
public:
|
|
static const int DefaultWorkerChannelId = 100;
|
|
|
|
FComputeChannel();
|
|
~FComputeChannel();
|
|
|
|
bool Open(FComputeSocket& Socket, int ChannelId);
|
|
bool Open(FComputeSocket& Socket, int ChannelId, int NumChunks, int ChunkSize);
|
|
bool Open(FComputeSocket& Socket, int ChannelId, int NumSendChunks, int SendChunkSize, int NumRecvChunks, int RecvChunkSize);
|
|
void Close();
|
|
|
|
void Send(const void* Data, size_t Length);
|
|
size_t Receive(void* Data, size_t Length);
|
|
|
|
private:
|
|
FSharedMemoryBuffer RecvBuffer;
|
|
FSharedMemoryBuffer SendBuffer;
|
|
};
|