mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 13:38:00 +00:00
Rename nxtProcTable and nxtSetProcs to dawn
This commit is contained in:
committed by
Corentin Wallez
parent
b1669e3fa4
commit
be5ca38351
@@ -14,11 +14,11 @@
|
||||
|
||||
#include "dawn/dawn.h"
|
||||
|
||||
static nxtProcTable procs;
|
||||
static dawnProcTable procs;
|
||||
|
||||
static nxtProcTable nullProcs;
|
||||
static dawnProcTable nullProcs;
|
||||
|
||||
void nxtSetProcs(const nxtProcTable* procs_) {
|
||||
void dawnSetProcs(const dawnProcTable* procs_) {
|
||||
if (procs_) {
|
||||
procs = *procs_;
|
||||
} else {
|
||||
|
||||
@@ -68,7 +68,7 @@ extern "C" {
|
||||
|
||||
{% endfor %}
|
||||
|
||||
struct nxtProcTable_s {
|
||||
struct dawnProcTable_s {
|
||||
{% for type in by_category["object"] %}
|
||||
{% for method in native_methods(type) %}
|
||||
{{as_cProc(type.name, method.name)}} {{as_varName(type.name, method.name)}};
|
||||
@@ -76,12 +76,12 @@ struct nxtProcTable_s {
|
||||
|
||||
{% endfor %}
|
||||
};
|
||||
typedef struct nxtProcTable_s nxtProcTable;
|
||||
typedef struct dawnProcTable_s dawnProcTable;
|
||||
|
||||
// Stuff below is for convenience and will forward calls to a static nxtProcTable.
|
||||
// Stuff below is for convenience and will forward calls to a static dawnProcTable.
|
||||
|
||||
// Set which nxtProcTable will be used
|
||||
void nxtSetProcs(const nxtProcTable* procs);
|
||||
// Set which dawnProcTable will be used
|
||||
void dawnSetProcs(const dawnProcTable* procs);
|
||||
|
||||
{% for type in by_category["object"] %}
|
||||
// Methods of {{type.name.CamelCase()}}
|
||||
|
||||
@@ -183,8 +183,8 @@ namespace {{namespace}} {
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
nxtProcTable GetNonValidatingProcs() {
|
||||
nxtProcTable table;
|
||||
dawnProcTable GetNonValidatingProcs() {
|
||||
dawnProcTable table;
|
||||
{% for type in by_category["object"] %}
|
||||
{% for method in native_methods(type) %}
|
||||
table.{{as_varName(type.name, method.name)}} = reinterpret_cast<{{as_cProc(type.name, method.name)}}>(NonValidating{{as_MethodSuffix(type.name, method.name)}});
|
||||
@@ -193,8 +193,8 @@ namespace {{namespace}} {
|
||||
return table;
|
||||
}
|
||||
|
||||
nxtProcTable GetValidatingProcs() {
|
||||
nxtProcTable table;
|
||||
dawnProcTable GetValidatingProcs() {
|
||||
dawnProcTable table;
|
||||
{% for type in by_category["object"] %}
|
||||
{% for method in native_methods(type) %}
|
||||
table.{{as_varName(type.name, method.name)}} = reinterpret_cast<{{as_cProc(type.name, method.name)}}>(Validating{{as_MethodSuffix(type.name, method.name)}});
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace {
|
||||
ProcTableAsClass::~ProcTableAsClass() {
|
||||
}
|
||||
|
||||
void ProcTableAsClass::GetProcTableAndDevice(nxtProcTable* table, dawnDevice* device) {
|
||||
void ProcTableAsClass::GetProcTableAndDevice(dawnProcTable* table, dawnDevice* device) {
|
||||
*device = GetNewDevice();
|
||||
|
||||
{% for type in by_category["object"] %}
|
||||
|
||||
@@ -27,7 +27,7 @@ class ProcTableAsClass {
|
||||
public:
|
||||
virtual ~ProcTableAsClass();
|
||||
|
||||
void GetProcTableAndDevice(nxtProcTable* table, dawnDevice* device);
|
||||
void GetProcTableAndDevice(dawnProcTable* table, dawnDevice* device);
|
||||
|
||||
// Creates an object that can be returned by a mocked call as in WillOnce(Return(foo)).
|
||||
// It returns an object of the write type that isn't equal to any previously returned object.
|
||||
|
||||
@@ -416,8 +416,8 @@ namespace dawn { namespace wire {
|
||||
// the autogenerated one, and that will have to call Client{{suffix}}
|
||||
{% set proxied_commands = ["BufferUnmap"] %}
|
||||
|
||||
nxtProcTable GetProcs() {
|
||||
nxtProcTable table;
|
||||
dawnProcTable GetProcs() {
|
||||
dawnProcTable table;
|
||||
{% for type in by_category["object"] %}
|
||||
{% for method in native_methods(type) %}
|
||||
{% set suffix = as_MethodSuffix(type.name, method.name) %}
|
||||
@@ -664,7 +664,7 @@ namespace dawn { namespace wire {
|
||||
|
||||
}
|
||||
|
||||
CommandHandler* NewClientDevice(nxtProcTable* procs, dawnDevice* device, CommandSerializer* serializer) {
|
||||
CommandHandler* NewClientDevice(dawnProcTable* procs, dawnDevice* device, CommandSerializer* serializer) {
|
||||
auto clientDevice = new client::Device(serializer);
|
||||
|
||||
*device = reinterpret_cast<dawnDeviceImpl*>(clientDevice);
|
||||
|
||||
@@ -205,7 +205,7 @@ namespace dawn { namespace wire {
|
||||
|
||||
class Server : public CommandHandler, public ObjectIdResolver {
|
||||
public:
|
||||
Server(dawnDevice device, const nxtProcTable& procs, CommandSerializer* serializer)
|
||||
Server(dawnDevice device, const dawnProcTable& procs, CommandSerializer* serializer)
|
||||
: mProcs(procs), mSerializer(serializer) {
|
||||
//* The client-server knowledge is bootstrapped with device 1.
|
||||
auto* deviceData = mKnownDevice.Allocate(1);
|
||||
@@ -346,7 +346,7 @@ namespace dawn { namespace wire {
|
||||
}
|
||||
|
||||
private:
|
||||
nxtProcTable mProcs;
|
||||
dawnProcTable mProcs;
|
||||
CommandSerializer* mSerializer = nullptr;
|
||||
|
||||
ServerAllocator mAllocator;
|
||||
@@ -622,7 +622,7 @@ namespace dawn { namespace wire {
|
||||
}
|
||||
}
|
||||
|
||||
CommandHandler* NewServerCommandHandler(dawnDevice device, const nxtProcTable& procs, CommandSerializer* serializer) {
|
||||
CommandHandler* NewServerCommandHandler(dawnDevice device, const dawnProcTable& procs, CommandSerializer* serializer) {
|
||||
return new server::Server(device, procs, serializer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user