lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Steven Johnson wrote:
> With a lot of shadow modules and dumps of the package table, I tracked
> the issue down to before (modules look fine) and after (the nesting) our
> middleware initialization call. I made an educated guess and added
> _control87( _PC_53, MCW_PC ); immediately after that, and the game
> is up and running. :P

Yikes! Does any middleware vendor still believe butchering the x87
flags makes a difference? None of the compute-intensive paths use
the x87 FPU anymore. I guess most games nowadays don't even run
without SSE2 support and a high performance GPU.

Since most of these initializations happen after luaL_openlibs(),
I guess I could add a check for the FPU flags to luaL_register()
or at the end of the C module loader. Would that have helped to
track down the cause in your case?

> So, this being DX9, I imagine the lack of D3DCREATE_FPU_PRESERVE
> reared its ugly head once LJ2 was already active. I'll see if I can attend to
> that properly and will report back if my assumptions don't hold. If they do,
> that's probably worth putting a big warning somewhere. :)

I'll add it to the FAQ. But the caveat applies to Lua, too. You
just don't notice the problem until it's too late (like when
indexing some big table or using luaL_ref).