Remove linked shaderc support in demos - no longer supported

* shaderc doesn't build with VS2015 so can't be linked in.
This commit is contained in:
baldurk committed 2026-10-23 23:13:17 +01:00
1 parent e61e44e1f6
commit 948df720ad
7 files changed
+9 -165

No files matched your search

-27
View File
@@ -104,30 +104,6 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<PropertyGroup Condition="$(Platform)=='x64' and exists('3rdparty/shaderc/x64/lib/shaderc_combined.lib') and $(PlatformToolset)=='v143'">
<HaveShaderc>1</HaveShaderc>
</PropertyGroup>
<PropertyGroup Condition="$(Platform)=='x86' and exists('3rdparty/shaderc/x86/lib/shaderc_combined.lib') and $(PlatformToolset)=='v143'">
<HaveShaderc>1</HaveShaderc>
</PropertyGroup>
<ItemDefinitionGroup Condition="$(Platform)=='x64' and $(HaveShaderc)=='1'">
<ClCompile>
<AdditionalIncludeDirectories>3rdparty/shaderc/x64/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>HAVE_SHADERC=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies>3rdparty/shaderc/x64/lib/shaderc_combined.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="$(Platform)=='x86' and $(HaveShaderc)=='1'">
<ClCompile>
<AdditionalIncludeDirectories>3rdparty/shaderc/x86/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>HAVE_SHADERC=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies>3rdparty/shaderc/x86/lib/shaderc_combined.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="3rdparty\fmt\format.cc" />
<ClCompile Include="3rdparty\md5\md5.c" />
@@ -465,7 +441,6 @@
<ClInclude Include="3rdparty\nuklear\nuklear.h" />
<ClInclude Include="3rdparty\nuklear\nuklear_gdi.h" />
<ClInclude Include="3rdparty\nuklear\nuklear_xlib.h" />
<ClInclude Include="3rdparty\shaderc\shaderc.h" />
<ClInclude Include="renderdoc_app.h" />
<ClInclude Include="test_common.h" />
<ClInclude Include="vk\vk_headers.h" />
@@ -554,8 +529,6 @@ namespace DXCEnumerateAndCheck {
<Output TaskParameter="DebugOut" PropertyName="DebugOutDXC" />
</GetDXCDLL>
<Message Condition="$(DXCDLLFolder.Length) &gt; 0" Importance="high" Text="Using DXC/D3DCompiler dlls from $(DXCDLLFolder)." />
<Message Condition="$(HaveShaderc)=='1'" Importance="high" Text="Built with linked shaderc." />
<Message Condition="$(HaveShaderc)!='1'" Importance="high" Text="Not built with linked shaderc." />
<PropertyGroup Condition="$(DXCDLLFolder.Length) &gt; 0">
<DXCDLLSourceLocation>$(DXCDLLFolder)</DXCDLLSourceLocation>
</PropertyGroup>
-6
View File
@@ -816,9 +816,6 @@
<Filter Include="3rdparty\nuklear">
<UniqueIdentifier>{06e64450-43b4-42d5-bbf3-290c721ae555}</UniqueIdentifier>
</Filter>
<Filter Include="3rdparty\shaderc">
<UniqueIdentifier>{e641fa6b-a639-49af-9bc3-387b87bdb066}</UniqueIdentifier>
</Filter>
<Filter Include="3rdparty\glad">
<UniqueIdentifier>{526cfb18-bd0f-41b7-ac73-30a2fc90f449}</UniqueIdentifier>
</Filter>
@@ -972,9 +969,6 @@
<ClInclude Include="3rdparty\nuklear\nuklear_xlib.h">
<Filter>3rdparty\nuklear</Filter>
</ClInclude>
<ClInclude Include="3rdparty\shaderc\shaderc.h">
<Filter>3rdparty\shaderc</Filter>
</ClInclude>
<ClInclude Include="3rdparty\glad\khrplatform.h">
<Filter>3rdparty\glad</Filter>
</ClInclude>
+3 -3
View File
@@ -289,9 +289,9 @@ void main()
return;
if(!SpvCompilationSupported())
Avail = InternalSpvCompiler() ? "Internal SPIR-V compiler did not initialise"
: "Couldn't find 'glslc' or 'glslangValidator' in PATH - "
"required for SPIR-V compilation";
Avail =
"Couldn't find 'glslc' or 'glslangValidator' in PATH - "
"required for SPIR-V compilation";
}
int main()
+3 -3
View File
@@ -79,9 +79,9 @@ void main()
return;
if(!SpvCompilationSupported())
Avail = InternalSpvCompiler() ? "Internal SPIR-V compiler did not initialise"
: "Couldn't find 'glslc' or 'glslangValidator' in PATH - "
"required for SPIR-V compilation";
Avail =
"Couldn't find 'glslc' or 'glslangValidator' in PATH - "
"required for SPIR-V compilation";
}
int main()
-122
View File
@@ -252,44 +252,10 @@ void LoadXPM(const char **XPM, Texture &tex)
}
}
#ifndef HAVE_SHADERC
#define HAVE_SHADERC 0
#endif
// this define toggles on/off using the linked shaderc. This can be useful for quick testing without
// having to remove the built shaderc files
#define USE_LINKED_SHADERC (1 && HAVE_SHADERC)
#if !USE_LINKED_SHADERC && defined(ANDROID)
#error "can't execute shaderc on android"
#endif
#if USE_LINKED_SHADERC
#include <shaderc/shaderc.h>
#else
typedef void *shaderc_compiler_t;
#endif
static shaderc_compiler_t shaderc = NULL;
static std::string externalCompiler;
bool InternalSpvCompiler()
{
return bool(USE_LINKED_SHADERC);
}
bool SpvCompilationSupported()
{
if(shaderc)
return true;
#if USE_LINKED_SHADERC
shaderc = shaderc_compiler_initialize();
#endif
if(shaderc)
return true;
for(std::string compiler : {"glslc", "glslangValidator"})
{
FILE *pipe = popen((compiler + EXECUTABLE_SUFFIX " --version 2>&1").c_str(), "r");
@@ -322,90 +288,6 @@ std::vector<uint32_t> CompileShaderToSpv(const char *demo_name, const std::strin
{
std::vector<uint32_t> ret;
if(shaderc)
{
#if USE_LINKED_SHADERC
static bool logged = false;
if(!logged)
{
logged = true;
TEST_LOG("Compiling using built-in shaderc");
}
shaderc_compile_options_t opts = shaderc_compile_options_initialize();
if(lang == ShaderLang::glsl)
shaderc_compile_options_set_source_language(opts, shaderc_source_language_glsl);
else if(lang == ShaderLang::hlsl)
shaderc_compile_options_set_source_language(opts, shaderc_source_language_hlsl);
shaderc_compile_options_set_generate_debug_info(opts);
shaderc_compile_options_set_optimization_level(opts, shaderc_optimization_level_zero);
shaderc_shader_kind shader_kind = shaderc_glsl_vertex_shader;
switch(stage)
{
case ShaderStage::vert: shader_kind = shaderc_vertex_shader; break;
case ShaderStage::frag: shader_kind = shaderc_fragment_shader; break;
case ShaderStage::tesscontrol: shader_kind = shaderc_tess_control_shader; break;
case ShaderStage::tesseval: shader_kind = shaderc_tess_evaluation_shader; break;
case ShaderStage::geom: shader_kind = shaderc_geometry_shader; break;
case ShaderStage::comp: shader_kind = shaderc_compute_shader; break;
case ShaderStage::mesh: shader_kind = shaderc_mesh_shader; break;
case ShaderStage::task: shader_kind = shaderc_task_shader; break;
}
if(target == SPIRVTarget::opengl)
shaderc_compile_options_set_target_env(opts, shaderc_target_env_opengl, 0);
else if(target == SPIRVTarget::vulkan11)
shaderc_compile_options_set_target_env(opts, shaderc_target_env_vulkan,
shaderc_env_version_vulkan_1_1);
else if(target == SPIRVTarget::vulkan12)
shaderc_compile_options_set_target_env(opts, shaderc_target_env_vulkan,
shaderc_env_version_vulkan_1_2);
for(auto it : macros)
shaderc_compile_options_add_macro_definition(opts, it.first.c_str(), it.first.length(),
it.second.c_str(), it.second.length());
shaderc_compilation_result_t res;
if(lang == ShaderLang::spvasm)
res = shaderc_assemble_into_spv(shaderc, source_text.c_str(), source_text.size(), opts);
else
res = shaderc_compile_into_spv(shaderc, source_text.c_str(), source_text.size(), shader_kind,
"inshader", entry_point, opts);
shaderc_compilation_status status = shaderc_result_get_compilation_status(res);
if(status != shaderc_compilation_status_success)
{
TEST_ERROR("Couldn't compile shader with built-in shaderc: %s",
shaderc_result_get_error_message(res));
if(res)
shaderc_result_release(res);
return ret;
}
size_t sz = shaderc_result_get_length(res);
TEST_ASSERT((sz % 4) == 0, "shaderc result isn't 4-byte aligned");
ret.resize(sz / 4);
memcpy(&ret[0], shaderc_result_get_bytes(res), sz);
shaderc_result_release(res);
shaderc_compile_options_release(opts);
return ret;
#endif
}
std::string command_line;
std::string path = GetExecutableName();
@@ -567,11 +449,7 @@ void GraphicsTest::Prepare(int argc, char **argv)
if(prepared)
return;
#if USE_LINKED_SHADERC
TEST_LOG("Using linked shaderc");
#else
TEST_LOG("Requires glslc/shaderc for Vulkan tests");
#endif
prepared = true;
-1
View File
@@ -83,7 +83,6 @@ enum class ShaderStage
task,
};
bool InternalSpvCompiler();
bool SpvCompilationSupported();
std::vector<uint32_t> CompileShaderToSpv(const char *demo_name, const std::string &source_text,
SPIRVTarget target, ShaderLang lang, ShaderStage stage,
+3 -3
View File
@@ -406,9 +406,9 @@ void VulkanGraphicsTest::Prepare(int argc, char **argv)
if(!volk)
Avail = "volk did not initialise - vulkan library is not available";
else if(!spv)
Avail = InternalSpvCompiler() ? "Internal SPIR-V compiler did not initialise"
: "Couldn't find 'glslc' or 'glslangValidator' in PATH - "
"required for SPIR-V compilation";
Avail =
"Couldn't find 'glslc' or 'glslangValidator' in PATH - "
"required for SPIR-V compilation";
else if(instance == VK_NULL_HANDLE)
Avail = "Vulkan instance did not initialise";
else if(phys == VK_NULL_HANDLE)