Merge remote-tracking branch 'origin/12.0-development' into vulkan

This commit is contained in:
niki
2022-08-15 03:43:35 +02:00
22 changed files with 204 additions and 72 deletions
+2 -3
View File
@@ -124,7 +124,6 @@ void Text::addTextData(const TextData &t)
size_t voffset = vertOffset;
// Must be before the early exit below.
if (!t.appendVertices)
{
voffset = 0;
@@ -133,8 +132,8 @@ void Text::addTextData(const TextData &t)
textData.clear();
}
if (t.useMatrix)
t.matrix.transformXY(&vertices[0], &vertices[0], (int) vertices.size());
if (t.useMatrix && !vertices.empty())
t.matrix.transformXY(vertices.data(), vertices.data(), (int) vertices.size());
uploadVertices(vertices, voffset);
+1 -1
View File
@@ -527,7 +527,7 @@ void Graphics::setActive(bool enable)
void Graphics::setShaderChanged()
{
dirtyRenderState |= STATE_SHADER;
dirtyRenderState |= STATEBIT_SHADER;
++shaderSwitches;
}
+10 -2
View File
@@ -1414,12 +1414,17 @@ void Graphics::setStencilMode(StencilAction action, CompareMode compare, int val
if (enablestencil != gl.isStateEnabled(OpenGL::ENABLE_STENCIL_TEST))
gl.setEnableState(OpenGL::ENABLE_STENCIL_TEST, enablestencil);
GLenum glaction = GL_REPLACE;
GLenum glaction = GL_KEEP;
switch (action)
{
case STENCIL_KEEP:
glaction = GL_KEEP;
break;
case STENCIL_ZERO:
glaction = GL_ZERO;
break;
case STENCIL_REPLACE:
default:
glaction = GL_REPLACE;
break;
case STENCIL_INCREMENT:
@@ -1437,6 +1442,9 @@ void Graphics::setStencilMode(StencilAction action, CompareMode compare, int val
case STENCIL_INVERT:
glaction = GL_INVERT;
break;
case STENCIL_MAX_ENUM:
glaction = GL_KEEP;
break;
}
/**
+6 -8
View File
@@ -298,20 +298,18 @@ void Texture::createTexture()
{
if (isCompressed() && (texType == TEXTURE_2D_ARRAY || texType == TEXTURE_VOLUME))
{
int slicecount = slices.getSliceCount(mip);
size_t mipsize = 0;
if (texType == TEXTURE_2D_ARRAY || texType == TEXTURE_VOLUME)
for (int slice = 0; slice < slicecount; slice++)
{
for (int slice = 0; slice < slices.getSliceCount(mip); slice++)
{
auto id = slices.get(slice, mip);
if (id != nullptr)
mipsize += id->getSize();
}
auto id = slices.get(slice, mip);
if (id != nullptr)
mipsize += id->getSize();
}
if (mipsize > 0)
glCompressedTexImage3D(gltype, mip, fmt.internalformat, w, h, d, 0, mipsize, nullptr);
glCompressedTexImage3D(gltype, mip, fmt.internalformat, w, h, slicecount, 0, mipsize, nullptr);
}
for (int slice = 0; slice < slicecount; slice++)