12 #ifndef RV_VKShaderCompile_h
13 #define RV_VKShaderCompile_h
25 struct RV_SpvProgramCompileImpl;
26 struct RV_SpvStageCompileImpl;
98 friend RV_SpvProgramCompileImpl;
127 friend RV_SpvStageCompileImpl;
163 return myProgram->getSpvModules(modules_out, messages_out);
196 return myProgram->isValid();
209 int vertex_index)
override
214 int buffer_num)
override
221 const char *relative_to)
override
230 int array_size=1,
int *saved_idx =
nullptr)
override
234 int array_size=1,
int *saved_idx =
nullptr)
override
238 int array_size=1,
int *saved_idx =
nullptr)
override
242 int array_size=1,
int *saved_idx =
nullptr)
override
246 int array_size = 1,
int *saved_idx =
nullptr)
override
250 int array_size=1,
int *saved_idx =
nullptr)
override
254 int array_size=1,
int *saved_idx =
nullptr)
override
258 int array_size=1,
int *saved_idx =
nullptr)
override
262 int array_size=1,
int *saved_idx =
nullptr)
override
266 int array_size=1,
int *saved_idx =
nullptr)
override
270 int array_size=1,
int *saved_idx =
nullptr)
override
274 int array_size=1,
int *saved_idx =
nullptr)
override
278 int array_size=1,
int *saved_idx =
nullptr)
override
283 int array_size=1,
int *saved_idx =
nullptr)
override
287 int array_size=1,
int *saved_idx =
nullptr)
override
291 int array_size=1,
int *saved_idx =
nullptr)
override
295 int array_size=1,
int *saved_idx =
nullptr)
override
299 int array_size=1,
int *saved_idx =
nullptr)
override
303 int array_size=1,
int *saved_idx =
nullptr)
override
308 int *saved_idx =
nullptr)
override
322 std::ostream *os =
nullptr)
const override
338 void createInternalProgram();
359 const char *source_code,
362 bool dump_source_on_error =
true)
override;
379 return myStageCompiler->isValid();
void loadShaderTexMaps(RE_Render *r) override
Loads texture maps specified by the RE_TextureMap bindTextureMap()
void printUniforms(RE_Render *r, std::ostream *os=nullptr) const override
Prints all the active uniforms plus their values to stream os (or cerr)
virtual UT_UniquePtr< RE_Shader > compileImpl(RE_Render *r, UT_String *errors) const
virtual void clearShaders(RE_Render *r, RE_ShaderType types=RE_SHADER_ALL)
Clears and deletes all the shader objects of a certain type (or all)
bool bindVariable2(RE_Render *r, const UT_StringHolder &name, const fpreal64 *val, int array_size=1, int *saved_idx=nullptr) override
Generic Integer scalar.
UT_SharedPtr< RE_ShaderHandle > RE_ShaderHandlePtr
bool bindMatrix3(RE_Render *r, const UT_StringHolder &name, const fpreal64 *val, int array_size=1, int *saved_idx=nullptr) override
Generic Integer scalar.
int64 getMemoryUsage(bool inclusive) const override
bool bindImage(RE_Render *r, const UT_StringHolder &name, RE_Texture *image, RE_BufferAccess image_access) override
bool bindMatrix4(RE_Render *r, const UT_StringHolder &name, const fpreal32 *val, int array_size=1, int *saved_idx=nullptr) override
Generic Integer scalar.
virtual bool linkShaders(RE_Render *r, UT_String *messages=nullptr)
bool bindVariableInt3(RE_Render *r, const UT_StringHolder &name, const int *val, int array_size=1, int *saved_idx=nullptr) override
Generic Integer vector-3.
bool bindMatrix3(RE_Render *r, const UT_StringHolder &name, const fpreal32 *val, int array_size=1, int *saved_idx=nullptr) override
Generic Integer scalar.
RV_ShaderAtlas(const UT_StringRef &shader_atlas_file)
GLenum GLenum GLsizei void * image
~RV_ShaderAtlas() override
RV_API bool RVisDefaultAttrib(const RV_ShaderInput &input)
unsigned long long uint64
bool bindVariable3(RE_Render *r, const UT_StringHolder &name, const fpreal32 *val, int array_size=1, int *saved_idx=nullptr) override
Generic Integer scalar.
bool setSource(RE_Render *r, const char *source_code, int version, UT_String *messages=nullptr, bool dump_source_on_error=true) override
virtual bool detachShader(RE_Render *r, RE_ShaderStage *obj)
GLenum GLuint GLint GLint layer
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
bool bindVariable4(RE_Render *r, const UT_StringHolder &name, const fpreal32 *val, int array_size=1, int *saved_idx=nullptr) override
Generic Integer scalar.
RE_TextureDimension getTextureMapType(RE_Render *r, const UT_StringHolder &name) override
Return the texture type for the sampler named 'name'.
bool validateShader(RE_Render *r, UT_String *messages=nullptr) override
bool bindTextureMap(RE_Render *r, const UT_StringHolder &name, const char *mapname, const char *relative_to) override
virtual RE_ShaderStage * newShader(RE_ShaderType type, const char *name=0)=0
RV_ShaderHandle(const char *program_file, bool reg_sh, const char *defines)
virtual RE_ShaderHandlePtr createShaderImpl(const char *program, const char *defines)
bool bindVariable3(RE_Render *r, const UT_StringHolder &name, const fpreal64 *val, int array_size=1, int *saved_idx=nullptr) override
Generic Integer scalar.
bool getSpvModules(UT_Map< RE_ShaderType, UT_Array< uint8_t >> &modules_out, UT_WorkBuffer &messages_out)
bool bindVariableInt2(RE_Render *r, const UT_StringHolder &name, const int *val, int array_size=1, int *saved_idx=nullptr) override
Generic Integer vector-2.
GLsizei GLsizei GLchar * source
bool bindUint64(RE_Render *r, const UT_StringHolder &name, uint64 *val, int array_size=1, int *saved_idx=nullptr) override
64b Integer handle for bindless texturing
bool bindMatrix4(RE_Render *r, const UT_StringHolder &name, const fpreal64 *val, int array_size=1, int *saved_idx=nullptr) override
Generic Integer scalar.
bool bindVariable1(RE_Render *r, const UT_StringHolder &name, const fpreal64 *val, int array_size=1, int *saved_idx=nullptr) override
Generic Integer scalar.
bool getSource(RE_Render *r, UT_String &source) override
bool bindVariableInt(RE_Render *r, const UT_StringHolder &name, const int *val, int array_size=1, int *saved_idx=nullptr) override
Generic Integer scalar.
GLuint const GLchar * name
bool bindVariableInt4(RE_Render *r, const UT_StringHolder &name, const int *val, int array_size=1, int *saved_idx=nullptr) override
Generic Integer vector-4.
bool bindMatrix2(RE_Render *r, const UT_StringHolder &name, const fpreal32 *val, int array_size=1, int *saved_idx=nullptr) override
Generic Integer scalar.
bool setVertexInput(RE_Render *r, const char *name, int vertex_index) override
bool bindVariable2(RE_Render *r, const UT_StringHolder &name, const fpreal32 *val, int array_size=1, int *saved_idx=nullptr) override
Generic Integer scalar.
bool setGeometryParms(RE_Render *r, int max_vertices, RE_PrimType input, RE_PrimType output) override
Specify geometry shader parameters.
GT_API const UT_StringHolder version
bool bindMatrix2(RE_Render *r, const UT_StringHolder &name, const fpreal64 *val, int array_size=1, int *saved_idx=nullptr) override
Generic Integer scalar.
RV_VKShaderStage(RE_ShaderType stage, const char *name=nullptr)
~RV_VKShaderStage() override
bool bindTexture(RE_Render *r, const UT_StringHolder &name, RE_Texture *tex, int *saved_idx=nullptr) override
RV_API int RVgetDefaultAttribLocation(const UT_StringRef &)
void loadBoundTextures(RE_Render *r) override
bool bindVariable4(RE_Render *r, const UT_StringHolder &name, const fpreal64 *val, int array_size=1, int *saved_idx=nullptr) override
Generic Integer scalar.
bool bindImageLayer(RE_Render *r, const UT_StringHolder &name, RE_Texture *image, RE_BufferAccess image_access, int layer) override
bool bindVariable1(RE_Render *r, const UT_StringHolder &name, const fpreal32 *val, int array_size=1, int *saved_idx=nullptr) override
Generic Integer scalar.
void unloadBoundTextures(RE_Render *r) override
RE_Shader * newShader(const char *name, int shader_version, RE_ShaderLanguage lang) override
virtual bool attachShader(RE_Render *r, RE_ShaderStage *obj, UT_String *messages=nullptr)
void cleanup(RE_Render *r) override
void removeShader(RE_Render *r, bool update_re=true) override
~RV_ShaderHandle() override
GLbitfield GLuint program
RV_API bool RVgetDefaultAttribFormat(int loc, RV_GPUType *out_type, int *out_vec_size)
SYS_FORCE_INLINE bool isstring() const
virtual re_LibFunc * getShaderLibrary() const
bool setFragmentOutput(RE_Render *r, const char *name, int buffer_num) override
void applyShader(RE_Render *r, bool update_re=true) override
Simple interface to building a shader from a .prog file.