more tooling

This commit is contained in:
Asuro
2025-02-28 02:21:41 +01:00
parent ceb4f69efc
commit 136a0e09a9
10 changed files with 79 additions and 45 deletions

View File

@@ -136,7 +136,6 @@ namespace Game
const bgfx::Memory* mem =
bgfx::makeRef(data->data + imageContainer.m_offset, data->size - imageContainer.m_offset);
// const bgfx::Memory* mem = bgfx::makeRef(imageContainer.m_data, imageContainer.m_size);
if (NULL != _info)
{
@@ -356,13 +355,13 @@ namespace Game
{
Log("BGFX setup succeded!");
}
bgfx::setDebug(BGFX_DEBUG_TEXT);
// bgfx::setDebug(BGFX_DEBUG_TEXT);
bgfx::setViewClear(MainViewID, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH, 0x3399FFff, 1.0f, 0);
bgfx::setViewRect(MainViewID, 0, 0, shared.Window.WindowWidth, shared.Window.WindowHeight);
DefaultSampler = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler);
Textures[0].Handle =
loadTexture(bx::FilePath{"models/body.dds"}, BGFX_TEXTURE_NONE | BGFX_SAMPLER_NONE, 0, nullptr, nullptr);
Textures[0].Handle = loadTexture(
bx::FilePath{"models/body.dds"}, BGFX_TEXTURE_NONE | BGFX_SAMPLER_NONE, 0, &Textures[0].Info, nullptr);
Textures[0].SamplerHandle = DefaultSampler;
LoadModels(Models, ModelCount);
@@ -499,8 +498,10 @@ namespace Game
}
if (isValid(DitherTextures.RampTex))
{
ImGui::Image(DitherTextures.RampTex.idx, {BX_COUNTOF(DitherTextures.BrightnessRamp), 1});
ImGui::Image(DitherTextures.RampTex.idx, {BX_COUNTOF(DitherTextures.BrightnessRamp), 8});
}
ImGui::Text("Shader log:");
ImGui::TextWrapped("%s", GetShared().Dev.ShaderLog);
}
ImGui::End();
}
@@ -508,12 +509,12 @@ namespace Game
GetInstance().GameLevel.Update();
GetInstance().GameLevel.Render(MainViewID, Models, Materials);
bgfx::dbgTextPrintf(1, 1, 0x0F, "Time: %.1fs", GetInstance().Time.Now);
for (int32_t i = 0; i < (int32_t)PerfCounterType::COUNT; ++i)
{
bgfx::dbgTextPrintf(
1, 2 + i, 0x0F, "%s Max: %.3fs", PerfCounterNames[i], shared.Window.PerfCounters[i].GetMax());
}
// bgfx::dbgTextPrintf(1, 1, 0x0F, "Time: %.1fs", GetInstance().Time.Now);
// for (int32_t i = 0; i < (int32_t)PerfCounterType::COUNT; ++i)
// {
// bgfx::dbgTextPrintf(
// 1, 2 + i, 0x0F, "%s Max: %.3fs", PerfCounterNames[i], shared.Window.PerfCounters[i].GetMax());
// }
// Finish Frame
imguiEndFrame();
@@ -556,6 +557,7 @@ namespace Game
BGFX_STATE_CULL_CCW | BGFX_STATE_MSAA;
mat.Uniforms[Material::UTime] = bgfx::createUniform("u_time", bgfx::UniformType::Vec4);
mat.Uniforms[Material::UDotColor] = bgfx::createUniform("u_testColor", bgfx::UniformType::Vec4);
mat.Uniforms[Material::UTexInfo] = bgfx::createUniform("u_texInfo", bgfx::UniformType::Vec4);
mat.Textures[0].Handle = tex;
mat.Textures[0].SamplerHandle = sampler;
mat.ViewID = view;