Skip to content

Commit 357deb0

Browse files
committed
App changes:
*small CPU optimizations in the form of a lookup table for shader inputs, similar to the one used for textures *modified a 'for' loop in DeferredLightDir shader in order to avoid using 'break' (it might prevent the compiler from unrolling the loop) *modified Python scripts to reflect changes to LibRenderer tools' executable paths LibRenderer changes: *merged TextureCompiler and ModelCompiler solution files into LibRendererTools.sln
1 parent 124f264 commit 357deb0

File tree

7 files changed

+237
-155
lines changed

7 files changed

+237
-155
lines changed

GITechDemo/Code/AppMain/GITechDemo/GITechDemo.cpp

Lines changed: 204 additions & 88 deletions
Large diffs are not rendered by default.

GITechDemo/Code/Solutions/TextureCompiler.sln renamed to GITechDemo/Code/Solutions/LibRendererTools.sln

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
44
VisualStudioVersion = 14.0.22512.0
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TextureCompiler", "..\Tools\TextureCompiler.vcxproj", "{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}"
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ModelCompiler", "..\Tools\ModelCompiler.vcxproj", "{E0EAEA76-90F3-4D19-B1C7-DA8148DEA215}"
77
EndProject
88
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibRenderer", "..\Libraries\LibRenderer\LibRenderer.vcxproj", "{42B90F7F-E5D8-4B7F-BE74-CAC4DA86C76F}"
99
EndProject
10+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TextureCompiler", "..\Tools\TextureCompiler.vcxproj", "{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}"
11+
EndProject
1012
Global
1113
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1214
Debug|x64 = Debug|x64
@@ -17,18 +19,18 @@ Global
1719
Release|x86 = Release|x86
1820
EndGlobalSection
1921
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20-
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Debug|x64.ActiveCfg = Debug|x64
21-
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Debug|x64.Build.0 = Debug|x64
22-
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Debug|x86.ActiveCfg = Debug|Win32
23-
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Debug|x86.Build.0 = Debug|Win32
24-
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Profile|x64.ActiveCfg = Release|x64
25-
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Profile|x64.Build.0 = Release|x64
26-
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Profile|x86.ActiveCfg = Release|Win32
27-
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Profile|x86.Build.0 = Release|Win32
28-
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Release|x64.ActiveCfg = Release|x64
29-
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Release|x64.Build.0 = Release|x64
30-
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Release|x86.ActiveCfg = Release|Win32
31-
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Release|x86.Build.0 = Release|Win32
22+
{E0EAEA76-90F3-4D19-B1C7-DA8148DEA215}.Debug|x64.ActiveCfg = Debug|x64
23+
{E0EAEA76-90F3-4D19-B1C7-DA8148DEA215}.Debug|x64.Build.0 = Debug|x64
24+
{E0EAEA76-90F3-4D19-B1C7-DA8148DEA215}.Debug|x86.ActiveCfg = Debug|Win32
25+
{E0EAEA76-90F3-4D19-B1C7-DA8148DEA215}.Debug|x86.Build.0 = Debug|Win32
26+
{E0EAEA76-90F3-4D19-B1C7-DA8148DEA215}.Profile|x64.ActiveCfg = Release|x64
27+
{E0EAEA76-90F3-4D19-B1C7-DA8148DEA215}.Profile|x64.Build.0 = Release|x64
28+
{E0EAEA76-90F3-4D19-B1C7-DA8148DEA215}.Profile|x86.ActiveCfg = Release|Win32
29+
{E0EAEA76-90F3-4D19-B1C7-DA8148DEA215}.Profile|x86.Build.0 = Release|Win32
30+
{E0EAEA76-90F3-4D19-B1C7-DA8148DEA215}.Release|x64.ActiveCfg = Release|x64
31+
{E0EAEA76-90F3-4D19-B1C7-DA8148DEA215}.Release|x64.Build.0 = Release|x64
32+
{E0EAEA76-90F3-4D19-B1C7-DA8148DEA215}.Release|x86.ActiveCfg = Release|Win32
33+
{E0EAEA76-90F3-4D19-B1C7-DA8148DEA215}.Release|x86.Build.0 = Release|Win32
3234
{42B90F7F-E5D8-4B7F-BE74-CAC4DA86C76F}.Debug|x64.ActiveCfg = Debug|x64
3335
{42B90F7F-E5D8-4B7F-BE74-CAC4DA86C76F}.Debug|x64.Build.0 = Debug|x64
3436
{42B90F7F-E5D8-4B7F-BE74-CAC4DA86C76F}.Debug|x86.ActiveCfg = Debug|Win32
@@ -41,6 +43,18 @@ Global
4143
{42B90F7F-E5D8-4B7F-BE74-CAC4DA86C76F}.Release|x64.Build.0 = Release|x64
4244
{42B90F7F-E5D8-4B7F-BE74-CAC4DA86C76F}.Release|x86.ActiveCfg = Release|Win32
4345
{42B90F7F-E5D8-4B7F-BE74-CAC4DA86C76F}.Release|x86.Build.0 = Release|Win32
46+
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Debug|x64.ActiveCfg = Debug|x64
47+
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Debug|x64.Build.0 = Debug|x64
48+
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Debug|x86.ActiveCfg = Debug|Win32
49+
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Debug|x86.Build.0 = Debug|Win32
50+
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Profile|x64.ActiveCfg = Release|x64
51+
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Profile|x64.Build.0 = Release|x64
52+
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Profile|x86.ActiveCfg = Release|Win32
53+
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Profile|x86.Build.0 = Release|Win32
54+
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Release|x64.ActiveCfg = Release|x64
55+
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Release|x64.Build.0 = Release|x64
56+
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Release|x86.ActiveCfg = Release|Win32
57+
{DF734DC0-15BC-4CFF-B55E-D76D0ABC8B86}.Release|x86.Build.0 = Release|Win32
4458
EndGlobalSection
4559
GlobalSection(SolutionProperties) = preSolution
4660
HideSolutionNode = FALSE

