40#ifndef CORE_GVKUSERSHADER_H
41#define CORE_GVKUSERSHADER_H
54using gVKUserShaderId = uint32_t;
55inline constexpr gVKUserShaderId GVK_NO_USER_SHADER = 0;
64enum gvkBuiltinShader {
73gVKUserShaderId gvkCreateUserShader(gVKContext& ctx,
const std::string& vertexSource,
74 const std::string& fragmentSource,
const std::string& vertexPath,
75 const std::string& fragmentPath,
int builtin = GVK_BUILTIN_NONE);
79void gvkDestroyUserShader(gVKContext& ctx, gVKUserShaderId
id);
80void gvkDestroyAllUserShaders(gVKContext& ctx);
84bool gvkRebuildUserShaders(gVKContext& ctx);
88void gvkUseUserShader(gVKUserShaderId
id);
89gVKUserShaderId gvkBoundUserShader();
99bool gvkSetUserShaderValue(gVKUserShaderId
id,
const std::string& name,
const void* data,
100 gVKMemberComponent component, uint32_t rows, uint32_t columns);
104bool gvkSetUserShaderTexture(gVKUserShaderId
id,
const std::string& name,
int unit);
107bool gvkUserShaderHasUniform(gVKUserShaderId
id,
const std::string& name);
111using gVKUserShaderTextureResolver = gVKTexture* (*)(
int unit);
112void gvkSetUserShaderTextureResolver(gVKUserShaderTextureResolver resolver);
122bool gvkBindUserShaderForDraw(gVKContext& ctx, VkCommandBuffer cmd,
bool blending,
bool lines);
127uint32_t gvkBoundUserShaderVertexStride();
128bool gvkBoundUserShaderUsesMeshLayout();