Skip to content

XMGLOBALCONST poorly initialized when used within a cpp modules project #211

Open
@MartinDew

Description

@MartinDew

I've been using directx on a personal project that uses modules and had crashes because some of the XMGLOBALCONST declared constants simply don't have the proper values at runtime. In our case it was specifically g_XMInfinity and g_XMOneHalf (The values were 000). The crashes were caused by asserts failing on XMIsInfinity, among others, due to those.

In our case, we use DXTK and simplemath and import it through a Module partition with the following syntax : export import <SimpleMath.h>.

It looks like it has something to do with how __declspec(selectany) reacts when used within modules.

Are we right or is there something we are missing?

Thanks!

Metadata

Metadata

Assignees

Labels

complierIssue related to compiler codegen

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions