Skip to content

Low spec gpu#232

Merged
gameknife merged 28 commits into
devfrom
low-spec-gpu
May 17, 2026
Merged

Low spec gpu#232
gameknife merged 28 commits into
devfrom
low-spec-gpu

Conversation

@gameknife
Copy link
Copy Markdown
Owner

No description provided.

gameknife and others added 26 commits May 13, 2026 07:48
Hit FX Tweaks
UI Tweaks
- AGENTS.md 重写 Spec Workflow 节,定义新的目录布局、状态字符、
  AGENT 边界与暂停条件;旧根目录 TODO.md 迁至 .spec/ARCHIVE.md
- 新增 .spec/{README,TODO,ARCHIVE}.md,配套 specs/ journal/
  blockers/ 子目录约定,详见 .spec/README.md
- 新增 tools/gnb/internal/spec 包:TODO.md 的 parse/format/round-trip、
  ID 分配、journal/blocker stub 写入、按月分桶的归档逻辑,10 个单测
- 新增 gnb todo 子命令族(list/show/next/add/done/block/archive),
  add 在缺参或参数无效时直接打 help、不报错
- 新增 gnb dashboard 子命令:单机 web UI(http://127.0.0.1:7777),
  embed.FS 内嵌模板,htmx 局部刷新,支持查看 + 添加 + 标完成/卡住
- 修 gnb.bat 两个 bug:缺 setlocal enabledelayedexpansion 导致
  rebuild 永不触发;%ROOT% 末尾反斜杠让 git -C 路径被吃掉了引号

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
由 .spec 工作流首批任务 #1 / #2 跑出来的产出:
- docs/gnb-tech-stack.md:gnb CLI 的启动层、CLI 层、配置层、
  执行模块层、外部依赖与维护边界
- docs/typescript-integration.md:assets/typescript → assets/scripts
  编译路径、bundled tsc、QuickJS 模块加载与生命周期、绑定与
  Engine.d.ts 生成、热重载与验证
- README.md / docs/gnb-cli.md / tools/gnb/README.md /
  AGENT_GUIDE/QuickJSBindings.md:加入入口跳转链接
- .spec/journal/00001.md, 00002.md:对应任务的完成记录

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- 左侧固定 tab strip 切换 TODO / Build / Run / Test 四页,TODO 保留原 3 列卡片化设计
- Build / Run / Test 共用 2 列布局:target 列表独立滚动、操作按钮固定在卡片底部
- 新增 JobManager 管理子进程,stdout/stderr 按行扫描后经 SSE 推送
- 自写 ANSI→HTML(基础 16 / 256 / truecolor、bold、underline),保留 cmake/msbuild 颜色
- 自写 EventSource 客户端,done 主动 close、onerror 不重连,避免 buffer 被反复回放
- Test 页通过 gkNextUnitTests --list-tests 解析 Catch2 用例,binary 缺失给出提示
- 详情面板用 marked 渲染 journal/spec/blocker,统一 Inter + Noto Sans SC + JetBrains Mono 字体栈
- 未启动任务支持内联编辑(标题 / type / priority),spec.Document 加 EditTask
- 修 sidebar footer 左对齐并显示 git 短哈希

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remember last selected target per tab via localStorage
- Append colored completion line to log on job finish (✓/✗/⊘)
- Run tab: 3-column layout with dedicated args panel (220→330px, 240→360px)
- Run tab: real args from Options.cpp (--load-scene, --hdri, --gpu, --present-mode, etc.)
- Run tab: extraArgs persisted to localStorage per target, passed to executable on run
- Fix elapsed timer not ticking during job: replace global setInterval selector with per-panel interval inside initLogPanel
- gnb.bat: include .html files in rebuild trigger check

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces significant changes to the rendering architecture, including the addition of a 'NoAmbient' renderer mode, memory-efficient buffer management for ambient cubes, and a new professional UI framework. It also updates the build system to support automatic Vulkan SDK fetching and improves the .spec/ workflow with a new dashboard and task management commands. My review identified critical memory management issues regarding buffer sizing, potential division-by-zero vulnerabilities in shader code, inefficient repeated querying of device memory properties, and incorrect Vulkan image layout transitions during wireframe rendering.

Comment thread src/Assets/Core/Scene.cpp
Comment on lines +99 to +101
const bool usesAmbientCube =
!NextEngine::GetInstance() || NextEngine::GetInstance()->GetRenderer().CurrentRendererUsesAmbientCube();
const uint32_t ambientCubeCascadeCapacity = usesAmbientCube ? Assets::CUBE_CASCADE_MAX : 1u;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The ambientArenaBuffer_ allocation size is inconsistent with the static offsets defined in BasicTypes.slang. The shader uses fixed offsets based on GPU_SCENE_AMBIENT_CASCADE_MAX (4). If ambientCubeCascadeCapacity is set to 1, the buffer will be significantly smaller than the offsets used by the shader to access voxels, pages, etc., leading to out-of-bounds memory access on the GPU. Furthermore, since usesAmbientCube depends on the current renderer, starting the engine with a 'NoAmbient' renderer and then switching to one that uses ambient cubes at runtime will cause a crash because the buffer was allocated too small and the CPU baking tasks were never initialized. To save memory on low-spec GPUs, the offsets in the shader must be made dynamic (e.g., passed via push constants) or the allocation must always respect the static offsets.

float3 edge0 = p1 - p0;
float3 edge1 = p2 - p0;
float3 rayCrossEdge1 = cross(primaryRayDir, edge1);
float inverseDet = 1.0f / dot(edge0, rayCrossEdge1);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Potential division by zero if the ray is parallel to the triangle plane or if the triangle is degenerate. Although the V-Buffer indicates a hit, numerical precision issues can still lead to a zero or near-zero determinant. It is safer to check for a small epsilon before performing the division.

Comment on lines +1256 to +1257
VkPhysicalDeviceMemoryProperties memoryProperties{};
vkGetPhysicalDeviceMemoryProperties(GetEngine().GetRenderer().Device().PhysicalDevice(), &memoryProperties);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Calling vkGetPhysicalDeviceMemoryProperties every frame in the UI loop is inefficient. This information should be queried once during initialization and cached, as physical device memory properties do not change during the application's lifetime.

Comment on lines +1592 to +1595
ImageMemoryBarrier::FullInsert(
commandBuffer, SwapChain().Images()[imageIndex],
VK_ACCESS_TRANSFER_WRITE_BIT | VK_ACCESS_SHADER_WRITE_BIT, 0,
VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The layout transition to VK_IMAGE_LAYOUT_PRESENT_SRC_KHR is performed before the wireframe render pass. In Vulkan, an image must be in VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL (or GENERAL) to be used as a color attachment. Transitioning to PRESENT_SRC_KHR before drawing is technically incorrect and may lead to validation errors or undefined behavior. The transition to PRESENT_SRC_KHR should happen after all rendering to the swapchain image is complete, typically as the final step before presentation.

@gameknife gameknife merged commit db70568 into dev May 17, 2026
3 checks passed
@gameknife gameknife deleted the low-spec-gpu branch May 22, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant