diff --git a/include/gui/gx2_ext.h b/include/gui/gx2_ext.h index 15249e3..8ed3605 100644 --- a/include/gui/gx2_ext.h +++ b/include/gui/gx2_ext.h @@ -14,16 +14,6 @@ extern "C" { #include #include -#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 diff --git a/include/video/shaders/FetchShader.h b/include/video/shaders/FetchShader.h index f19a9a1..3e60337 100644 --- a/include/video/shaders/FetchShader.h +++ b/include/video/shaders/FetchShader.h @@ -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); diff --git a/include/video/shaders/PixelShader.h b/include/video/shaders/PixelShader.h index ce35f1a..7f39ff8 100644 --- a/include/video/shaders/PixelShader.h +++ b/include/video/shaders/PixelShader.h @@ -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); diff --git a/include/video/shaders/Shader.h b/include/video/shaders/Shader.h index 67065a5..2f9c63b 100644 --- a/include/video/shaders/Shader.h +++ b/include/video/shaders/Shader.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include diff --git a/include/video/shaders/VertexShader.h b/include/video/shaders/VertexShader.h index f7ac415..6ac61c7 100644 --- a/include/video/shaders/VertexShader.h +++ b/include/video/shaders/VertexShader.h @@ -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);