Skip to content

docs: expand the README and add a Chinese/English switch - #4

Merged
haolange merged 2 commits into
mainfrom
cursor/readme-bilingual-2ab0
Sep 22, 2026
Merged

haolange merged 2 commits into
mainfrom
cursor/readme-bilingual-2ab0

Conversation

@haolange

Copy link
Copy Markdown
Owner

变更

#3 合并时只包含删掉 DESIGN.md、把工程边界收进 AGENTS.md 的那一笔。其后的 README 改动留在已合并分支上,没有进入 main。本 PR 把这两笔补上。

  • 根 README 按当前公开类型写成产品入口:后端选择、资源与 Heap、不可变管线、六种编码器、提交与 Fence、交换链状态、14 个能力域,以及探测成功不等于平台资格通过。
  • 仓库首页是中文 README.md。英文全文在 README.en.md。页首互相链接:English · 设计与架构 · 问题反馈 / 简体中文 · Design · Issues。
  • 设计与架构 锚到文内对象模型,不另建设计文档。

功能矩阵、QuickStart、验证命令和运行时代码未改。

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 22, 2026 09:27
Describe backends, resources, pipelines, recording, submit and the 14 capability domains from the current types.

Co-authored-by: CGBull <1824339952@qq.com>
GitHub shows README.md in Chinese. README.en.md carries the same contract, and the header links language, design, and issues.

Co-authored-by: CGBull <1824339952@qq.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-22T09:34:25.857825Z 4cf275f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4cf275fa35

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.en.md

SharpGPU is a .NET 10 hardware abstraction over DirectX 12, Vulkan and Metal. The public surface is a set of explicit mechanisms: devices, resources, immutable pipelines, binding tables, command encoders, queues and presentation. Pass topology, barrier inference, memory aliasing and transient-resource lifetime stay with the caller, typically a render graph.

Shaders enter as compiled payloads. SharpGPU does not ship a shader compiler. Swap-chain acquire and present report `ERHISwapChainStatus` and leave recreate to the caller. Unsupported factories throw `NotSupportedException` rather than substituting another execution path.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Document MSL source as a supported input

For Metal callers using ERHIShaderPayloadKind.MslSource, MetalFunction decodes the UTF-8 source and calls MTLDevice.NewLibrary to compile it, so shaders do not always enter as compiled payloads. This wording, repeated in the package README, can incorrectly lead Metal users to believe that offline compilation to a metallib is mandatory; distinguish the accepted MSL-source path and its native runtime compilation from SharpGPU shipping a standalone shader compiler.

Useful? React with 👍 / 👎.

Comment thread README.en.md

`RHIInstanceDescriptor` also carries the debug and validation switches, the native surface kind, and the requested graphics, compute and transfer queue counts. One `RHIInstance` owns every enumerated device. `GetDevice` returns a device by index. A queue is `RHIDevice.GetCommandQueue(ERHIPipelineType, index)`.

`ERHIDeviceState` is `Unknown`, `Operational`, `Lost`, `Removed` or `Reset`. `Lost` is a timeout or device-loss recovery. `Removed` is a physical adapter going away. `Reset` means previous resources are dead and must be created again. Native failures surface as `RHIException`, which carries `ERHIErrorCode`, the backend, the native code and message, and the device state.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Describe Lost as terminal device loss

When handling a timeout or device-loss diagnostic, this description reverses the implemented lifecycle: Metal queue timeouts remain SubmissionFailed with an Operational device, while RHIDevice.MarkDeviceLost transitions to Lost permanently and all subsequent device-backed operations rethrow the stored diagnostic. There is no recovery transition on that device, so describing Lost as a timeout or recovery can cause callers to reuse invalid resources instead of creating a new device.

Useful? React with 👍 / 👎.

Comment thread README.en.md

Raster recording covers draws, indirect draws, viewports and binding. Compute recording covers dispatch and indirect dispatch. Transfer recording covers copies and blits. Every encoder records `RHIBarrier` values: global, buffer or texture. Stage and access masks use Before/After pairs. Texture barriers also carry `ERHITextureLayout` (13 values, including copy, resolve, present and `Common`). A non-null source or destination queue is a cross-queue ownership transfer.

Indirect command buffers are a separate capability used to record draw streams in parallel and `Execute` them inside an encoder. Vulkan does not implement that contract.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Name the layout-driven indirect API correctly

For callers implementing indirect execution, there is no public indirect command-buffer object or Execute method to record in parallel. The contract is explicitly RHIIndirectCommandLayout plus an indirect argument buffer, consumed through ExecuteIndirect; its source documentation also states that it is not a device-generated command buffer. Presenting a different programming model and method name sends users toward APIs that do not exist.

Useful? React with 👍 / 👎.

Comment thread README.en.md

`RHIFence` is the CPU/GPU signal. `Wait` returns `ERHIFenceStatus` (`Success`, `NotReady` or `Undefined`), not a boolean. `Reset` is legal once the signal has completed. `RHISemaphore` is the GPU/GPU signal carried in the submit descriptor.

Timestamp, occlusion and pipeline-statistics results are read from `RHIQuery` after the GPU has written them. `TryGetTimestamp`, `TryGetOcclusion` and `TryGetPipelineStatistics` return false while the result is still pending. Calibrated timestamps are `QueryClockCalibration` on devices whose synchronization capability reports them. There is no CPU-clock substitute.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Replace the nonexistent query accessor names

For users reading timestamp, occlusion, or statistics results, none of TryGetTimestamp, TryGetOcclusion, or TryGetPipelineStatistics exists on RHIQuery. Callers must first inspect ResolveData() for NotReady, then read timestamp/occlusion values from Results or use the domain-specific TryGetRasterStatistics, TryGetComputeStatistics, and TryGetRayTracingStatistics methods; following the documented sequence currently results in uncompilable code.

Useful? React with 👍 / 👎.

@haolange
haolange merged commit ae0b470 into main Sep 22, 2026
2 of 6 checks passed
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.

2 participants