BurningVideo: remove align 16 byte on win32

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6191 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
engineer_apple 2021-02-13 21:49:03 +00:00
parent 748510300d
commit 12a94ed5b7
4 changed files with 23 additions and 24 deletions

@ -466,19 +466,19 @@ bool CBurningVideoDriver::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const
on = 1; on = 1;
break; break;
case EVDF_TEXTURE_NPOT: // for 2D
on = 0;
break;
case EVDF_ARB_FRAGMENT_PROGRAM_1: case EVDF_ARB_FRAGMENT_PROGRAM_1:
case EVDF_ARB_VERTEX_PROGRAM_1: case EVDF_ARB_VERTEX_PROGRAM_1:
on = 1; on = 1;
break; break;
#if defined(PATCH_SUPERTUX_8_0_1) #if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0)
case EVDF_TEXTURE_NPOT: case EVDF_TEXTURE_NPOT:
case EVDF_ARB_GLSL: case EVDF_ARB_GLSL:
on = 1; on = 1;
break; break;
#else
case EVDF_TEXTURE_NPOT: // for 2D
on = 0;
break;
#endif #endif
#if defined(SOFTWARE_DRIVER_2_2D_AS_3D) #if defined(SOFTWARE_DRIVER_2_2D_AS_3D)
@ -1310,16 +1310,6 @@ REALINLINE s32 CBurningVideoDriver::lodFactor_inside(const s4DVertexPair* burnin
inline void CBurningVideoDriver::select_polygon_mipmap_inside(s4DVertex* burning_restrict face[], const size_t tex, const CSoftwareTexture2_Bound& b) const inline void CBurningVideoDriver::select_polygon_mipmap_inside(s4DVertex* burning_restrict face[], const size_t tex, const CSoftwareTexture2_Bound& b) const
{ {
#ifdef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT #ifdef SOFTWARE_DRIVER_2_PERSPECTIVE_CORRECT
#if defined(Tweak_Burning)
(face[0] + 1)->Tex[tex].x = face[0]->Tex[tex].x * (face[0] + 1)->Pos.w * (b.w + Tweak.tex_w_add) + (b.cx + Tweak.tex_cx_add);
(face[0] + 1)->Tex[tex].y = face[0]->Tex[tex].y * (face[0] + 1)->Pos.w * (b.h + Tweak.tex_h_add) + (b.cy + Tweak.tex_cy_add);
(face[1] + 1)->Tex[tex].x = face[1]->Tex[tex].x * (face[1] + 1)->Pos.w * (b.w + Tweak.tex_w_add) + (b.cx + Tweak.tex_cx_add);
(face[1] + 1)->Tex[tex].y = face[1]->Tex[tex].y * (face[1] + 1)->Pos.w * (b.h + Tweak.tex_h_add) + (b.cy + Tweak.tex_cy_add);
(face[2] + 1)->Tex[tex].x = face[2]->Tex[tex].x * (face[2] + 1)->Pos.w * (b.w + Tweak.tex_w_add) + (b.cx + Tweak.tex_cx_add);
(face[2] + 1)->Tex[tex].y = face[2]->Tex[tex].y * (face[2] + 1)->Pos.w * (b.h + Tweak.tex_h_add) + (b.cy + Tweak.tex_cy_add);
#else
(face[0] + 1)->Tex[tex].x = face[0]->Tex[tex].x * (face[0] + 1)->Pos.w * b.w + b.cx; (face[0] + 1)->Tex[tex].x = face[0]->Tex[tex].x * (face[0] + 1)->Pos.w * b.w + b.cx;
(face[0] + 1)->Tex[tex].y = face[0]->Tex[tex].y * (face[0] + 1)->Pos.w * b.h + b.cy; (face[0] + 1)->Tex[tex].y = face[0]->Tex[tex].y * (face[0] + 1)->Pos.w * b.h + b.cy;
@ -1328,7 +1318,6 @@ inline void CBurningVideoDriver::select_polygon_mipmap_inside(s4DVertex* burning
(face[2] + 1)->Tex[tex].x = face[2]->Tex[tex].x * (face[2] + 1)->Pos.w * b.w + b.cx; (face[2] + 1)->Tex[tex].x = face[2]->Tex[tex].x * (face[2] + 1)->Pos.w * b.w + b.cx;
(face[2] + 1)->Tex[tex].y = face[2]->Tex[tex].y * (face[2] + 1)->Pos.w * b.h + b.cy; (face[2] + 1)->Tex[tex].y = face[2]->Tex[tex].y * (face[2] + 1)->Pos.w * b.h + b.cy;
#endif
#else #else
(face[0] + 1)->Tex[tex].x = face[0]->Tex[tex].x * b.w; (face[0] + 1)->Tex[tex].x = face[0]->Tex[tex].x * b.w;
(face[0] + 1)->Tex[tex].y = face[0]->Tex[tex].y * b.h; (face[0] + 1)->Tex[tex].y = face[0]->Tex[tex].y * b.h;
@ -1369,13 +1358,13 @@ void CBurningVideoDriver::VertexCache_map_source_format()
os::Printer::log("BurningVideo pointer should be 8 bytes", ELL_ERROR); os::Printer::log("BurningVideo pointer should be 8 bytes", ELL_ERROR);
_IRR_DEBUG_BREAK_IF(1); _IRR_DEBUG_BREAK_IF(1);
} }
#endif
if (((unsigned long long)Transformation&15) || ((unsigned long long)TransformationFlag & 15)) if (((unsigned long long)Transformation&15) || ((unsigned long long)TransformationFlag & 15))
{ {
os::Printer::log("BurningVideo Matrix Stack not 16 byte aligned", ELL_ERROR); os::Printer::log("BurningVideo Matrix Stack not 16 byte aligned", ELL_ERROR);
_IRR_DEBUG_BREAK_IF(1); _IRR_DEBUG_BREAK_IF(1);
} }
#endif
SVSize* vSize = VertexCache.vSize; SVSize* vSize = VertexCache.vSize;
@ -3464,7 +3453,7 @@ ITexture* CBurningVideoDriver::addRenderTargetTexture(const core::dimension2d<u3
//empty proxy image //empty proxy image
IImage* img = createImageFromData(format, size, 0, true, false); IImage* img = createImageFromData(format, size, 0, true, false);
ITexture* tex = new CSoftwareTexture2(img, name, CSoftwareTexture2::IS_RENDERTARGET /*| CSoftwareTexture2::GEN_MIPMAP */, this); ITexture* tex = new CSoftwareTexture2(img, name, CSoftwareTexture2::IS_RENDERTARGET /*| CSoftwareTexture2::GEN_MIPMAP */, this);
img->drop(); if ( img ) img->drop();
addTexture(tex); addTexture(tex);
tex->drop(); tex->drop();
return tex; return tex;
@ -3713,6 +3702,9 @@ s32 CBurningVideoDriver::addHighLevelShaderMaterial(
IShaderConstantSetCallBack* callback, IShaderConstantSetCallBack* callback,
E_MATERIAL_TYPE baseMaterial, E_MATERIAL_TYPE baseMaterial,
s32 userData s32 userData
#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0)
, E_GPU_SHADING_LANGUAGE shadingLang
#endif
) )
{ {
s32 materialID = -1; s32 materialID = -1;

@ -215,11 +215,6 @@ namespace video
IDepthBuffer * getDepthBuffer () { return DepthBuffer; } IDepthBuffer * getDepthBuffer () { return DepthBuffer; }
IStencilBuffer * getStencilBuffer () { return StencilBuffer; } IStencilBuffer * getStencilBuffer () { return StencilBuffer; }
//#define Tweak_Burning
#if defined(Tweak_Burning)
virtual void postEventFromUser(const void* sevent) _IRR_OVERRIDE_;
#endif
//! Adds a new material renderer to the VideoDriver, using pixel and/or //! Adds a new material renderer to the VideoDriver, using pixel and/or
//! vertex shaders to render geometry. //! vertex shaders to render geometry.
virtual s32 addShaderMaterial(const c8* vertexShaderProgram, virtual s32 addShaderMaterial(const c8* vertexShaderProgram,
@ -245,7 +240,11 @@ namespace video
u32 verticesOut = 0, u32 verticesOut = 0,
IShaderConstantSetCallBack* callback = 0, IShaderConstantSetCallBack* callback = 0,
E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID, E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
s32 userData = 0) _IRR_OVERRIDE_; s32 userData = 0
#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0)
, E_GPU_SHADING_LANGUAGE shadingLang = EGSL_DEFAULT
#endif
) _IRR_OVERRIDE_;
//IMaterialRendererService //IMaterialRendererService

@ -29,11 +29,13 @@ void IBurningShader::constructor_IBurningShader(CBurningVideoDriver* driver)
setDebugName("IBurningShader"); setDebugName("IBurningShader");
#endif #endif
#if defined(ENV64BIT)
if (((unsigned long long)&scan & 15) || ((unsigned long long)&line & 15)) if (((unsigned long long)&scan & 15) || ((unsigned long long)&line & 15))
{ {
os::Printer::log("BurningVideo Shader not 16 byte aligned", ELL_ERROR); os::Printer::log("BurningVideo Shader not 16 byte aligned", ELL_ERROR);
_IRR_DEBUG_BREAK_IF(1); _IRR_DEBUG_BREAK_IF(1);
} }
#endif
Interlaced.enable = 0; Interlaced.enable = 0;
Interlaced.bypass = 1; Interlaced.bypass = 1;
@ -96,6 +98,7 @@ IBurningShader::IBurningShader(
{ {
constructor_IBurningShader(driver); constructor_IBurningShader(driver);
BaseMaterial = baseMaterial; BaseMaterial = baseMaterial;
UserData = userData;
CallBack = callback; CallBack = callback;
if (CallBack) if (CallBack)
CallBack->grab(); CallBack->grab();

@ -308,7 +308,12 @@ namespace irr {
//! Compiler Align //! Compiler Align
#if defined(_MSC_VER) #if defined(_MSC_VER)
#if defined(ENV64BIT)
#define ALIGN(x) __declspec(align(x)) #define ALIGN(x) __declspec(align(x))
#else
// ALIGN(16) not working
#define ALIGN(x) __declspec(align(8))
#endif
#elif defined(__GNUC__) #elif defined(__GNUC__)
#define ALIGN(x) __attribute__ ((aligned(x))) #define ALIGN(x) __attribute__ ((aligned(x)))
#else #else