Skip to content

Commit

Permalink
Add shark_get_internal_compile_output function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinnegatamante committed Apr 1, 2023
1 parent d25a7b8 commit 5d99fe8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/vitashark.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "vitashark.h"
#include <stdlib.h>
#include <psp2/kernel/modulemgr.h>
#include <psp2/shacccg.h>

// Settings
//#define DISABLE_SHACCCG_EXTENSIONS // Uncomment this to make vitaShaRK not depend on SceShaccCgExt
Expand Down Expand Up @@ -142,3 +141,7 @@ SceGxmProgram *shark_compile_shader_extended(const char *src, uint32_t *size, sh
SceGxmProgram *shark_compile_shader(const char *src, uint32_t *size, shark_type type) {
return shark_compile_shader_extended(src, size, type, SHARK_OPT_DEFAULT, SHARK_DISABLE, SHARK_DISABLE, SHARK_DISABLE);
}

const SceShaccCgCompileOutput *shark_get_internal_compile_output() {
return shark_output;
}
2 changes: 2 additions & 0 deletions source/vitashark.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
extern "C" {
#endif

#include <psp2/shacccg.h>
#include <psp2/gxm.h>

typedef enum shark_opt {
Expand Down Expand Up @@ -64,6 +65,7 @@ void shark_set_allocators(void *(*malloc_func)(size_t size), void (*free_func)(v
SceGxmProgram *shark_compile_shader_extended(const char *src, uint32_t *size, shark_type type, shark_opt opt, int32_t use_fastmath, int32_t use_fastprecision, int32_t use_fastint); //!< Compiles a shader with extended settings
SceGxmProgram *shark_compile_shader(const char *src, uint32_t *size, shark_type type); //!< Compiles a shader
void shark_clear_output(); //!< Clears output of a compilation attempt
const SceShaccCgCompileOutput *shark_get_internal_compile_output(); //!< Returns the internal SceShaccCgCompileOutput struct from latest compilation attempt

// Logging routines
void shark_install_log_cb(void (*cb)(const char *msg, shark_log_level msg_level, int line)); //!< Installs a log function for info, warnings and errors
Expand Down

0 comments on commit 5d99fe8

Please sign in to comment.