Skip to content

Incorrect string marshaling when "ID3D12Object::SetName" was called #630

Closed
@Cutano

Description

@Cutano

Summary

SetName("DepthStencil")
But I got
(0x000001CAA011C1C0:'Dphtni)

Steps to reproduce

  • Platform:Desktop
  • Framework Version: .NET 6
  • API: DirectX
  • API Version: DirectX 12
ID3D12Resource* depthStencil;
.......... Some Code Here ............
depthStencil->SetName($"DepthStencil");

Then I got this error:

Execution (From D3D12): ID3D12CommandQueue::ExecuteCommandLists: An ID3D12Resource object (0x000001CAA011C1C0:'**Dphtni**) referenced in a command list ............

Comments

It looks like Silk is using Marshal.StringToHGlobalAnsi() rather than StringToBSTR(), which drops half of the letters due to the encoding.

image

image

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions