View Issue Details

IDProjectCategoryView StatusLast Update
0005293NoesisGUIC# SDKpublic2026-10-28 17:22
ReporterBrandonReinhart Assigned Tosfernandez  
PrioritynormalSeverityblock 
Status assignedResolutionopen 
Product Version4.0.1 
Target Version4.0.2 
Summary0005293: 4.0.1 C# RenderDevice.DeviceCaps has stale layout; native code reads incorrect capability flags
Description

Environment

  • Noesis.GUI 4.0.1 from NuGet, Linux x64
  • Native SDK 4.0.1 (r18228) headers
  • Ubuntu 26.04.1 LTS
  • .NET SDK 10.0.401, targeting net10.0

Description

A custom managed RenderDevice constructs successfully in 4.0.1, but its capability flags do not reach native Noesis correctly.

Native DeviceCaps contains four one-byte booleans. The managed struct still includes a four-byte CenterPixelOffset float before those booleans. Consequently, native code reads the float’s bytes as the capability flags.

Our wgpu UI is black despite the managed device reporting DepthRangeZeroToOne = true.

Reproduction

Extract the attached project and run:

dotnet run --project NoesisCapsRepro.csproj

The standalone console app needs no license, GPU, window, XAML, or game assets. Its device reports:

new DeviceCaps
{
DepthRangeZeroToOne = true,
ClipSpaceYInverted = true
}

It calls Noesis_RenderDevice_GetCaps with the device’s native handle and an eight-byte output buffer prefilled with 0xA5.

Actual result

Managed DeviceCaps size: 8
CenterPixelOffset offset: 0
LinearRendering offset: 4
SubpixelRendering offset: 5
DepthRangeZeroToOne offset: 6
ClipSpaceYInverted offset: 7
Managed depth range: True
Managed Y inverted: True
Native caps (8-byte canary): 00000000A5A5A5A5

Expected result

00000101A5A5A5A5

The first four bytes should represent the four native flags; the remaining canary bytes should remain unchanged.

Rendering cross-check

With the normal binding, the UI is black even in evaluation mode without a key. Temporarily placing the expected native capability bytes in the first four bytes of the managed struct makes the loading screen and main menu render correctly. That diagnostic was removed.

Requested fix

Please update managed DeviceCaps and callback marshalling to match the four-byte native layout, removing CenterPixelOffset and preserving one-byte boolean fields.

Please also check the callback write size: the managed assignment appears to write eight bytes where the native structure contains only four.

This is separate from constructor issue 0005188. Windows has not been tested.

Attached Files
PlatformLinux

Activities

BrandonReinhart

BrandonReinhart

2026-10-28 06:00

reporter   ~0012806

Not to be a jerk, but I feel like this should have been caught by an ABI test / CI.

jsantos

jsantos

2026-10-28 12:00

manager   ~0012808

You are totally right, we don't have tests regarding the creation of custom render devices in C# (most of our clients are using our renderers).

We will provide a hot-fix immediately.

sfernandez

sfernandez

2026-10-28 13:51

manager   ~0012815

Hello, we uploaded a new version of the Noesis.GUI nuget with this issue patched: https://www.nuget.org/packages/Noesis.GUI/4.0.1.18263
Could you please give it a try?

BrandonReinhart

BrandonReinhart

2026-10-28 17:22

reporter   ~0012819

Confirmed! It works. Thank you. As far as I can tell there aren't any other issues with our update to 4.0.1. I reached out to support to get our license updated. Thank you!!!

Issue History

Date Modified Username Field Change
2026-10-28 05:58 BrandonReinhart New Issue
2026-10-28 05:58 BrandonReinhart File Added: noesis-devicecaps-repro.zip
2026-10-28 06:00 BrandonReinhart Note Added: 0012806
2026-10-28 11:12 sfernandez Assigned To => sfernandez
2026-10-28 11:12 sfernandez Status new => assigned
2026-10-28 11:12 sfernandez Target Version => 4.0.2
2026-10-28 12:00 jsantos Note Added: 0012808
2026-10-28 13:51 sfernandez Status assigned => feedback
2026-10-28 13:51 sfernandez Note Added: 0012815
2026-10-28 17:22 BrandonReinhart Note Added: 0012819
2026-10-28 17:22 BrandonReinhart Status feedback => assigned