Thanks for the response. I seem to always be walking away from the
computer at the wrong time to interact on IRC. :)
As for the alignment patch...I just noticed, the setUniformValue_()
functions use "+= sizeof(type)", instead of referring to the
UNIFORM_SIZES array, so my previous patch was broken. Is there another
issue you are aware of that broke GL2 for you?
Anyways, we can avoid the gcc extension by defining uniformStorage as a
smaller array of elements of typed void*, which should be aligned
As an aside, I do not think the use of uniformStoragePointer is necessary
under strict aliasing rules. The rule says that if you are executing a
read of a given type at a given address, then the compiler may assume the
value was written as the same type (which is followed in this code). The
strict aliasing rule is not concerned with the type of the variable, only
the type of the memory accesses.
Plus I'm a factoring junky. :)
So for the sake of conversation, I put this patch in
lp:~launchp-t/stellarium/slowcomputer (rev 5938)
It might be overkill. It is definitely more correct than my previous
patch. If there is a situation I have not found where uniformStorage
needs to be packed (for example if it is passed directly as a single
unit), then it is wrong. I certainly won't be offended
On Sat, Mar 23, 2013 at 01:34:33PM +0700, Alexander Wolf wrote:
> 2013/3/23 Greg Alexander <stella@...>
> > I checked out the bazaar repository, rev 5924, and built it and
> > discovered two separate issues that caused Stellarium to crash on startup
> > on my computer. I'm new to Stellarium development (and to Bazaar) so I
> > hope I'm not doing this wrong...
> I think this was you on IRC :)
> > First, the new solar system shadows are enabled by default, but if they
> > are initialized without StelRenderer::areFloatTexturesSupported() then
> > that triggers an assert failure in
> > StelRenderer::createTexture(void*,QSize,TextureDataFormat,TextureParams&).
> > I believe I saw this before other users because I am using unaccelerated
> > (software rendered) MesaGL. My proposed remedy is to disable solar system
> > shadows (regardless of the config parameter) if float textures are
> > not supported.
> ok. I'm apply this patch - it's a logical and nothing broken :)
> > Second, StelQGLGLSLShader.uniformStorage can be unaligned, both because
> > its start position may be unaligned and because it may contain members
> > (such as bool) which would introduce misalignment in subsequent members.
> > I believe I saw this before other users because I am running on ARM,
> > which gives a fatal SIGBUS for unaligned memory access. My proposed
> > remedy is to enforce a minimum alignment in uniformStorage corresponding
> > to sizeof(void*), which should be harmless on most platforms, a slight
> > performance improvement on some, and the difference between
> > crashing-or-not on a few. Note that I use the GCC
> This patch works for the unaccelerated mode (GL1) but it broken the
> accelerated mode (GL2).
> > __attribute__((aligned(n))) extension. I noticed that the similar GCC
> > extension __attribute__((packed)) was already used in Stellarium, so
> > hopefully that is not forbidden...
> Well, you should use #ifdef defined(__GNUC__) for GCC extension because
> Stellarium build via clang too. :)
> > As an aside, I am working on the development branch of Stellarium because
> > I am attempting to improve the performance on my new laptop that does not
> > have accelerated GL drivers. At first glance, the new build from Bazaar
> > appears to be about 400% slower than the 0.11.4 that I had been working
> > with, so that is where my focus will be if I have any future
> > contributions.
> You can register at launchpad and create a branch for Stellarium - I think
> this will be better way for coding and applies patches.
> > And thanks -- Stellarium is simply the best!! Even at 1fps, I find I
> > can't live without it.
> With best regards, Alexander
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> Stellarium-pubdevel mailing list