fix linker warning and add lto example as comment

This commit is contained in:
Green Sky 2022-11-06 15:31:38 +01:00
parent 3f03bbbd49
commit 20dd451cd0
No known key found for this signature in database
2 changed files with 14 additions and 6 deletions

View File

@ -20,9 +20,16 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
# add this to your projects cmake to enable ipo
#if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
#include(CheckIPOSupported)
#check_ipo_supported()
#check_ipo_supported(RESULT HAVE_LTO)
#if(HAVE_LTO)
#set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
#message(STATUS "Enabled LTO")
#else()
#message(STATUS "LTO not supported")
#endif()
#endif()
# enable test
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)

View File

@ -55,15 +55,16 @@ FBOBuilder& FBOBuilder::setTarget(FrameBufferObject::Target target) {
FBOBuilder& FBOBuilder::attachTexture(std::shared_ptr<Texture> tex, GLuint attachment_type) {
GLenum target;
switch (_currTarget) {
case FrameBufferObject::Target::RW:
target = GL_FRAMEBUFFER;
break;
case FrameBufferObject::Target::R:
target = GL_READ_FRAMEBUFFER;
break;
case FrameBufferObject::Target::W:
target = GL_DRAW_FRAMEBUFFER;
break;
//case FrameBufferObject::Target::RW:
default:
target = GL_FRAMEBUFFER;
break;
}
if (tex->samples == 0u) {