- decided to restrict the 2.0 beta to OpenGL 4.x with GL_ARB_buffer_storage extension and removed all code for supporting older versions.
Sadly, anything else makes no sense. All the recently made changes live or die, depending on this extension's presence. Without it, there are major performance issues with the buffer uploads. All of the traditional buffer upload methods are without exception horrendously slow, especially in the context of a Doom engine where frequent small updates are required. It could be solved with a complete restructuring of the engine, of course, but that's hardly worth the effort, considering it's only for legacy hardware whose market share will inevitably shrink considerably over the next years. And even then, under the best circumstances I'd still get the same performance as the old immediate mode renderer in GZDoom 1.x and still couldn't implement the additions I'd like to make. So, since I need to keep GZDoom 1.x around anyway for older GL 2.x hardware, it may as well serve for 3.x hardware, too. It's certainly less work than constantly trying to find workarounds for the older hardware's limitations that cost more time than working on future-proofing the engine. This new, trimmed down 4.x renderer runs on a core profile configuration and uses persistently mapped buffers for nearly everything that is getting transferred to the GPU. (The global uniforms are still being used as such but they'll be phased out after the first beta release.
This commit is contained in:
parent
7967082e60
commit
a8e9c1832f
11 changed files with 46 additions and 324 deletions
|
|
@ -55,34 +55,17 @@ void iCopyColors(unsigned char * pout, const unsigned char * pin, bool alphatex,
|
|||
{
|
||||
int i;
|
||||
|
||||
if (!alphatex || gl.version >= 3.3f) // GL 3.3+ uses a GL_R8 texture for alpha textures so the channels can remain as they are.
|
||||
for(i=0;i<count;i++)
|
||||
{
|
||||
for(i=0;i<count;i++)
|
||||
if (T::A(pin) != 0)
|
||||
{
|
||||
if (T::A(pin) != 0)
|
||||
{
|
||||
pout[0]=T::R(pin);
|
||||
pout[1]=T::G(pin);
|
||||
pout[2]=T::B(pin);
|
||||
pout[3]=T::A(pin);
|
||||
}
|
||||
pout+=4;
|
||||
pin+=step;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Alpha shade uses the red channel for true color pics
|
||||
for(i=0;i<count;i++)
|
||||
{
|
||||
if (T::A(pin) != 0)
|
||||
{
|
||||
pout[0] = pout[1] = pout[2] = 255;
|
||||
pout[3] = T::R(pin);
|
||||
}
|
||||
pout+=4;
|
||||
pin+=step;
|
||||
pout[0]=T::R(pin);
|
||||
pout[1]=T::G(pin);
|
||||
pout[2]=T::B(pin);
|
||||
pout[3]=T::A(pin);
|
||||
}
|
||||
pout+=4;
|
||||
pin+=step;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -140,25 +123,12 @@ void FGLBitmap::CopyPixelData(int originx, int originy, const BYTE * patch, int
|
|||
// alpha map with 0==transparent and 1==opaque
|
||||
if (alphatex)
|
||||
{
|
||||
if (gl.version < 3.3f)
|
||||
for (int i = 0; i<256; i++)
|
||||
{
|
||||
for (int i = 0; i<256; i++)
|
||||
{
|
||||
if (palette[i].a != 0)
|
||||
penew[i] = PalEntry(i, 255, 255, 255);
|
||||
else
|
||||
penew[i] = PalEntry(0, 255, 255, 255); // If the palette contains transparent colors keep them.
|
||||
}
|
||||
}
|
||||
else // on GL 3.3+ we use a GL_R8 texture so the layout is different.
|
||||
{
|
||||
for (int i = 0; i<256; i++)
|
||||
{
|
||||
if (palette[i].a != 0)
|
||||
penew[i] = PalEntry(255, i, 255, 255);
|
||||
else
|
||||
penew[i] = PalEntry(255, 0, 255, 255); // If the palette contains transparent colors keep them.
|
||||
}
|
||||
if (palette[i].a != 0)
|
||||
penew[i] = PalEntry(255, i, 255, 255);
|
||||
else
|
||||
penew[i] = PalEntry(255, 0, 255, 255); // If the palette contains transparent colors keep them.
|
||||
}
|
||||
}
|
||||
else if (translation > 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue