mirror of
https://github.com/AxioDL/boo.git
synced 2025-12-16 16:37:20 +00:00
Massive fmtlib refactor
This commit is contained in:
@@ -184,7 +184,7 @@ class D3D11TextureS : public GraphicsDataNode<ITextureS> {
|
||||
pxTilePitch = 4;
|
||||
break;
|
||||
default:
|
||||
Log.report(logvisor::Fatal, "unsupported tex format");
|
||||
Log.report(logvisor::Fatal, fmt("unsupported tex format"));
|
||||
}
|
||||
|
||||
CD3D11_TEXTURE2D_DESC desc(pfmt, width, height, 1, mips, D3D11_BIND_SHADER_RESOURCE, D3D11_USAGE_IMMUTABLE);
|
||||
@@ -237,7 +237,7 @@ class D3D11TextureSA : public GraphicsDataNode<ITextureSA> {
|
||||
pixelFmt = DXGI_FORMAT_R16_UNORM;
|
||||
break;
|
||||
default:
|
||||
Log.report(logvisor::Fatal, "unsupported tex format");
|
||||
Log.report(logvisor::Fatal, fmt("unsupported tex format"));
|
||||
}
|
||||
|
||||
CD3D11_TEXTURE2D_DESC desc(pixelFmt, width, height, layers, mips, D3D11_BIND_SHADER_RESOURCE,
|
||||
@@ -299,7 +299,7 @@ class D3D11TextureD : public GraphicsDataNode<ITextureD> {
|
||||
m_pxPitch = 2;
|
||||
break;
|
||||
default:
|
||||
Log.report(logvisor::Fatal, "unsupported tex format");
|
||||
Log.report(logvisor::Fatal, fmt("unsupported tex format"));
|
||||
}
|
||||
|
||||
m_cpuSz = width * height * m_pxPitch;
|
||||
@@ -388,9 +388,9 @@ class D3D11TextureR : public GraphicsDataNode<ITextureR> {
|
||||
, m_colorBindCount(colorBindCount)
|
||||
, m_depthBindCount(depthBindCount) {
|
||||
if (colorBindCount > MAX_BIND_TEXS)
|
||||
Log.report(logvisor::Fatal, "too many color bindings for render texture");
|
||||
Log.report(logvisor::Fatal, fmt("too many color bindings for render texture"));
|
||||
if (depthBindCount > MAX_BIND_TEXS)
|
||||
Log.report(logvisor::Fatal, "too many depth bindings for render texture");
|
||||
Log.report(logvisor::Fatal, fmt("too many depth bindings for render texture"));
|
||||
|
||||
if (samples == 0)
|
||||
m_samples = 1;
|
||||
@@ -776,7 +776,7 @@ struct D3D11ShaderDataBinding : public GraphicsDataNode<IShaderDataBinding> {
|
||||
for (size_t i = 0; i < ubufCount; ++i) {
|
||||
#ifndef NDEBUG
|
||||
if (ubufOffs[i] % 256)
|
||||
Log.report(logvisor::Fatal, "non-256-byte-aligned uniform-offset %d provided to newShaderDataBinding",
|
||||
Log.report(logvisor::Fatal, fmt("non-256-byte-aligned uniform-offset %d provided to newShaderDataBinding"),
|
||||
int(i));
|
||||
#endif
|
||||
m_ubufFirstConsts[i] = ubufOffs[i] / 16;
|
||||
@@ -786,7 +786,7 @@ struct D3D11ShaderDataBinding : public GraphicsDataNode<IShaderDataBinding> {
|
||||
for (size_t i = 0; i < ubufCount; ++i) {
|
||||
#ifndef NDEBUG
|
||||
if (!ubufs[i])
|
||||
Log.report(logvisor::Fatal, "null uniform-buffer %d provided to newShaderDataBinding", int(i));
|
||||
Log.report(logvisor::Fatal, fmt("null uniform-buffer %d provided to newShaderDataBinding"), int(i));
|
||||
#endif
|
||||
m_ubufs.push_back(ubufs[i]);
|
||||
}
|
||||
@@ -1507,7 +1507,7 @@ void D3D11CommandQueue::RenderingWorker(D3D11CommandQueue* self) {
|
||||
if (D3D11TextureR* csource = CmdList.workDoPresent.cast<D3D11TextureR>()) {
|
||||
#ifndef NDEBUG
|
||||
if (!csource->m_colorBindCount)
|
||||
Log.report(logvisor::Fatal, "texture provided to resolveDisplay() must have at least 1 color binding");
|
||||
Log.report(logvisor::Fatal, fmt("texture provided to resolveDisplay() must have at least 1 color binding"));
|
||||
#endif
|
||||
|
||||
if (dataFactory->m_gamma != 1.f) {
|
||||
@@ -1621,8 +1621,8 @@ std::vector<uint8_t> D3D11DataFactory::CompileHLSL(const char* source, PipelineS
|
||||
ComPtr<ID3DBlob> blobOut;
|
||||
if (FAILED(D3DCompilePROC(source, strlen(source), "Boo HLSL Source", nullptr, nullptr, "main",
|
||||
D3DShaderTypes[int(stage)], BOO_D3DCOMPILE_FLAG, 0, &blobOut, &errBlob))) {
|
||||
printf("%s\n", source);
|
||||
Log.report(logvisor::Fatal, "error compiling shader: %s", errBlob->GetBufferPointer());
|
||||
fmt::print(fmt("{}\n"), source);
|
||||
Log.report(logvisor::Fatal, fmt("error compiling shader: %s"), errBlob->GetBufferPointer());
|
||||
return {};
|
||||
}
|
||||
std::vector<uint8_t> ret(blobOut->GetBufferSize());
|
||||
|
||||
Reference in New Issue
Block a user