@hwnd%

Discussions related to graphics (2D and 3D), animation and games programming
Richard Russell
Posts: 667
Joined: Tue 18 Jun 2024, 09:32

Re: @hwnd%

Post by Richard Russell »

Ric wrote: Mon 20 Apr 2026, 19:24 The obvious bit that stands out are the 2 single byte elements in the DEPTH_STENCIL_DESC, these are coded by the compiler in 32bit mode which ads the padding automatically (so AI says),
If your 32-bit structure is working that can't be right, because there's no 'automatic padding' in BBC BASIC - the structure members are always close-packed with whatever size you've declared them as (one byte in the case of depthStencilDesc.StencilReadMask&). Indeed, from the declarations you listed, the subsequent FrontFace{} and BackFace{} structures are not even 4-byte aligned. :o

That's probably quite significant, because if there isn't a requirement for 4-byte alignment in the 32-bit version it's probably the case that there's no requirement for 8-byte alignment (or even 4-byte alignment) in the 64-bit version! So maybe the AI is giving misleading information. :roll:

Indeed, from a quick glance, there's nothing in any of the structures you listed that would make me think you need to make any changes at all between 32-bit and 64-bit mode. I might be wrong, but the obvious candidates for changes being needed (pointers and handles - which are often pointers under the hood) don't seem to be present at all.

But it all comes down to how the structures are declared in C and whether the compiler's padding rules are set differently in the 32-bit amd 64-bit builds. If they are, all bets are off.
Richard Russell
Posts: 667
Joined: Tue 18 Jun 2024, 09:32

Re: @hwnd%

Post by Richard Russell »

Richard Russell wrote: Tue 21 Apr 2026, 15:01 Indeed, from a quick glance, there's nothing in any of the structures you listed that would make me think you need to make any changes at all between 32-bit and 64-bit mode.
I asked Gemini AI the direct question:
In respect of the Windows D3D11_DEPTH_STENCIL_DESC and D3D11_DEPTH_STENCIL_VIEW_DESC structures (and their sub-structures), are there any differences between 32-bit and 64-bit builds? Do any of the members change size or alignment?
and its answer was:
No, there are no functional differences in size or alignment for these specific structures between 32-bit (x86) and 64-bit (x64) builds.
Because these structures consist entirely of fixed-size types like UINT, BOOL, and enums (which are 4 bytes in the Windows C++ environment), they do not contain pointers or size_t members that vary by architecture.
As that agrees with my own analysis, it may be right. :lol:
Ric
Posts: 311
Joined: Tue 17 Apr 2018, 21:03

Re: @hwnd%

Post by Ric »

Thanks Richard, it is a bit disappointing because I thought I was nearing the end of what the problem could be. I'll try AI with the same question for the rest of the structures and see what happens.
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023