Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sisah2 committed Apr 24, 2024
1 parent 68362f8 commit 90d5651
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
3 changes: 2 additions & 1 deletion buildscripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ set(MYGUI_VERSION 3.4.3)
set(MYGUI_HASH SHA256=d1d5f294670ae71f7200ed4b30859018281d8cfd45d6a38d18b97a4aba604c42)

# https://github.com/sisah2/gl4es/releases
set(GL4ES_VERSION d3027e655b2e22dda31cf50cf1101fbde8627a65)
set(GL4ES_VERSION 8ca62e55d139936c7e555e0e0c399ed07f15366a)
set(GL4ES_HASH SHA256=b565e717c7d192e936bda25f3cb90ad8db398af56414ec08294b6716574c1a6d)

# https://github.com/openscenegraph/OpenSceneGraph/releases
Expand Down Expand Up @@ -539,6 +539,7 @@ set(OSG_PATCH
patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/0004-IncrementalCompileOperation-wrap-some-stuff-in-atomi.patch &&
patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/force-add-plugins.patch &&
patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/dae_collada.patch &&
patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/mipmap-hack.patch &&
patch -d <SOURCE_DIR> -p1 -t -N < ${CMAKE_SOURCE_DIR}/patches/osg/0005-CullSettings-make-inheritanceMask-atomic-to-silence-.patch
)

Expand Down
29 changes: 29 additions & 0 deletions buildscripts/patches/osg/mipmap-hack.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp
index 2c0bd4b4e..74ba0ed07 100644
--- a/src/osg/Texture.cpp
+++ b/src/osg/Texture.cpp
@@ -2497,9 +2497,13 @@ void Texture::applyTexImage2D_load(State& state, GLenum target, const Image* ima
GLint blockSize, size;
getCompressedSize(_internalFormat, inwidth, inheight, 1, blockSize,size);

+ int size2 = size;
+ if (useHardwareMipMapGeneration)
+ size2 *= -1;
+
extensions->glCompressedTexImage2D(target, 0, _internalFormat,
inwidth, inheight,0,
- size,
+ size2,
dataPtr);
}

@@ -2619,6 +2623,9 @@ void Texture::applyTexImage2D_load(State& state, GLenum target, const Image* ima

getCompressedSize(_internalFormat, width, height, 1, blockSize,size);

+ if (k == numMipmapLevels - 1)
+ size *= -1;
+
extensions->glCompressedTexImage2D(target, k, _internalFormat,
width, height, _borderWidth,
size, dataPtr + image->getMipmapOffset(k));

0 comments on commit 90d5651

Please sign in to comment.