|
|
|
|
50
|
cb->Commit();
|
50
|
cb->Commit();
|
51
|
|
51
|
|
52
|
DKLog("Texture created!");
|
52
|
DKLog("Texture created!");
|
|
|
53
|
+ return tex;
|
53
|
}
|
54
|
}
|
54
|
}
|
55
|
}
|
55
|
return nullptr;
|
56
|
return nullptr;
|
|
|
|
|
101
|
|
102
|
|
102
|
DKObject<DKGpuBuffer> vertexBuffer = device->CreateBuffer(vertexBufferSize, DKGpuBuffer::StorageModeShared, DKCpuCacheModeReadWrite);
|
103
|
DKObject<DKGpuBuffer> vertexBuffer = device->CreateBuffer(vertexBufferSize, DKGpuBuffer::StorageModeShared, DKCpuCacheModeReadWrite);
|
103
|
memcpy(vertexBuffer->Contents(), vertexData, vertexBufferSize);
|
104
|
memcpy(vertexBuffer->Contents(), vertexData, vertexBufferSize);
|
|
|
105
|
+ vertexBuffer->Flush();
|
104
|
|
106
|
|
105
|
DKObject<DKGpuBuffer> indexBuffer = device->CreateBuffer(indexBufferSize, DKGpuBuffer::StorageModeShared, DKCpuCacheModeReadWrite);
|
107
|
DKObject<DKGpuBuffer> indexBuffer = device->CreateBuffer(indexBufferSize, DKGpuBuffer::StorageModeShared, DKCpuCacheModeReadWrite);
|
106
|
memcpy(indexBuffer->Contents(), indexData, indexBufferSize);
|
108
|
memcpy(indexBuffer->Contents(), indexData, indexBufferSize);
|
|
|
109
|
+ indexBuffer->Flush();
|
107
|
|
110
|
|
108
|
DKRenderPipelineDescriptor pipelineDescriptor;
|
111
|
DKRenderPipelineDescriptor pipelineDescriptor;
|
109
|
pipelineDescriptor.vertexFunction = vertShaderFunction;
|
112
|
pipelineDescriptor.vertexFunction = vertShaderFunction;
|
|
|
|
|
163
|
|
166
|
|
164
|
memcpy(uboBuffer->Contents(), &ubo, sizeof(ubo));
|
167
|
memcpy(uboBuffer->Contents(), &ubo, sizeof(ubo));
|
165
|
bindSet->SetBuffer(0, uboBuffer, 0, sizeof(ubo));
|
168
|
bindSet->SetBuffer(0, uboBuffer, 0, sizeof(ubo));
|
|
|
169
|
+ uboBuffer->Flush();
|
166
|
}
|
170
|
}
|
167
|
}
|
171
|
}
|
168
|
|
172
|
|