1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-03 08:48:42 +00:00
RetroArch/wiiu/shader_utils.h

92 lines
1.6 KiB
C
Raw Permalink Normal View History

2023-06-01 20:52:05 +00:00
#ifndef _GX2_SHADER_UTILS_H
#define _GX2_SHADER_UTILS_H
2018-01-04 16:21:16 +00:00
#include <wiiu/gx2/shaders.h>
/* incompatible with elf builds */
2018-01-06 12:44:03 +00:00
/* #define GX2_CAN_ACCESS_DATA_SECTION */
2018-01-04 16:21:16 +00:00
#ifdef __cplusplus
extern "C" {
#endif
typedef union
__attribute__((aligned (16)))
{
struct __attribute__((scalar_storage_order ("little-endian")))
{
float x;
float y;
};
struct __attribute__((scalar_storage_order ("little-endian")))
{
float width;
float height;
};
}GX2_vec2;
typedef struct
__attribute__((aligned (16)))
__attribute__((scalar_storage_order ("little-endian")))
{
float x;
float y;
union
{
struct __attribute__((scalar_storage_order ("little-endian")))
{
float z;
float w;
};
struct __attribute__((scalar_storage_order ("little-endian")))
{
float width;
float height;
};
};
}GX2_vec4;
typedef union
{
struct
{
GX2_vec4 v0;
GX2_vec4 v1;
GX2_vec4 v2;
GX2_vec4 v3;
};
struct __attribute__((scalar_storage_order ("little-endian")))
{
float data[16];
};
}GX2_mat4x4;
2018-01-04 16:21:16 +00:00
typedef struct
{
GX2VertexShader vs;
GX2PixelShader ps;
GX2GeometryShader gs;
GX2FetchShader fs;
GX2AttribStream* attribute_stream;
}GX2Shader;
void GX2InitShader(GX2Shader* shader);
void GX2DestroyShader(GX2Shader* shader);
void GX2SetShader(GX2Shader* shader);
2018-01-04 22:03:11 +00:00
typedef struct
{
GX2VertexShader* vs;
GX2PixelShader* ps;
u8* data;
} GFDFile;
GFDFile* gfd_open(const char* filename);
void gfd_free(GFDFile* gfd);
2018-01-04 16:21:16 +00:00
#ifdef __cplusplus
}
#endif
2023-06-01 20:52:05 +00:00
#endif