Skip to content

Commit 46f4bc3

Browse files
committed
Merge branch 'glsl' of github.com:projectM-visualizer/projectm into glsl
2 parents 00e93e6 + 8785481 commit 46f4bc3

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

src/libprojectM/Renderer/ShaderEngine.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ GLuint ShaderEngine::compilePresetShader(const PresentShaderType shaderType, Sha
678678
if (!parser.ApplyPreprocessor(shaderFilename.c_str(), fullSource.c_str(), fullSource.size(), sourcePreprocessed)) {
679679
std::cerr << "Failed to preprocess HLSL(step1) " << shaderTypeString << " shader" << std::endl;
680680

681-
#ifndef DUMP_SHADERS_ON_ERROR
681+
#if !DUMP_SHADERS_ON_ERROR
682682
std::cerr << "Source: " << std::endl << fullSource << std::endl;
683683
#else
684684
std::ofstream out("/tmp/shader_" + shaderTypeString + "_step1.txt");
@@ -730,7 +730,7 @@ GLuint ShaderEngine::compilePresetShader(const PresentShaderType shaderType, Sha
730730
if( !parser.Parse(shaderFilename.c_str(), sourcePreprocessed.c_str(), sourcePreprocessed.size()) ) {
731731
std::cerr << "Failed to parse HLSL(step2) " << shaderTypeString << " shader" << std::endl;
732732

733-
#ifndef DUMP_SHADERS_ON_ERROR
733+
#if !DUMP_SHADERS_ON_ERROR
734734
std::cerr << "Source: " << std::endl << sourcePreprocessed << std::endl;
735735
#else
736736
std::ofstream out2("/tmp/shader_" + shaderTypeString + "_step2.txt");
@@ -743,7 +743,7 @@ GLuint ShaderEngine::compilePresetShader(const PresentShaderType shaderType, Sha
743743
// generate GLSL
744744
if (!generator.Generate(&tree, M4::GLSLGenerator::Target_FragmentShader, M4::GLSLGenerator::Version_140, "PS")) {
745745
std::cerr << "Failed to transpile HLSL(step3) " << shaderTypeString << " shader to GLSL" << std::endl;
746-
#ifndef DUMP_SHADERS_ON_ERROR
746+
#if !DUMP_SHADERS_ON_ERROR
747747
std::cerr << "Source: " << std::endl << sourcePreprocessed << std::endl;
748748
#else
749749
std::ofstream out2("/tmp/shader_" + shaderTypeString + "_step2.txt");
@@ -767,7 +767,7 @@ GLuint ShaderEngine::compilePresetShader(const PresentShaderType shaderType, Sha
767767
} else {
768768
std::cerr << "Compilation error (step3) of " << shaderTypeString << std::endl;
769769

770-
#ifndef DUMP_SHADERS_ON_ERROR
770+
#if !DUMP_SHADERS_ON_ERROR
771771
std::cerr << "Source:" << std::endl << generator.GetResult() << std::endl;
772772
#else
773773
std::ofstream out3("/tmp/shader_" + shaderTypeString + "_step3.txt");

src/libprojectM/projectM-opengl.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
#define GL_TRANSITION
1010

1111
// Enable openGL extra checks, better not be enabled in release build
12-
#define OGL_DEBUG 0
12+
#define OGL_DEBUG 0
1313

14+
// Unlock FPS for rendering benchmarks, it disables Vblank/Vsync and prints drawned frames count within a 5s test run
15+
#define UNLOCK_FPS 0
1416

15-
#define DUMP_SHADERS_ON_ERROR
17+
// If a shader compilation failure occurs, it dumps shader source into /tmp instead of stderr
18+
#define DUMP_SHADERS_ON_ERROR 0
1619

1720
#ifdef __APPLE__
1821
# include <OpenGL/gl3.h>

src/libprojectM/projectM.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ static void *thread_callback(void *prjm) {
449449
this->fpsstart=getTicks ( &timeKeeper->startTime );
450450
}
451451

452+
#ifndef UNLOCK_FPS
452453
int timediff = getTicks ( &timeKeeper->startTime )-this->timestart;
453454

454455
if ( timediff < this->mspf )
@@ -461,6 +462,8 @@ static void *thread_callback(void *prjm) {
461462
if ( usleep ( sleepTime ) != 0 ) {}}
462463
}
463464
this->timestart=getTicks ( &timeKeeper->startTime );
465+
#endif
466+
464467
#endif /** !WIN32 */
465468

466469
#ifdef SYNC_PRESET_SWITCHES

src/projectM-sdl/projectM_SDL_main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include "pmSDL.hpp"
1010

11-
#define UNLOCK_FPS 0
1211
#define FAKE_AUDIO 0
1312
#define TEST_ALL_PRESETS 0
1413

0 commit comments

Comments
 (0)