mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-27 00:50:43 +00:00
Rebases onto origin/main and retires the paused in-tree native-first workspace, legacy scripts, legacy CI, and native-only docs per ADR 0006 (preserving full history permanently at Git tag native-first-final). Addresses all maintainer review findings on PR #406: - Isolate CrossOver/Wine child process environment in bx-cli (env_clear + minimal allowlist + opt-in --inherit-env, with unit tests) - Replace naive objdump grep in scripts/build-shims.sh with strict PE Export Directory verification (exact names, ordinals, forwarders, 0 extra exports, 0 forbidden MinGW imports across all 16 DLLs / 102 exports) - Restore global * @MacosPorters/maintainers fallback in .github/CODEOWNERS alongside per-track rules - Restore independent-verification, claims/evidence-class, provenance-first, and contributor clean-room protections in AGENTS.md - Unify docs/roadmap.md, CONTRIBUTING.md, README.md, docs/README.md, THIRD_PARTY_NOTICES.md, and CHANGELOG.md around Milestones M0-M6 and ADR 0006 Signed-off-by: ates <ahmetrizaates@hotmail.com>
84 lines
2.4 KiB
C
84 lines
2.4 KiB
C
#ifndef BETTERXEN_BX_SHADER_BRIDGE_H
|
|
#define BETTERXEN_BX_SHADER_BRIDGE_H
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
* C ABI contract between Track C (d3d12_xs.dll) and Track D (shader-transpiler).
|
|
* Used at Create*PipelineState / CreateStateObject time to inspect shader blobs
|
|
* (DXBC+DXIL vs DXBC+ACCC/FSPX RDNA2 ISA) and translate console-compiled shaders
|
|
* into D3DMetal-consumable DXIL (or report unsupported forms cleanly).
|
|
*/
|
|
|
|
typedef enum bx_shader_kind {
|
|
BX_SHADER_UNKNOWN = 0,
|
|
BX_SHADER_DXBC_DXIL = 1, /* Standard DXIL inside DXBC container (fast path to D3DMetal) */
|
|
BX_SHADER_DXBC_LEGACY = 2, /* Legacy SM5 SHDR/SHEX inside DXBC */
|
|
BX_SHADER_DXBC_ACCC = 3, /* Console-compiled AMD RDNA2 (ACCC / FSPX) without DXIL */
|
|
BX_SHADER_DXBC_DUAL = 4 /* Contains both DXIL and ACCC chunks */
|
|
} bx_shader_kind_t;
|
|
|
|
typedef enum bx_shader_stage {
|
|
BX_STAGE_UNKNOWN = 0,
|
|
BX_STAGE_PIXEL = 1,
|
|
BX_STAGE_VERTEX = 2,
|
|
BX_STAGE_GEOM = 3,
|
|
BX_STAGE_HULL = 4,
|
|
BX_STAGE_DOMAIN = 5,
|
|
BX_STAGE_COMPUTE = 6,
|
|
BX_STAGE_LIBRARY = 7,
|
|
BX_STAGE_MESH = 8,
|
|
BX_STAGE_AMP = 9
|
|
} bx_shader_stage_t;
|
|
|
|
typedef struct bx_shader_inspection {
|
|
bx_shader_kind_t kind;
|
|
bx_shader_stage_t stage;
|
|
uint32_t shader_model_major;
|
|
uint32_t shader_model_minor;
|
|
uint32_t container_size;
|
|
uint32_t dxil_chunk_size;
|
|
uint32_t accc_chunk_size;
|
|
uint32_t has_root_signature;
|
|
uint8_t digest_hash[16]; /* DXBC header digest or SHA-like key for caching */
|
|
} bx_shader_inspection_t;
|
|
|
|
typedef enum bx_shader_status {
|
|
BX_SHADER_OK = 0,
|
|
BX_SHADER_ERR_INVALID_BLOB = 1,
|
|
BX_SHADER_ERR_UNSUPPORTED = 2,
|
|
BX_SHADER_ERR_TRANSLATE = 3,
|
|
BX_SHADER_ERR_OOM = 4
|
|
} bx_shader_status_t;
|
|
|
|
/* Inspect a raw shader bytecode blob without allocating. */
|
|
bx_shader_status_t bx_shader_inspect(
|
|
const uint8_t* bytes,
|
|
size_t len,
|
|
bx_shader_inspection_t* out_info
|
|
);
|
|
|
|
/*
|
|
* Convert an incoming console shader blob into a D3DMetal-compatible DXBC/DXIL blob.
|
|
* On BX_SHADER_OK, caller must free `*out_bytes` with `bx_shader_free_buffer`.
|
|
*/
|
|
bx_shader_status_t bx_shader_prepare_for_d3dmetal(
|
|
const uint8_t* in_bytes,
|
|
size_t in_len,
|
|
uint8_t** out_bytes,
|
|
size_t* out_len
|
|
);
|
|
|
|
void bx_shader_free_buffer(uint8_t* ptr, size_t len);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* BETTERXEN_BX_SHADER_BRIDGE_H */
|