#include "AssetDumperVertexShader.h" #include using namespace IW4; bool AssetDumperVertexShader::ShouldDump(XAssetInfo* asset) { return true; } void AssetDumperVertexShader::DumpAsset(AssetDumpingContext& context, XAssetInfo* asset) { const auto* vertexShader = asset->Asset(); std::ostringstream ss; ss << "shader_bin/vs_" << vertexShader->name << ".cso"; const auto shaderFile = context.OpenAssetFile(ss.str()); if (!shaderFile) return; shaderFile->write(reinterpret_cast(vertexShader->prog.loadDef.program), static_cast(vertexShader->prog.loadDef.programSize) * 4u); }