bknd-3ds: implement libpicasso to load shader
This commit is contained in:
@@ -23,11 +23,8 @@ SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <pd-3ds/bknd-gfx.hpp>
|
||||
#include <pica.hpp>
|
||||
|
||||
/// @brief Shader Code (Unused as i dont want to use libpicasso here (yet))
|
||||
/// Update: Picasso breaks the linearRam or ram for somereason
|
||||
/// as far as i found out loading anything into linear ram after
|
||||
/// using libpicasso to compile a shader leads into a system freeze
|
||||
const char* LIShaderCTR = R"(
|
||||
; LI7 Shader
|
||||
; Constants
|
||||
@@ -65,13 +62,6 @@ const char* LIShaderCTR = R"(
|
||||
.end
|
||||
)";
|
||||
|
||||
// clang-format off
|
||||
unsigned char li_shader[] = {
|
||||
0x44, 0x56, 0x4c, 0x42, 0x1, 0x0, 0x0, 0x0, 0xa4, 0x0, 0x0, 0x0, 0x44, 0x56, 0x4c, 0x50, 0x0, 0x0, 0x0, 0x0, 0x28, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x50, 0x0, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0x98, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4e, 0x1, 0xf0, 0x7, 0x4e, 0x2, 0x8, 0x2, 0x8, 0x3, 0x18, 0x2, 0x8, 0x4, 0x28, 0x2, 0x8, 0x5, 0x38, 0x2, 0x8, 0x6, 0x10, 0x40, 0x4c, 0x7, 0xf1, 0x27, 0x22, 0x8, 0x10, 0x21, 0x4c, 0x0, 0x0, 0x0, 0x88, 0xac, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa1, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x68, 0xc3, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x64, 0xc3, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x62, 0xc3, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x61, 0xc3, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0xaf, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4f, 0xd5, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6f, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x44, 0x56, 0x4c, 0x45, 0x2, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x54, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x54, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x6c, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x74, 0x0, 0x0, 0x0, 0xb, 0x0, 0x0, 0x0, 0x2, 0x0, 0x5f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3f, 0x0, 0x1, 0x1, 0x37, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0x0, 0x0, 0x0, 0x2, 0x0, 0x1, 0x0, 0xf, 0x0, 0x0, 0x0, 0x3, 0x0, 0x2, 0x0, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x13, 0x0, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x0, 0x0,
|
||||
};
|
||||
// clang-format on
|
||||
size_t li_shader_size = 0x124;
|
||||
|
||||
namespace PD {
|
||||
GPU_TEXCOLOR GetTexFmt(Li::Texture::Type type) {
|
||||
if (type == Li::Texture::RGBA32)
|
||||
@@ -98,7 +88,8 @@ void GfxC3D::Init() {
|
||||
|
||||
Flags |= LiBackendFlags_FlipUV_Y;
|
||||
|
||||
ShaderCode = DVLB_ParseFile((uint32_t*)li_shader, li_shader_size);
|
||||
pRawShader = Pica::AssembleCode(LIShaderCTR);
|
||||
ShaderCode = DVLB_ParseFile((uint32_t*)&pRawShader[0], pRawShader.size());
|
||||
shaderProgramInit(&Shader);
|
||||
shaderProgramSetVsh(&Shader, &ShaderCode->DVLE[0]);
|
||||
pLocProjection =
|
||||
@@ -131,7 +122,6 @@ void GfxC3D::BindTex(PD::Li::TexAddress addr) {
|
||||
}
|
||||
|
||||
void GfxC3D::RenderDrawData(const std::vector<PD::Li::Command::Ref>& Commands) {
|
||||
// C3D_BindProgram(&Shader);
|
||||
shaderProgramUse(&Shader);
|
||||
C3D_SetAttrInfo(&ShaderInfo);
|
||||
C3D_Mtx proj;
|
||||
|
||||
Reference in New Issue
Block a user