//3DS platform in Pascal // // Copyright (c) 2013, 2015, 2017 Kenneth Dwayne Lee Bsc. // all rights reserved // // type DVLE_type = Longint; Const VERTEX_SHDR = GPU_VERTEX_SHADER; GEOMETRY_SHDR = GPU_GEOMETRY_SHADER; type DVLE_constantType = Longint; Const DVLE_CONST_BOOL = $0; DVLE_CONST_u8 = $1; DVLE_CONST_FLOAT24 = $2; type DVLE_outputAttribute_t = Longint; Const RESULT_POSITION = $0; RESULT_NORMALQUAT = $1; RESULT_COLOR = $2; RESULT_TEXCOORD0 = $3; RESULT_TEXCOORD0W = $4; RESULT_TEXCOORD1 = $5; RESULT_TEXCOORD2 = $6; RESULT_VIEW = $8; RESULT_DUMMY = $9; type DVLE_geoShaderMode = Longint; Const GSH_POINT = 0; GSH_VARIABLE_PRIM = 1; GSH_FIXED_PRIM = 2; type DVLP_s = record codeSize : u32; codeData : ^u32; opdescSize : u32; opcdescData : ^u32; end; DVLE_constEntry_s = record _type : u16; id : u16; data : array[0..3] of u32; end; DVLE_outEntry_s = record _type : u16; regID : u16; mask : u8; unk : array[0..2] of u8; end; DVLE_uniformEntry_s = record symbolOffset : u32; startReg : u16; endReg : u16; end; DVLE_s = record _type : DVLE_type; mergeOutmaps : bool; gshMode : DVLE_geoShaderMode; gshFixedVtxStart : u8; gshVariableVtxNum : u8; gshFixedVtxNum : u8; dvlp : ^DVLP_s; mainOffset : u32; endmainOffset : u32; constTableSize : u32; constTableData : ^DVLE_constEntry_s; outTableSize : u32; outTableData : ^DVLE_outEntry_s; uniformTableSize : u32; uniformTableData : ^DVLE_uniformEntry_s; symbolTableData : ^cchar; outmapMask : u8; outmapData : array[0..7] of u32; outmapMode : u32; outmapClock : u32; end; PDVLE_s = ^DVLE_s; DVLB_s = record numDVLE : u32; DVLP : DVLP_s; DVLE : ^DVLE_s; end; PDVLB_s = ^DVLB_s; {* * @brief Parses a shader binary. * @param shbinData Shader binary data. * @param shbinSize Shader binary size. * @return The parsed shader binary. } function DVLB_ParseFile(shbinData:Pu32; shbinSize:u32):PDVLB_s;cdecl;external; {* * @brief Frees shader binary data. * @param dvlb DVLB to free. } procedure DVLB_Free(dvlb:PDVLB_s);cdecl;external; {* * @brief Gets a uniform register index from a shader. * @param dvle Shader to get the register from. * @param name Name of the register. * @return The uniform register index. } function DVLE_GetUniformRegister(dvle:PDVLE_s; name:pchar):s8;cdecl;external; {* * @brief Generates a shader output map. * @param dvle Shader to generate an output map for. } procedure DVLE_GenerateOutmap(dvle:PDVLE_s);cdecl;external;