Major Class Refactor
Release 0.15.6
Class refactor (#52)
Based on the suggestion in the issue, the following class has been rewritten:
- STPPermutationGenerator
- STPErosionBrushGenerator, merged with
STPHeightfieldGenerator. - Refactor
STPBindlessTextureto use the bindless texture handle utility (inSTPSmartDeviceObject). - Merge
STPBindlessBufferwithSTPBufferand remove the wrapper because not making the buffer address non-resident will not cause any damage as long as the buffer itself is deleted properly. - STPShaderMangar
STPProgramManagerandSTPPipelineManagerare now stateless.
Robust memory management
STPSmartDeviceObject
- Add managed GL texture and bindless texture memory management.
- Suffix keyword Resource to
makeGLBufferandmakeGLImagefunction to disambiguate. - Remove default parameters when creating managed stream and event.
- GL texture memory in
STPWorldPipelineandSTPTextureFactoryare now managed by smart pointer.
STPTextureFactory
- Creates bindless texture handle for every texture object.
- Because texture sampler state cannot be changed once bindless handle is created, sampler states are not changed via a function passed during construction of
STPTextureFactory.
- Because texture sampler state cannot be changed once bindless handle is created, sampler states are not changed via a function passed during construction of
STPHeightfieldTerrainnow no longer needs to create bindless texture separately.
General fixes and improvement
- Simplify initial permutation table generation in
STPPermutationGenerator. - Now you can use left shift key to move twice as fast in the demo program.
STPHeightfieldTerrainnow generates random noise texture during constructor call.- Make some functions in
STPSingleHistogramFilterandSTPLightSpectrumnoexcept. - Fix some spelling errors in documentation.
SuperRealism+
- Make all GL object wrappers
noexceptbecause C API never throws exception, instead we use debug callback to capture any error. - Reduce dynamic memory allocation by replacing
std::vectorwithstd::initialiser_listin the following function:- drawBuffers() function in STPFrameBuffer.
- setData() function in
STPLightSpectrumnow takes raw data parameters rather than using template, it is too much work to deduce pixel types information from input type. - Add a validate function in
STPFrameBufferto help decoding the framebuffer status flag into an exception. - Improve
STPLogHandlerby using function to set the active log handler rather than using global variable. - Add program active state manager to prevent state overrides to program pipeline.
- Refactor
STPDebugCallback, now user is responsible for handling the debug log.- Now the demo program will exit if an error GL message is encountered.