rodecomp/Source/Render/RenderAdapter.h
ragnarok-clanker 15b7a6a0e3 Decompile fn_02326 (EnumerateAdaptersDX7)
Batch #16403 by Yommy: 0 byte-identical, 1 confirmed by peer review.

- fn_02326 EnumerateAdaptersDX7: logic confirmed by peer review

Peer-reviewed-by: youko, Toshiro
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-11-10 18:53:41 +00:00

51 lines
1.8 KiB
C++

#ifndef RAGNAROK_SOURCE_RENDER_RENDERADAPTER_H
#define RAGNAROK_SOURCE_RENDER_RENDERADAPTER_H
#include <cstddef>
#include <string>
#include <vector>
#include <windows.h>
class DeviceOwnerDX9;
struct RenderAdapter {
RenderAdapter();
// INLINED
RenderAdapter(int backend, UINT ordinal, const char* description, const GUID& drawGuid, const GUID& renderGuid)
: backend(backend), ordinal(ordinal), description(description), drawGuid(drawGuid), renderGuid(renderGuid), deviceGuid{} {
}
// INLINED
RenderAdapter(int backend, UINT ordinal, const char* description, const GUID& drawGuid, const GUID& renderGuid, const GUID& deviceGuid, const char* deviceName)
: backend(backend), ordinal(ordinal), description(description), drawGuid(drawGuid), renderGuid(renderGuid), deviceGuid(deviceGuid),
deviceName(deviceName) {
}
/* 0000 */ int backend;
/* 0004 */ UINT ordinal;
/* 0008 */ std::string description;
/* 0020 */ GUID drawGuid;
/* 0030 */ GUID renderGuid;
/* 0040 */ GUID deviceGuid;
/* 0050 */ std::string deviceName;
__declspec(noinline) bool Matches(const RenderAdapter& selected) const;
};
RenderAdapter SelectedRenderAdapter();
std::vector<RenderAdapter> EnumerateRenderAdapters(int backend);
std::vector<RenderAdapter> EnumerateAdaptersDX7();
std::vector<RenderAdapter> EnumerateAdaptersDX9();
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(RenderAdapter) == 104);
static_assert(offsetof(RenderAdapter, ordinal) == 0x0004);
static_assert(offsetof(RenderAdapter, description) == 0x0008);
static_assert(offsetof(RenderAdapter, drawGuid) == 0x0020);
static_assert(offsetof(RenderAdapter, renderGuid) == 0x0030);
static_assert(offsetof(RenderAdapter, deviceGuid) == 0x0040);
static_assert(offsetof(RenderAdapter, deviceName) == 0x0050);
#endif
#endif