GITechDemo/Code/Solutions/ModelCompiler.sln

Lines changed: 0 additions & 48 deletions
This file was deleted.

GITechDemo/Code/Tools/TextureCompiler/TextureCompiler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,14 +575,14 @@ void TextureCompiler::Run(int argc, char* argv[])
575575
iluGetImageInfo(&faceInfo);
576576

577577
assert(ilGetInteger(IL_IMAGE_CUBEFLAGS) == IL_CUBEMAP_POSITIVEX * powf(2.f, (float)face));
578-
assert(faceInfo.SizeOfData == texDst->GetMipByteCount());
578+
assert(faceInfo.SizeOfData == texDst->GetMipSizeBytes());
579579

580580
memcpy(texDst->GetMipData(face, 0), faceInfo.Data, texDst->GetMipSizeBytes(0));
581581
}
582582
}
583583
else
584584
{
585-
assert(info.SizeOfData == texDst->GetMipByteCount());
585+
assert(info.SizeOfData == texDst->GetMipSizeBytes());
586586
memcpy(texDst->GetMipData(), info.Data, texDst->GetMipSizeBytes());
587587
}
588588
}

GITechDemo/Data/shaders/DeferredLightDir.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void psmain(VSOut input, out PSOut output)
8989
bool bValidCascade[MAX_NUM_CASCADES];
9090
bool bValidCascadeTexCoord = false;
9191
int nValidCascade = 0;
92-
for(int cascade = 0; cascade < nCascadeCount; cascade++)
92+
for(int cascade = nCascadeCount - 1; cascade >= 0; cascade--)
9393
{
9494
// iterate through all AABBs and check if the point
9595
// is inside of one of them
@@ -99,7 +99,7 @@ void psmain(VSOut input, out PSOut output)
9999
f4LightViewPos.y < f2CascadeBoundsMax[cascade].y)
100100
{
101101
nValidCascade = cascade;
102-
break;
102+
//break;
103103
}
104104
}
105105

GITechDemo/DataSrc/compile_sponza_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
pathToModelFile = "crytek-sponza/"
77
modelFile = "sponza.obj"
88
outputPath = "../Data/models/sponza/"
9-
modelCompilerExe = "../Bin/x64/Release/ModelCompiler/ModelCompiler.exe"
9+
modelCompilerExe = "../Bin/x64/Release/LibRendererTools/ModelCompiler.exe"
1010

1111
start = time.clock()
1212

GITechDemo/DataSrc/compile_sponza_textures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#pathToTextureFiles = "sponza_scene/textures/"
66
pathToTextureFiles = "crytek-sponza/textures/"
77
outputPath = "../Data/models/sponza/textures/"
8-
textureCompilerExe = "../Bin/x64/Release/TextureCompiler/TextureCompiler.exe"
8+
textureCompilerExe = "../Bin/x64/Release/LibRendererTools/TextureCompiler.exe"
99

1010
start = time.clock()
1111

0 commit comments

Comments
 (0)