diff options
author | Reiko Asakura | 2020-11-01 20:03:06 -0500 |
---|---|---|
committer | Reiko Asakura | 2020-11-01 20:03:06 -0500 |
commit | 2423728ac1fbe2a77d21fd3276efc902987250e2 (patch) | |
tree | 3e0fcd3bbbab0d2d39c39cc83b50316804eb4960 /include | |
parent | SceDisplay: use real names for iUpdateTimingMode (diff) | |
download | vds-libraries-2423728ac1fbe2a77d21fd3276efc902987250e2.tar.gz |
Changes to SceShaccCg headers
1. Added some comments about overall usage.
2. Removed non-existent functions
3. Use standard types instead of SCE types. In particular, SceChar8 is
signed char which is not the same type as char, even though they are
both signed 8 bit numbers.
Diffstat (limited to 'include')
-rw-r--r-- | include/user/shacccg.h | 183 | ||||
-rw-r--r-- | include/user/shacccg/paramquery.h | 42 | ||||
-rw-r--r-- | include/user/shacccg/types.h | 143 |
3 files changed, 141 insertions, 227 deletions
diff --git a/include/user/shacccg.h b/include/user/shacccg.h index 14ce8b8..cf5a088 100644 --- a/include/user/shacccg.h +++ b/include/user/shacccg.h @@ -1,9 +1,42 @@ #ifndef _DOLCESDK_PSP2_SHACCCG_H_ #define _DOLCESDK_PSP2_SHACCCG_H_ -#include "psp2/shacccg/types.h" -#include "psp2/shacccg/paramquery.h" -#include "psp2common/types.h" +#include <psp2/shacccg/types.h> +#include <psp2/shacccg/paramquery.h> + +/** @file shacccg.h + + The PRX version of psp2cgc allows applications to compile shaders without + having to compile them at build time. Users must use a set of callbacks for + file handling. + The compiler may be invoked by the following function: + + sceShaccCgCompileProgram + Performs a full compile, returning a sceShaccCgCompileOutput object + containing the binary. + + There is a corresponding destroy function, sceShaccCgDestroyCompileOutput. + This function must be called in order to free the resources associated + with a job. + Creation and destruction do not have to be performed on the same thread. + + This function depends chiefly on two inputs: + + sceShaccCgCompileOptions + This structure is the equivalent of the command-line options for the + standalone compiler. It may also be used as a compilation ID by + extending the struct and passing the appropriate pointer to SceShaccCg. + This pointer will be provided on all callbacks. + + sceShaccCgCallbackList + Provides the compiler with an interface to the file system - whether + it is interface provided by the operating system or a virtualized one. + For details regarding the individual callbacks, please refer to the + documentation of sceShaccCgCallbackList. + Please note that if a callback list is provided, it should always be + initialized via sceShaccCgInitializeCallbackList. + Please noted that where indicated, the callbacks argument is required. +*/ #ifdef __cplusplus extern "C" { @@ -13,17 +46,6 @@ extern "C" { // Typedefs /////////////////////////////////////////////////////////////////////////////// -/** @brief Describes the output of dependency generation. - - @ingroup shacccg -*/ -typedef struct SceShaccCgDependencyOutput { - SceInt32 dependencyTargetCount; ///< The number of dependencies. - const SceChar8* const *dependencyTargets; ///< The individual target rules. - SceInt32 diagnosticCount; ///< The number of diagnostics. - const SceShaccCgDiagnosticMessage *diagnostics; ///< The diagnostic message array. -} SceShaccCgDependencyOutput; - /** @brief Describes the output of a compilation process. On failure, programData will be 0 and the diagnosticCount will be non-zero. @@ -33,27 +55,12 @@ typedef struct SceShaccCgDependencyOutput { @ingroup shacccg */ typedef struct SceShaccCgCompileOutput { - const SceUInt8 *programData; ///< The compiled program binary data. - SceInt32 programSize; ///< The compiled program size. - SceInt32 diagnosticCount; ///< The number of diagnostics. + const uint8_t *programData; ///< The compiled program binary data. + uint32_t programSize; ///< The compiled program size. + int32_t diagnosticCount; ///< The number of diagnostics. const SceShaccCgDiagnosticMessage *diagnostics; ///< The diagnostic message array. } SceShaccCgCompileOutput; -/** @brief Describes the output of a preprocessor process. - - On failure, program will be 0 and the diagnosticCount will be non-zero. - On success, program will be non-zero and one or more non-error - diagnostics may be present. - - @ingroup shacccg -*/ -typedef struct SceShaccCgPreprocessOutput { - const SceChar8 *program; ///< The preprocessor output. - SceInt32 programSize; ///< The preprocessor output size. - SceInt32 diagnosticCount; ///< The number of diagnostics. - const SceShaccCgDiagnosticMessage *diagnostics; ///< The diagnostic message array. -} SceShaccCgPreprocessOutput; - /////////////////////////////////////////////////////////////////////////////// // Functions /////////////////////////////////////////////////////////////////////////////// @@ -63,7 +70,7 @@ typedef struct SceShaccCgPreprocessOutput { Compiles a program for PSP2 using the options provided. @param[in] options - Indicates the compile options for compiling a program. + Indicates the compile options for compiling a program. Also doubles as a session id where multiple compiles are being run. @param[in] callbacks @@ -73,7 +80,7 @@ typedef struct SceShaccCgPreprocessOutput { @param[in] userData Opaque pointer to user data that will be passed back to callbacks. - @return + @return A SceShaccCgCompileOutput object, containing the binary and sdb outputs of the compile. Must be destroyed using sceShaccCgDestroyCompileOutput. If 0 is returned, the input arguments were @@ -84,7 +91,7 @@ typedef struct SceShaccCgPreprocessOutput { SceShaccCgCompileOutput const* sceShaccCgCompileProgram( const SceShaccCgCompileOptions *options, const SceShaccCgCallbackList *callbacks, - ScePVoid userData); + void *userData); /** @brief Releases all allocations associated with a compiled program. @@ -93,118 +100,24 @@ SceShaccCgCompileOutput const* sceShaccCgCompileProgram( @ingroup shacccg */ -SceVoid sceShaccCgDestroyCompileOutput( +void sceShaccCgDestroyCompileOutput( SceShaccCgCompileOutput const *output); -/** @brief Preprocesses a Cg program for PSP2 - - Compiles a program for PSP2 using the options provided. Callbacks may be - provided, but are optional. (see note on struct SceShaccCgCallbackList) - - @param options - Indicates the compile options for preprocessing a program. - Also doubles as a session id where multiple compiles are being run. - - @param callbacks - Defines the callbacks to be used for file system access. If not provided, - the default PSP2 file system will be used (optional). - - @param userData - Opaque pointer to user data that will be passed back to callbacks. - - @param emitLineDirectives - Indicates whether to emit #line directives in the output. - - @param emitComments - Indicates whether to retain comments in the output. - - @return - A SceShaccCgPreprocessOutput object, containing the UTF-8 encoded - text of the preprocessed program. Must be destroyed using - sceShaccCgDestroyPreprocessOutput. If 0 is returned the input arguments were - malformed. - - @ingroup shacccg -*/ -SceShaccCgPreprocessOutput const* sceShaccCgPreprocessProgram( - const SceShaccCgCompileOptions *options, - const SceShaccCgCallbackList *callbacks, - ScePVoid userData, - SceInt32 emitLineDirectives, - SceInt32 emitComments); - -/** @brief Releases all allocations associated with a compiled program. - - @param[in] output - The result from a call to sceShaccCgPreprocessProgram, to be destroyed. - - @ingroup shacccg -*/ -SceVoid sceShaccCgDestroyPreprocessOutput( - SceShaccCgPreprocessOutput const *output); - -/** @brief Generates dependency information for a program. - - Generates dependency information for the given compilation options. - - @param[in] options - Indicates the compile options for generating the file dependencies for a - program. Also doubles as a session id where multiple compiles are being run. - - @param[in] callbacks - Defines the callbacks to be used for file system access. If not provided, - the default PSP2 file system will be used (optional). - - @param userData - Opaque pointer to user data that will be passed back to callbacks. - - @param[in] targetName - The name of the main target rule. Because we have no concept of the final - binary name at this point, this must always be provided. - - @param[in] emitPhonies - Non-zero indicates that phony dependencies should be generated. - - @return - A SceShaccCgDependencyOutput object, containing a list of file names and - their dependent files. Should be destroyed using - sceShaccCgDestroyDependencyOutput. If 0 is returned, the input arguments - were malformed. - - @ingroup shacccg -*/ -SceShaccCgDependencyOutput const* sceShaccCgGenerateDependencies( - const SceShaccCgCompileOptions *options, - const SceShaccCgCallbackList *callbacks, - ScePVoid userData, - const SceChar8 *targetName, - SceInt32 emitPhonies); - -/** @brief Releases all allocations associated with the dependency output. - - @param[in] output - The result from a call to sceShaccCgGenerateDependencies, to be destroyed. - - @ingroup shacccg -*/ -SceVoid sceShaccCgDestroyDependencyOutput( - SceShaccCgDependencyOutput const *output); - /** @brief Sets memory allocation callbacks Sets memory allocation callbacks for SceShaccCg library - @param[in] memAlloc + @param[in] allocate Function used for memory allocation. - @param[in] memFree + @param[in] deallocate Function used to free memory. @ingroup shacccg */ -SceInt32 sceShaccCgSetMemAllocator( - SceShaccCgMemAllocator memAlloc, - SceShaccCgMemFree memFree); +int32_t sceShaccCgSetMemAllocator( + SceShaccCgAllocator allocate, + SceShaccCgDeallocator deallocate); #ifdef __cplusplus } diff --git a/include/user/shacccg/paramquery.h b/include/user/shacccg/paramquery.h index 3969330..7e17990 100644 --- a/include/user/shacccg/paramquery.h +++ b/include/user/shacccg/paramquery.h @@ -1,7 +1,7 @@ #ifndef _DOLCESDK_PSP2_SHACCCG_PARAMQUERY_H_ #define _DOLCESDK_PSP2_SHACCCG_PARAMQUERY_H_ -#include "psp2common/types.h" +#include <stdint.h> #ifdef __cplusplus extern "C" { @@ -57,7 +57,7 @@ typedef enum SceShaccCgParameterBaseType { SCE_SHACCCG_BASETYPE_SAMPLERCUBE = 0x11, ///< Cube sampler SCE_SHACCCG_BASETYPE_ISAMPLERCUBE = 0x12, ///< Cube signed integer sampler SCE_SHACCCG_BASETYPE_USAMPLERCUBE = 0x13, ///< Cube unsigned integer sampler - SCE_SHACCCG_BASETYPE_ARRAY = 0x17, ///< An array + SCE_SHACCCG_BASETYPE_ARRAY = 0x17, ///< An array SCE_SHACCCG_BASETYPE_STRUCT = 0x18, ///< A structure SCE_SHACCCG_BASETYPE_UNIFORMBLOCK = 0x19 ///< A uniform block } SceShaccCgParameterBaseType; @@ -134,7 +134,7 @@ SceShaccCgParameter sceShaccCgGetFirstParameter( no more parameters. @ingroup shacccg -*/ +*/ SceShaccCgParameter sceShaccCgGetNextParameter( SceShaccCgParameter param); @@ -155,8 +155,8 @@ SceShaccCgParameter sceShaccCgGetNextParameter( @ingroup shacccg */ SceShaccCgParameter sceShaccCgGetParameterByName( - SceShaccCgCompileOutput const* prog, - SceChar8 const *name); + SceShaccCgCompileOutput const* prog, + char const *name); /** @brief Returns the name of a parameter. @@ -170,7 +170,7 @@ SceShaccCgParameter sceShaccCgGetParameterByName( @ingroup shacccg */ -const SceChar8 *sceShaccCgGetParameterName( +const char * sceShaccCgGetParameterName( SceShaccCgParameter param); /** @brief Returns the semantic of a parameter. @@ -186,7 +186,7 @@ const SceChar8 *sceShaccCgGetParameterName( @ingroup shacccg */ -const SceChar8 *sceShaccCgGetParameterSemantic( +const char * sceShaccCgGetParameterSemantic( SceShaccCgParameter param); /** @brief Returns the user declared type of a parameter. @@ -202,7 +202,7 @@ const SceChar8 *sceShaccCgGetParameterSemantic( @ingroup shacccg */ -const SceChar8 *sceShaccCgGetParameterUserType( +const char * sceShaccCgGetParameterUserType( SceShaccCgParameter param); /** @brief Returns the parameter class. @@ -277,7 +277,7 @@ SceShaccCgParameterBaseType sceShaccCgGetParameterBaseType( @ingroup shacccg */ -SceInt32 sceShaccCgIsParameterReferenced( +int32_t sceShaccCgIsParameterReferenced( SceShaccCgParameter param); /** @brief Returns the hw resource index of the parameter. @@ -292,7 +292,7 @@ SceInt32 sceShaccCgIsParameterReferenced( @ingroup shacccg */ -SceUInt32 sceShaccCgGetParameterResourceIndex( +uint32_t sceShaccCgGetParameterResourceIndex( SceShaccCgParameter param); /** @brief Returns the buffer index of the parameter. @@ -307,7 +307,7 @@ SceUInt32 sceShaccCgGetParameterResourceIndex( @ingroup shacccg */ -SceUInt32 sceShaccCgGetParameterBufferIndex( +uint32_t sceShaccCgGetParameterBufferIndex( SceShaccCgParameter param); /** @brief Returns true if the parameter is __regformat. @@ -322,7 +322,7 @@ SceUInt32 sceShaccCgGetParameterBufferIndex( @ingroup shacccg */ -SceInt32 sceShaccCgIsParameterRegFormat( +int32_t sceShaccCgIsParameterRegFormat( SceShaccCgParameter param); /** @brief Returns the first member for a struct parameter. @@ -369,7 +369,7 @@ SceShaccCgParameter sceShaccCgGetFirstUniformBlockParameter( @ingroup shacccg */ -SceUInt32 sceShaccCgGetArraySize( +uint32_t sceShaccCgGetArraySize( SceShaccCgParameter param); /** @brief Returns the parameter for an array element. @@ -388,7 +388,7 @@ SceUInt32 sceShaccCgGetArraySize( @ingroup shacccg */ SceShaccCgParameter sceShaccCgGetArrayParameter( - SceShaccCgParameter aparam, + SceShaccCgParameter aparam, uint32_t index); /** @brief Returns the vector width for a vector parameter. @@ -403,7 +403,7 @@ SceShaccCgParameter sceShaccCgGetArrayParameter( @ingroup shacccg */ -SceUInt32 sceShaccCgGetParameterVectorWidth( +uint32_t sceShaccCgGetParameterVectorWidth( SceShaccCgParameter param); /** @brief Returns the number of columns for a matrix parameter. @@ -418,7 +418,7 @@ SceUInt32 sceShaccCgGetParameterVectorWidth( @ingroup shacccg */ -SceUInt32 sceShaccCgGetParameterColumns( +uint32_t sceShaccCgGetParameterColumns( SceShaccCgParameter param); /** @brief Returns the number of rows for a matrix parameter. @@ -433,7 +433,7 @@ SceUInt32 sceShaccCgGetParameterColumns( @ingroup shacccg */ -SceUInt32 sceShaccCgGetParameterRows( +uint32_t sceShaccCgGetParameterRows( SceShaccCgParameter param); /** @brief Returns the memory layout for a matrix parameter. @@ -467,7 +467,7 @@ SceShaccCgParameterMemoryLayout sceShaccCgGetParameterMemoryLayout( @ingroup shacccg */ SceShaccCgParameter sceShaccCgGetRowParameter( - SceShaccCgParameter param, + SceShaccCgParameter param, uint32_t index); /** @brief Returns the query format component count for a sampler parameter. @@ -482,7 +482,7 @@ SceShaccCgParameter sceShaccCgGetRowParameter( @ingroup shacccg */ -SceUInt32 sceShaccCgGetSamplerQueryFormatWidth( +uint32_t sceShaccCgGetSamplerQueryFormatWidth( SceShaccCgParameter param); /** @brief Returns the number of different precisions used to as query format for sampler parameter. @@ -497,7 +497,7 @@ SceUInt32 sceShaccCgGetSamplerQueryFormatWidth( @ingroup shacccg */ -SceUInt32 sceShaccCgGetSamplerQueryFormatPrecisionCount( +uint32_t sceShaccCgGetSamplerQueryFormatPrecisionCount( SceShaccCgParameter param); /** @brief Returns query precision format for a sampler parameter. @@ -517,7 +517,7 @@ SceUInt32 sceShaccCgGetSamplerQueryFormatPrecisionCount( */ SceShaccCgParameterBaseType sceShaccCgGetSamplerQueryFormatPrecision( SceShaccCgParameter param, - SceUInt32 index); + uint32_t index); #ifdef __cplusplus diff --git a/include/user/shacccg/types.h b/include/user/shacccg/types.h index 81465d3..a16be79 100644 --- a/include/user/shacccg/types.h +++ b/include/user/shacccg/types.h @@ -1,7 +1,8 @@ #ifndef _DOLCESDK_PSP2_SHACCCG_TYPES_H_ #define _DOLCESDK_PSP2_SHACCCG_TYPES_H_ -#include "psp2common/types.h" +#include <stddef.h> +#include <stdint.h> #ifdef __cplusplus extern "C" { @@ -31,14 +32,14 @@ typedef struct SceShaccCgSourceLocation SceShaccCgSourceLocation; calling SceShaccCgCallbackReleaseFile when the returned SceShaccCgSourceFile is no longer required. - @param[in] fileName + @param[in] fileName The absolute path of the file to be opened. @param[in] includedFrom The include location. Set to 0 for a primary file. @param[in] compileOptions - The original options pointer used to invoke this compile. + The original options pointer used to invoke this compile. @param[in] userData Opaque pointer to user data. @@ -54,11 +55,11 @@ typedef struct SceShaccCgSourceLocation SceShaccCgSourceLocation; @ingroup shacccg */ typedef SceShaccCgSourceFile* (*SceShaccCgCallbackOpenFile)( - const SceChar8 *fileName, + const char *fileName, const SceShaccCgSourceLocation *includedFrom, const SceShaccCgCompileOptions *compileOptions, - ScePVoid userData, - const SceChar8 **errorString); + void *userData, + const char **errorString); /** @brief A callback used when the compiler needs to release file data. @@ -81,10 +82,10 @@ typedef SceShaccCgSourceFile* (*SceShaccCgCallbackOpenFile)( typedef void (*SceShaccCgCallbackReleaseFile)( const SceShaccCgSourceFile *file, const SceShaccCgCompileOptions *compileOptions, - ScePVoid userData); + void *userData); /** @brief A callback used to search for a named file. - + This function will search in all provided paths for the named file. If the file could not be located, 0 is returned and errorString will have been updated to a representative message, explaining why the file could not be @@ -92,7 +93,7 @@ typedef void (*SceShaccCgCallbackReleaseFile)( On success, a non-zero string is returned. The caller takes ownership and will release the allocation via the SceShaccCgCallbackReleaseFileName callback. - + @param[in] fileName The name of the file to be located. @@ -122,26 +123,26 @@ typedef void (*SceShaccCgCallbackReleaseFile)( @ingroup shacccg */ typedef const char* (*SceShaccCgCallbackLocateFile)( - const SceChar8 *fileName, + const char *fileName, const SceShaccCgSourceLocation *includedFrom, - SceUInt32 searchPathCount, - const SceChar8 *const*searchPaths, + uint32_t searchPathCount, + const char *const*searchPaths, const SceShaccCgCompileOptions *compileOptions, - ScePVoid userData, - const SceChar8 **errorString); - + void *userData, + const char **errorString); + /** @brief A callback used to retrieve the absolute path name for a given file. Files are uniquely identified by absolute paths. If two include files lead to the same absolute path, the previously found file is used and no call to SceShaccCgCallbackOpenFile will be made. This function allows for a translation from a relative path scheme to an absolute path scheme. - + If there is no valid absolute path for the given file, 0 should be returned. If a non-zero string is returned, the caller takes ownership and will release the allocation via the SceShaccCgCallbackReleaseFileName callback. This string will be the name passed to SceShaccCgCallbackOpenFile. - + @param[in] fileName The (possibly relative) file path for an include file, as provided by SceShaccCgCallbackLocateFile. @@ -161,10 +162,10 @@ typedef const char* (*SceShaccCgCallbackLocateFile)( @ingroup shacccg */ typedef const char* (*SceShaccCgCallbackAbsolutePath)( - const SceChar8 *fileName, + const char *fileName, const SceShaccCgSourceLocation *includedFrom, const SceShaccCgCompileOptions *compileOptions, - ScePVoid userData); + void *userData); /** @brief A callback for the compiler to release a file name. @@ -184,12 +185,12 @@ typedef const char* (*SceShaccCgCallbackAbsolutePath)( @ingroup shacccg */ typedef void (*SceShaccCgCallbackReleaseFileName)( - const SceChar8 *fileName, + const char *fileName, const SceShaccCgCompileOptions *compileOptions, - ScePVoid userData); + void *userData); /** @brief Provides date information for the named file. - + If the date attributes could not be read, 0 is returned and the results will be considered invalid. On success, timeLastStatusChange and timeLastModified will have been @@ -219,13 +220,13 @@ typedef void (*SceShaccCgCallbackReleaseFileName)( @ingroup shacccg */ -typedef SceInt32 (*SceShaccCgCallbackFileDate)( +typedef int32_t (*SceShaccCgCallbackFileDate)( const SceShaccCgSourceFile *file, const SceShaccCgSourceLocation *includedFrom, const SceShaccCgCompileOptions *compileOptions, - ScePVoid userData, - SceInt64 *timeLastStatusChange, ///< using time_t - SceInt64 *timeLastModified); ///< using time_t + void *userData, + int64_t *timeLastStatusChange, ///< using time_t + int64_t *timeLastModified); ///< using time_t /** @brief A callback used when the compiler needs to allocate memory. @@ -236,20 +237,20 @@ typedef SceInt32 (*SceShaccCgCallbackFileDate)( @ingroup shacccg */ -typedef ScePVoid (*SceShaccCgMemAllocator)( - SceSize memSize); +typedef void *(*SceShaccCgAllocator)( + size_t memSize); /** @brief A callback used when the compiler needs to free memory. This function is used to free memory. @param[in] memPtr - Pointer to a memory block previously allocated with SceShaccCgMemAllocator + Pointer to a memory block previously allocated with SceShaccCgAllocator @ingroup shacccg */ -typedef SceVoid (*SceShaccCgMemFree)( - ScePVoid ptr); +typedef void (*SceShaccCgDeallocator)( + void *memPtr); /////////////////////////////////////////////////////////////////////////////// // Constants @@ -305,9 +306,9 @@ typedef enum SceShaccCgLocale { @ingroup shacccg */ typedef struct SceShaccCgSourceFile { - const SceChar8 *fileName; ///< The relative or absolute name of the file. - const SceChar8 *text; ///< The contents of the source file. - SceUInt32 size; ///< The size of the 'text' array in bytes. + const char *fileName; ///< The relative or absolute name of the file. + const char *text; ///< The contents of the source file. + uint32_t size; ///< The size of the 'text' array in bytes. } SceShaccCgSourceFile; @@ -317,8 +318,8 @@ typedef struct SceShaccCgSourceFile { */ typedef struct SceShaccCgSourceLocation { const SceShaccCgSourceFile *file; ///< The file containing the location. - SceUInt32 lineNumber; ///< The line number of the location. - SceUInt32 columnNumber; ///< The column number of the location. + uint32_t lineNumber; ///< The line number of the location. + uint32_t columnNumber; ///< The column number of the location. } SceShaccCgSourceLocation; /** @brief Describes the input data for a compilation job. @@ -326,36 +327,36 @@ typedef struct SceShaccCgSourceLocation { @ingroup shacccg */ typedef struct SceShaccCgCompileOptions { - const SceChar8 *mainSourceFile; ///< The main Cg source file to compile. 0 - SceShaccCgTargetProfile targetProfile; ///< The target profile. 4 - const SceChar8 *entryFunctionName; ///< The name of the entry function. Usually "main". 8 - SceUInt32 searchPathCount; ///< The number of search paths for include files. c - const SceChar8* const *searchPaths; ///< The search paths for include files. 10 - SceUInt32 macroDefinitionCount; ///< The number of macro definitions provided. 14 - const SceChar8* const *macroDefinitions; ///< The macro definitions in the form: MACRONAME or MACRONAME=VALUE 18 - SceUInt32 includeFileCount; ///< The number of files to force include. 1c - const SceChar8* const *includeFiles; ///< The files to include before the main source file. 20 - SceUInt32 suppressedWarningsCount; ///< The number of warnings to suppressed. 24 - const SceUInt32 *suppressedWarnings; ///< The id numbers of the warnings to be suppressed. 28 - - SceShaccCgLocale locale; ///< The language to use in diagnostics. 2c - - SceInt32 useFx; ///< Equivalent to -fx if non-zero, -nofx otherwise. 30 - SceInt32 noStdlib; ///< Equivalent to -nostdlib if non-zero. 34 - - SceInt32 optimizationLevel; ///< Equivalent to -O?. Valid range is 0-4. 38 - SceInt32 useFastmath; ///< Equivalent to -fastmath if non-zero. 3c - SceInt32 useFastprecision; ///< Equivalent to -fastprecision if non-zero. 40 - SceInt32 useFastint; ///< Equivalent to -fastint if non-zero. 44 - SceInt32 positionInvariant; ///< Equivalent to -invpos if non-zero. 48 - - SceInt32 warningsAsErrors; ///< Equivalent to -Werror if non-zero. 4c - SceInt32 performanceWarnings; ///< Equivalent to -Wperf if non-zero. 50 - SceInt32 warningLevel; ///< Equivalent to -W?. Valid range is 0-4. 54 - SceInt32 pedantic; ///< Equivalent to -pedantic if non-zero. 58 - SceInt32 pedanticError; ///< Equivalent to -pedantic-error if non-zero. 5c - SceInt32 xmlCache; ///< Equivalent to -xmlcache if non-zero. 60 - SceInt32 stripSymbols; ///< When set to non zero compilation will produce a stripped gxp file 64 + const char *mainSourceFile; ///< The main Cg source file to compile. + SceShaccCgTargetProfile targetProfile; ///< The target profile. + const char *entryFunctionName; ///< The name of the entry function. Usually "main". + uint32_t searchPathCount; ///< The number of search paths for include files. + const char* const *searchPaths; ///< The search paths for include files. + uint32_t macroDefinitionCount; ///< The number of macro definitions provided. + const char* const *macroDefinitions; ///< The macro definitions in the form: MACRONAME or MACRONAME=VALUE + uint32_t includeFileCount; ///< The number of files to force include. + const char* const *includeFiles; ///< The files to include before the main source file. + uint32_t suppressedWarningsCount; ///< The number of warnings to suppressed. + const uint32_t *suppressedWarnings; ///< The id numbers of the warnings to be suppressed. + + SceShaccCgLocale locale; ///< The language to use in diagnostics. + + int32_t useFx; ///< Equivalent to -fx if non-zero, -nofx otherwise. + int32_t noStdlib; ///< Equivalent to -nostdlib if non-zero. + + int32_t optimizationLevel; ///< Equivalent to -O?. Valid range is 0-4. + int32_t useFastmath; ///< Equivalent to -fastmath if non-zero. + int32_t useFastprecision; ///< Equivalent to -fastprecision if non-zero. + int32_t useFastint; ///< Equivalent to -fastint if non-zero. + int32_t positionInvariant; ///< Equivalent to -invpos if non-zero. + + int32_t warningsAsErrors; ///< Equivalent to -Werror if non-zero. + int32_t performanceWarnings; ///< Equivalent to -Wperf if non-zero. + int32_t warningLevel; ///< Equivalent to -W?. Valid range is 0-4. + int32_t pedantic; ///< Equivalent to -pedantic if non-zero. + int32_t pedanticError; ///< Equivalent to -pedantic-error if non-zero. + int32_t xmlCache; ///< Equivalent to -xmlcache if non-zero. + int32_t stripSymbols; ///< When set to non zero compilation will produce a stripped gxp file } SceCgcCompileOptions; /** @brief Lists the user defined callbacks for compiler operations. @@ -386,9 +387,9 @@ typedef struct SceShaccCgCallbackList { */ typedef struct SceShaccCgDiagnosticMessage { SceShaccCgDiagnosticLevel level; ///< The severity of the diagnostic. - SceUInt32 code; ///< A unique code for each kind of diagnostic. + uint32_t code; ///< A unique code for each kind of diagnostic. const SceShaccCgSourceLocation *location; ///< The location for which the diagnostic is reported (optional). - const SceChar8 *message; ///< The diagnostic message. + const char *message; ///< The diagnostic message. } SceShaccCgDiagnosticMessage; @@ -409,14 +410,14 @@ typedef struct SceShaccCgDiagnosticMessage { @ingroup shacccg */ -SceVoid sceShaccCgInitializeCompileOptions( +void sceShaccCgInitializeCompileOptions( SceShaccCgCompileOptions *options); /** @brief Initializes the callback list with the default values. There are two kinds of defaults available: - SCE_SHACCCG_SYSTEM_FILES uses the native file system of the operating - system in the same manner as the command-line version of shacccg. + system in the same manner as the command-line version of psp2cgc. This is the default behavior if no callback structure is provided for a compilation/pre-processing/dependency job. - SCE_SHACCCG_TRIVIAL provides placeholder implementations of all callbacks @@ -437,7 +438,7 @@ SceVoid sceShaccCgInitializeCompileOptions( @ingroup shacccg */ -SceVoid sceShaccCgInitializeCallbackList( +void sceShaccCgInitializeCallbackList( SceShaccCgCallbackList *callbacks, SceShaccCgCallbackDefaults defaults); |