Move defines to wut

This commit is contained in:
Maschell 2018-06-23 13:52:46 +02:00
parent e8f1942db4
commit c9fc3c81ae
5 changed files with 13 additions and 22 deletions

View File

@ -14,16 +14,6 @@ extern "C" {
#include <gx2/surface.h>
#include <gx2/texture.h>
#define GX2_FALSE 0
#define GX2_TRUE 1
#define GX2_DISABLE 0
#define GX2_ENABLE 1
#define GX2_COMMAND_BUFFER_SIZE 0x400000
#define GX2_SHADER_ALIGNMENT 0x100
#define GX2_VERTEX_BUFFER_ALIGNMENT 0x40
#define GX2_INDEX_BUFFER_ALIGNMENT 0x20
#define GX2_AA_BUFFER_CLEAR_VALUE 0xCC
#define GX2_COMP_SEL_NONE 0x04040405
@ -38,6 +28,14 @@ extern "C" {
#define GX2_COMP_SEL_WZYX 0x03020100
#define GX2_COMP_SEL_WXYZ 0x03000102
typedef struct _GX2Color {
uint8_t r, g, b, a;
} GX2Color;
typedef struct _GX2ColorF32 {
float r, g, b, a;
} GX2ColorF32;
static const uint32_t attribute_dest_comp_selector[20] = {
GX2_COMP_SEL_X001, GX2_COMP_SEL_XY01, GX2_COMP_SEL_X001, GX2_COMP_SEL_X001, GX2_COMP_SEL_XY01, GX2_COMP_SEL_X001,
GX2_COMP_SEL_X001, GX2_COMP_SEL_XY01, GX2_COMP_SEL_XY01, GX2_COMP_SEL_XYZ1, GX2_COMP_SEL_XYZW, GX2_COMP_SEL_XYZW,
@ -57,14 +55,6 @@ static const uint32_t texture_comp_selector[54] = {
GX2_COMP_SEL_XYZ1, GX2_COMP_SEL_XYZW, GX2_COMP_SEL_XYZW, GX2_COMP_SEL_XYZW, GX2_COMP_SEL_X001, GX2_COMP_SEL_XY01
};
typedef struct _GX2Color {
uint8_t r, g, b, a;
} GX2Color;
typedef struct _GX2ColorF32 {
float r, g, b, a;
} GX2ColorF32;
static inline void GX2InitDepthBuffer(GX2DepthBuffer *depthBuffer, GX2SurfaceDim dim, uint32_t width, uint32_t height, uint32_t depth, GX2SurfaceFormat format, GX2AAMode aa) {
depthBuffer->surface.dim = dim;
depthBuffer->surface.width = width;
@ -167,5 +157,5 @@ static inline void GX2InitTexture(GX2Texture *tex, uint32_t width, uint32_t heig
}
#endif
#endif /* COMMON_H */
#endif

View File

@ -25,7 +25,7 @@ public:
: fetchShader(NULL)
, fetchShaderProgramm(NULL) {
uint32_t shaderSize = GX2CalcFetchShaderSizeEx(attrCount, type, tess);
fetchShaderProgramm = (uint8_t*)memalign(GX2_SHADER_ALIGNMENT, shaderSize);
fetchShaderProgramm = (uint8_t*)memalign(GX2_SHADER_PROGRAM_ALIGNMENT, shaderSize);
if(fetchShaderProgramm) {
fetchShader = new GX2FetchShader;
GX2InitFetchShaderEx(fetchShader, fetchShaderProgramm, attrCount, attributes, type, tess);

View File

@ -67,7 +67,7 @@ public:
//! this must be moved into an area where the graphic engine has access to and must be aligned to 0x100
pixelShader->size = programSize;
pixelShader->program = (uint8_t*)memalign(GX2_SHADER_ALIGNMENT, pixelShader->size);
pixelShader->program = (uint8_t*)memalign(GX2_SHADER_PROGRAM_ALIGNMENT, pixelShader->size);
if(pixelShader->program) {
memcpy(pixelShader->program, program, pixelShader->size);
GX2Invalidate(GX2_INVALIDATE_MODE_CPU_SHADER, pixelShader->program, pixelShader->size);

View File

@ -22,6 +22,7 @@
#include <utils/utils.h>
#include <gx2/shaders.h>
#include <gx2/mem.h>
#include <gx2/enum.h>
#include <gx2/registers.h>
#include <gx2/draw.h>

View File

@ -80,7 +80,7 @@ public:
//! this must be moved into an area where the graphic engine has access to and must be aligned to 0x100
vertexShader->size = programSize;
vertexShader->program = (uint8_t*) memalign(GX2_SHADER_ALIGNMENT, vertexShader->size);
vertexShader->program = (uint8_t*) memalign(GX2_SHADER_PROGRAM_ALIGNMENT, vertexShader->size);
if(vertexShader->program) {
memcpy(vertexShader->program, program, vertexShader->size);
GX2Invalidate(GX2_INVALIDATE_MODE_CPU_SHADER, vertexShader->program, vertexShader->size);