blob: 8d852282ac8050f2c73b770ecf4278f294cb4654 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup gpu
*
* Mimics old style opengl immediate mode drawing.
*/
#pragma once
#include "MEM_guardedalloc.h"
#include "gpu_immediate_private.hh"
#include <Cocoa/Cocoa.h>
#include <Metal/Metal.h>
#include <QuartzCore/QuartzCore.h>
namespace blender::gpu {
class MTLImmediate : public Immediate {
private:
MTLContext *context_ = nullptr;
MTLTemporaryBuffer current_allocation_;
MTLPrimitiveTopologyClass metal_primitive_mode_;
MTLPrimitiveType metal_primitive_type_;
bool has_begun_ = false;
public:
MTLImmediate(MTLContext *ctx);
~MTLImmediate();
uchar *begin() override;
void end() override;
bool imm_is_recording()
{
return has_begun_;
}
};
} // namespace blender::gpu
|