MTLContext provides functionality for command encoding, binding management and graphics device management. MTLImmediate provides simple draw enablement with dynamically encoded data. These draws utilise temporary scratch buffer memory to provide minimal bandwidth overhead during workload submission.
This patch also contains empty placeholders for MTLBatch and MTLDrawList to enable testing of first pixels on-screen without failure.
The Metal API also requires access to the GHOST_Context to ensure the same pre-initialized Metal GPU device is used by the viewport. Given the explicit nature of Metal, explicit control is also needed over presentation, to ensure correct work scheduling and rendering pipeline state.
Authored by Apple: Michael Parkin-White
Ref T96261
(The diff is based on 043f59cb3b)
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D15953
43 lines
925 B
C++
43 lines
925 B
C++
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
* Copyright 2005 Blender Foundation. All rights reserved. */
|
|
|
|
/** \file
|
|
* \ingroup gpu
|
|
*
|
|
* Generate shader code from the intermediate node graph.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "GPU_material.h"
|
|
#include "GPU_shader.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
struct GPUNodeGraph;
|
|
|
|
typedef struct GPUPass GPUPass;
|
|
|
|
/* Pass */
|
|
|
|
GPUPass *GPU_generate_pass(GPUMaterial *material,
|
|
struct GPUNodeGraph *graph,
|
|
GPUCodegenCallbackFn finalize_source_cb,
|
|
void *thunk,
|
|
bool optimize_graph);
|
|
GPUShader *GPU_pass_shader_get(GPUPass *pass);
|
|
bool GPU_pass_compile(GPUPass *pass, const char *shname);
|
|
void GPU_pass_release(GPUPass *pass);
|
|
bool GPU_pass_should_optimize(GPUPass *pass);
|
|
|
|
/* Module */
|
|
|
|
void gpu_codegen_init(void);
|
|
void gpu_codegen_exit(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|