Skip to content

Commit c80e919

Browse files
committed
Fixed spaces at beginning of uniform declarations.
Signed-off-by: Michael Horsch <[email protected]>
1 parent d30fcb7 commit c80e919

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

src/OpenColorIO/GpuShaderUtils.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -921,17 +921,17 @@ std::string GpuShaderText::sampleTex3D(const std::string& textureName,
921921

922922
void GpuShaderText::declareUniformFloat(const std::string & uniformName)
923923
{
924-
std::string uniformDeclString("uniform");
924+
std::string uniformDeclString("uniform ");
925925
if (m_lang == GPU_LANGUAGE_MSL_2_0 || m_lang == GPU_LANGUAGE_GLSL_VK_4_6)
926926
{
927927
uniformDeclString = "";
928928
}
929-
newLine() << uniformDeclString << " " << floatKeyword() << " " << uniformName << ";";
929+
newLine() << uniformDeclString << floatKeyword() << " " << uniformName << ";";
930930
}
931931

932932
void GpuShaderText::declareUniformBool(const std::string & uniformName)
933933
{
934-
std::string uniformDeclString("uniform");
934+
std::string uniformDeclString("uniform ");
935935
std::string boolKeyword("bool");
936936
if (m_lang == GPU_LANGUAGE_MSL_2_0)
937937
{
@@ -942,37 +942,37 @@ void GpuShaderText::declareUniformBool(const std::string & uniformName)
942942
uniformDeclString = "";
943943
boolKeyword = "int";
944944
}
945-
newLine() << uniformDeclString << " " << boolKeyword << " " << uniformName << ";";
945+
newLine() << uniformDeclString << boolKeyword << " " << uniformName << ";";
946946
}
947947

948948
void GpuShaderText::declareUniformFloat3(const std::string & uniformName)
949949
{
950-
std::string uniformDeclString("uniform");
950+
std::string uniformDeclString("uniform ");
951951
if (m_lang == GPU_LANGUAGE_MSL_2_0 || m_lang == GPU_LANGUAGE_GLSL_VK_4_6)
952952
{
953953
uniformDeclString = "";
954954
}
955-
newLine() << uniformDeclString << " " << float3Keyword() << " " << uniformName << ";";
955+
newLine() << uniformDeclString << float3Keyword() << " " << uniformName << ";";
956956
}
957957

958958
void GpuShaderText::declareUniformArrayFloat(const std::string & uniformName, unsigned int size)
959959
{
960-
std::string uniformDeclString("uniform");
960+
std::string uniformDeclString("uniform ");
961961
if (m_lang == GPU_LANGUAGE_MSL_2_0 || m_lang == GPU_LANGUAGE_GLSL_VK_4_6)
962962
{
963963
uniformDeclString = "";
964964
}
965-
newLine() << uniformDeclString << " " << floatKeyword() << " " << uniformName << "[" << size << "];";
965+
newLine() << uniformDeclString << floatKeyword() << " " << uniformName << "[" << size << "];";
966966
}
967967

968968
void GpuShaderText::declareUniformArrayInt(const std::string & uniformName, unsigned int size)
969969
{
970-
std::string uniformDeclString("uniform");
970+
std::string uniformDeclString("uniform ");
971971
if (m_lang == GPU_LANGUAGE_MSL_2_0 || m_lang == GPU_LANGUAGE_GLSL_VK_4_6)
972972
{
973973
uniformDeclString = "";
974974
}
975-
newLine() << uniformDeclString << " " << intKeyword() << " " << uniformName << "[" << size << "];";
975+
newLine() << uniformDeclString << intKeyword() << " " << uniformName << "[" << size << "];";
976976
}
977977

978978
// Keep the method private as only float & double types are expected

tests/cpu/GpuShader_tests.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,8 @@ ocioOCIOMain(
976976
977977
// Declaration of all variables
978978
979-
float ocio_exposure_contrast_exposureVal;
980-
float ocio_exposure_contrast_gammaVal;
979+
float ocio_exposure_contrast_exposureVal;
980+
float ocio_exposure_contrast_gammaVal;
981981
982982
983983
// Declaration of the OCIO shader function
@@ -1243,11 +1243,11 @@ ocioOCIOMain(
12431243
12441244
// Declaration of all variables
12451245
1246-
int ocio_grading_rgbcurve_knotsOffsets[8];
1247-
float ocio_grading_rgbcurve_knots[60];
1248-
int ocio_grading_rgbcurve_coefsOffsets[8];
1249-
float ocio_grading_rgbcurve_coefs[180];
1250-
bool ocio_grading_rgbcurve_localBypass;
1246+
int ocio_grading_rgbcurve_knotsOffsets[8];
1247+
float ocio_grading_rgbcurve_knots[60];
1248+
int ocio_grading_rgbcurve_coefsOffsets[8];
1249+
float ocio_grading_rgbcurve_coefs[180];
1250+
bool ocio_grading_rgbcurve_localBypass;
12511251
12521252
12531253
// Declaration of all helper methods

0 commit comments

Comments
 (0)