diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-03-20 14:29:03 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-03-21 15:51:35 +0300 |
commit | e7d106c5fce668e00e57fe6a20c9651e3fbaf7eb (patch) | |
tree | c675304cd8abea76210d8604c656ff573f482cb4 /source/blender/gpu/intern/gpu_codegen.h | |
parent | be3eef19c0b5d253375c332fcf107c46c3ad53ec (diff) |
GPUCodegen: New implementation
This implementation is a rewrite in C++. It makes it more flexible for
the target engine to create specialized shaders with different input
and output mechanism (VBOs, SSBOs, Texture loads/writes ...).
This commit tries to make it work with the current eevee codebase.
Diffstat (limited to 'source/blender/gpu/intern/gpu_codegen.h')
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.h | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/source/blender/gpu/intern/gpu_codegen.h b/source/blender/gpu/intern/gpu_codegen.h index 0e99476d3ea..95a672c0400 100644 --- a/source/blender/gpu/intern/gpu_codegen.h +++ b/source/blender/gpu/intern/gpu_codegen.h @@ -9,36 +9,24 @@ #pragma once +#include "GPU_material.h" +#include "GPU_shader.h" + #ifdef __cplusplus extern "C" { #endif -struct GPUMaterial; struct GPUNodeGraph; -struct GPUShader; - -typedef struct GPUPass { - struct GPUPass *next; - struct GPUShader *shader; - char *fragmentcode; - char *geometrycode; - char *vertexcode; - char *defines; - uint refcount; /* Orphaned GPUPasses gets freed by the garbage collector. */ - uint32_t hash; /* Identity hash generated from all GLSL code. */ - bool compiled; /* Did we already tried to compile the attached GPUShader. */ -} GPUPass; +typedef struct GPUPass GPUPass; /* Pass */ -GPUPass *GPU_generate_pass(struct GPUMaterial *material, +GPUPass *GPU_generate_pass(GPUMaterial *material, struct GPUNodeGraph *graph, - const char *vert_code, - const char *geom_code, - const char *frag_lib, - const char *defines); -struct GPUShader *GPU_pass_shader_get(GPUPass *pass); + GPUCodegenCallbackFn finalize_source_cb, + void *thunk); +GPUShader *GPU_pass_shader_get(GPUPass *pass); bool GPU_pass_compile(GPUPass *pass, const char *shname); void GPU_pass_release(GPUPass *pass); |