mirror of
https://github.com/holub/mame
synced 2025-05-30 17:41:47 +03:00
Update BGFX, BX and BIMG (#10789)
* Update to bgfx a93a714632b79b5ddbf5c86ac323fa9b76ed3433 Co-authored-by: Бранимир Караџић <branimirkaradzic@gmail.com>
This commit is contained in:
parent
4a1b41854b
commit
812e6094f4
25
3rdparty/bgfx/.appveyor.yml
vendored
25
3rdparty/bgfx/.appveyor.yml
vendored
@ -1,25 +0,0 @@
|
||||
shallow_clone: true
|
||||
|
||||
os:
|
||||
- Visual Studio 2019
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- TOOLSET: vs2017
|
||||
# - TOOLSET: vs2019
|
||||
|
||||
platform:
|
||||
- Win32
|
||||
- x64
|
||||
|
||||
configuration:
|
||||
- Debug
|
||||
- Release
|
||||
|
||||
install:
|
||||
- git clone --depth 1 https://github.com/bkaradzic/bx ..\bx
|
||||
- git clone --depth 1 https://github.com/bkaradzic/bimg ..\bimg
|
||||
- ..\bx\tools\bin\windows\genie --with-tools --with-examples %TOOLSET%
|
||||
|
||||
build:
|
||||
project: .build/projects/$(TOOLSET)/bgfx.sln
|
4
3rdparty/bgfx/.editorconfig
vendored
4
3rdparty/bgfx/.editorconfig
vendored
@ -18,3 +18,7 @@ indent_style = space
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
max_line_length = 80
|
||||
|
||||
[.github/workflows/*.yml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
11
3rdparty/bgfx/.gitattributes
vendored
11
3rdparty/bgfx/.gitattributes
vendored
@ -1,11 +1,12 @@
|
||||
*.bin binary diff=hex
|
||||
*.c eol=lf
|
||||
*.cpp eol=lf
|
||||
*.h eol=lf
|
||||
*.lua eol=lf
|
||||
*.m eol=lf
|
||||
*.md eol=lf
|
||||
*.mk eol=lf
|
||||
*.mm eol=lf
|
||||
*.sc eol=lf
|
||||
*.sh eol=lf
|
||||
*.m eol=lf
|
||||
*.mm eol=lf
|
||||
*.md eol=lf
|
||||
*.lua eol=lf
|
||||
*.mk eol=lf
|
||||
makefile eol=lf
|
||||
|
54
3rdparty/bgfx/.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
54
3rdparty/bgfx/.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
---
|
||||
name: Bug report (FOR BUGS ONLY! DO NOT SUBMIT QUESTIONS HERE!)
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!---
|
||||
###########################################################################
|
||||
|
||||
**BEWARE!**
|
||||
|
||||
If you completely disregard this guidance, and submit random question as issue
|
||||
(bug report), the issue will be deleted. If you submit the same issue after
|
||||
deletion, you'll be blocked.
|
||||
|
||||
**IMPORTANT: READ FIRST!**
|
||||
|
||||
Issue tracker is **ONLY** used for reporting bugs.
|
||||
|
||||
If you have any questions please **do not** open issue, rather:
|
||||
|
||||
- If you have quick question, ask on Discord: https://discord.gg/9eMbv7J
|
||||
- Ask in discussions: https://github.com/bkaradzic/bgfx/discussions
|
||||
- Search documentation: https://bkaradzic.github.io/bgfx/
|
||||
|
||||
New features should be discussed on:
|
||||
|
||||
- GitHub Discussions https://github.com/bkaradzic/bgfx/discussions
|
||||
- Discord Chat https://discord.gg/9eMbv7J
|
||||
|
||||
###########################################################################
|
||||
-->
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here. OS, drivers, etc.
|
250
3rdparty/bgfx/.github/workflows/main.yml
vendored
Normal file
250
3rdparty/bgfx/.github/workflows/main.yml
vendored
Normal file
@ -0,0 +1,250 @@
|
||||
name: CI
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
msvc:
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include: [
|
||||
{ config: Debug, platform: Win32, bindir: 'win32_vs2019' },
|
||||
{ config: Debug, platform: x64, bindir: 'win64_vs2019' },
|
||||
{ config: Release, platform: Win32, bindir: 'win32_vs2019' },
|
||||
{ config: Release, platform: x64, bindir: 'win64_vs2019' },
|
||||
]
|
||||
name: msvc-${{ matrix.config }}-${{ matrix.platform }}
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- name: Checkout bgfx
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: bgfx
|
||||
- name: Checkout bx
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: bkaradzic/bx
|
||||
path: bx
|
||||
- name: Checkout bimg
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: bkaradzic/bimg
|
||||
path: bimg
|
||||
- name: Prepare
|
||||
uses: microsoft/setup-msbuild@v1.1
|
||||
- name: Build
|
||||
shell: cmd
|
||||
run: |
|
||||
cd bgfx
|
||||
..\bx\tools\bin\windows\genie.exe --with-tools --with-combined-examples --with-shared-lib vs2019
|
||||
msbuild ".build/projects/vs2019/bgfx.sln" /m /v:minimal /p:Configuration=${{ matrix.config }} /p:Platform=${{ matrix.platform }}
|
||||
- name: Check
|
||||
shell: cmd
|
||||
run: |
|
||||
cd bgfx
|
||||
dir /s ".build\${{ matrix.bindir }}\bin"
|
||||
".build\${{ matrix.bindir }}\bin\geometryc${{ matrix.config }}.exe" --version
|
||||
".build\${{ matrix.bindir }}\bin\shaderc${{ matrix.config }}.exe" --version
|
||||
".build\${{ matrix.bindir }}\bin\texturec${{ matrix.config }}.exe" --version
|
||||
mingw:
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include: [
|
||||
{ msystem: MINGW64, project: 'mingw-gcc', bindir: 'win64_mingw-gcc' },
|
||||
{ msystem: CLANG64, project: 'mingw-clang', bindir: 'win64_mingw-clang' },
|
||||
]
|
||||
name: mingw-${{ matrix.msystem }}
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout bgfx
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: bgfx
|
||||
- name: Checkout bx
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: bkaradzic/bx
|
||||
path: bx
|
||||
- name: Checkout bimg
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: bkaradzic/bimg
|
||||
path: bimg
|
||||
- name: Prepare
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: ${{ matrix.msystem }}
|
||||
update: true
|
||||
install: make
|
||||
pacboy: cc:p
|
||||
- name: Build
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
cd bgfx
|
||||
make ${{ matrix.project }}-release64 -j$(nproc) AR=ar CC=cc CXX=c++ MINGW=$MINGW_PREFIX
|
||||
- name: Check
|
||||
shell: cmd
|
||||
run: |
|
||||
cd bgfx
|
||||
dir /s ".build\${{ matrix.bindir }}\bin"
|
||||
".build\${{ matrix.bindir }}\bin\geometrycRelease.exe" --version
|
||||
".build\${{ matrix.bindir }}\bin\shadercRelease.exe" --version
|
||||
".build\${{ matrix.bindir }}\bin\texturecRelease.exe" --version
|
||||
linux:
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include: [
|
||||
{ config: debug, binsuffix: Debug },
|
||||
{ config: release, binsuffix: Release },
|
||||
]
|
||||
name: linux-${{ matrix.config }}64
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout bgfx
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: bgfx
|
||||
- name: Checkout bx
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: bkaradzic/bx
|
||||
path: bx
|
||||
- name: Checkout bimg
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: bkaradzic/bimg
|
||||
path: bimg
|
||||
- name: Build
|
||||
run: |
|
||||
sudo apt install libgl-dev
|
||||
cd bgfx
|
||||
make -j$(nproc) linux-${{ matrix.config }}64
|
||||
- name: Check
|
||||
run: |
|
||||
cd bgfx
|
||||
ls -lash ".build/linux64_gcc/bin"
|
||||
".build/linux64_gcc/bin/geometryc${{ matrix.binsuffix}}" --version
|
||||
".build/linux64_gcc/bin/shaderc${{ matrix.binsuffix}}" --version
|
||||
".build/linux64_gcc/bin/texturec${{ matrix.binsuffix}}" --version
|
||||
wasm:
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
config: [ debug, release]
|
||||
name: wasm-${{ matrix.config }}
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout bgfx
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: bgfx
|
||||
- name: Checkout bx
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: bkaradzic/bx
|
||||
path: bx
|
||||
- name: Checkout bimg
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: bkaradzic/bimg
|
||||
path: bimg
|
||||
- name: Prepare
|
||||
run: |
|
||||
docker pull emscripten/emsdk
|
||||
docker run --rm emscripten/emsdk which emcc em++ emar
|
||||
cd bgfx
|
||||
EMSCRIPTEN=/emsdk/upstream/emscripten ../bx/tools/bin/linux/genie --with-examples --gcc=wasm gmake
|
||||
- name: Build
|
||||
run: >
|
||||
docker run --rm -u $(id -u):$(id -g) -v $(pwd):/bgfx emscripten/emsdk
|
||||
make -C /bgfx/bgfx wasm-${{ matrix.config }} -j$(nproc) EMSCRIPTEN=/emsdk/upstream/emscripten
|
||||
- name: Check
|
||||
run: |
|
||||
cd bgfx
|
||||
ls -lash ".build/wasm/bin"
|
||||
osx:
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include: [
|
||||
{ config: debug, binsuffix: Debug },
|
||||
{ config: release, binsuffix: Release },
|
||||
]
|
||||
name: osx-x64-${{ matrix.config }}
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout bgfx
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: bgfx
|
||||
- name: Checkout bx
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: bkaradzic/bx
|
||||
path: bx
|
||||
- name: Checkout bimg
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: bkaradzic/bimg
|
||||
path: bimg
|
||||
- name: Build
|
||||
run: |
|
||||
cd bgfx
|
||||
make -j$(sysctl -n hw.physicalcpu) osx-x64-${{ matrix.config }}
|
||||
- name: Check
|
||||
run: |
|
||||
cd bgfx
|
||||
ls -lash ".build/osx-x64/bin"
|
||||
".build/osx-x64/bin/geometryc${{ matrix.binsuffix}}" --version
|
||||
".build/osx-x64/bin/shaderc${{ matrix.binsuffix}}" --version
|
||||
".build/osx-x64/bin/texturec${{ matrix.binsuffix}}" --version
|
||||
android:
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include: [
|
||||
{ platform: arm },
|
||||
{ platform: arm64 },
|
||||
{ platform: x86 },
|
||||
{ platform: x86_64 },
|
||||
]
|
||||
name: android-${{ matrix.platform }}
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: nttld/setup-ndk@v1
|
||||
id: setup-ndk
|
||||
with:
|
||||
ndk-version: r25b
|
||||
add-to-path: false
|
||||
- name: Checkout bgfx
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: bgfx
|
||||
- name: Checkout bx
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: bkaradzic/bx
|
||||
path: bx
|
||||
- name: Checkout bimg
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: bkaradzic/bimg
|
||||
path: bimg
|
||||
- name: Build
|
||||
run: |
|
||||
cd bgfx
|
||||
make -j$(sysctl -n hw.physicalcpu) android-${{ matrix.platform }}
|
||||
env:
|
||||
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
|
||||
- name: Check
|
||||
run: |
|
||||
cd bgfx
|
||||
ls -lash ".build/android-${{ matrix.platform }}/bin"
|
10
3rdparty/bgfx/.gitignore
vendored
10
3rdparty/bgfx/.gitignore
vendored
@ -1,9 +1,11 @@
|
||||
*.TMP
|
||||
*.dxvk-cache
|
||||
*.log
|
||||
.DS_Store
|
||||
.build
|
||||
.debug
|
||||
.DS_Store
|
||||
.gdb_history
|
||||
.git
|
||||
.svn
|
||||
tags
|
||||
.gdb_history
|
||||
.vscode
|
||||
*.TMP
|
||||
tags
|
||||
|
681
3rdparty/bgfx/3rdparty/cgltf/cgltf.h
vendored
681
3rdparty/bgfx/3rdparty/cgltf/cgltf.h
vendored
File diff suppressed because it is too large
Load Diff
205
3rdparty/bgfx/3rdparty/cgltf/cgltf_write.h
vendored
205
3rdparty/bgfx/3rdparty/cgltf/cgltf_write.h
vendored
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* cgltf_write - a single-file glTF 2.0 writer written in C99.
|
||||
*
|
||||
* Version: 1.11
|
||||
* Version: 1.13
|
||||
*
|
||||
* Website: https://github.com/jkuhlmann/cgltf
|
||||
*
|
||||
@ -15,19 +15,17 @@
|
||||
*
|
||||
* Reference:
|
||||
* `cgltf_result cgltf_write_file(const cgltf_options* options, const char*
|
||||
* path, const cgltf_data* data)` writes JSON to the given file path. Buffer
|
||||
* files and external images are not written out. `data` is not deallocated.
|
||||
* path, const cgltf_data* data)` writes a glTF data to the given file path.
|
||||
* If `options->type` is `cgltf_file_type_glb`, both JSON content and binary
|
||||
* buffer of the given glTF data will be written in a GLB format.
|
||||
* Otherwise, only the JSON part will be written.
|
||||
* External buffers and images are not written out. `data` is not deallocated.
|
||||
*
|
||||
* `cgltf_size cgltf_write(const cgltf_options* options, char* buffer,
|
||||
* cgltf_size size, const cgltf_data* data)` writes JSON into the given memory
|
||||
* buffer. Returns the number of bytes written to `buffer`, including a null
|
||||
* terminator. If buffer is null, returns the number of bytes that would have
|
||||
* been written. `data` is not deallocated.
|
||||
*
|
||||
* To write custom JSON into the `extras` field, aggregate all the custom JSON
|
||||
* into a single buffer, then set `file_data` to this buffer. By supplying
|
||||
* start_offset and end_offset values for various objects, you can select a
|
||||
* range of characters within the aggregated buffer.
|
||||
*/
|
||||
#ifndef CGLTF_WRITE_H_INCLUDED__
|
||||
#define CGLTF_WRITE_H_INCLUDED__
|
||||
@ -59,7 +57,7 @@ cgltf_size cgltf_write(const cgltf_options* options, char* buffer, cgltf_size si
|
||||
|
||||
#if defined(__INTELLISENSE__) || defined(__JETBRAINS_IDE__)
|
||||
/* This makes MSVC/CLion intellisense work. */
|
||||
#define CGLTF_IMPLEMENTATION
|
||||
#define CGLTF_WRITE_IMPLEMENTATION
|
||||
#endif
|
||||
|
||||
#ifdef CGLTF_WRITE_IMPLEMENTATION
|
||||
@ -84,6 +82,9 @@ cgltf_size cgltf_write(const cgltf_options* options, char* buffer, cgltf_size si
|
||||
#define CGLTF_EXTENSION_FLAG_MATERIALS_VARIANTS (1 << 10)
|
||||
#define CGLTF_EXTENSION_FLAG_MATERIALS_VOLUME (1 << 11)
|
||||
#define CGLTF_EXTENSION_FLAG_TEXTURE_BASISU (1 << 12)
|
||||
#define CGLTF_EXTENSION_FLAG_MATERIALS_EMISSIVE_STRENGTH (1 << 13)
|
||||
#define CGLTF_EXTENSION_FLAG_MESH_GPU_INSTANCING (1 << 14)
|
||||
#define CGLTF_EXTENSION_FLAG_MATERIALS_IRIDESCENCE (1 << 15)
|
||||
|
||||
typedef struct {
|
||||
char* buffer;
|
||||
@ -144,6 +145,17 @@ typedef struct {
|
||||
context->needs_comma = 1; }
|
||||
|
||||
#define CGLTF_WRITE_TEXTURE_INFO(label, info) if (info.texture) { \
|
||||
cgltf_write_line(context, "\"" label "\": {"); \
|
||||
CGLTF_WRITE_IDXPROP("index", info.texture, context->data->textures); \
|
||||
cgltf_write_intprop(context, "texCoord", info.texcoord, 0); \
|
||||
if (info.has_transform) { \
|
||||
context->extension_flags |= CGLTF_EXTENSION_FLAG_TEXTURE_TRANSFORM; \
|
||||
cgltf_write_texture_transform(context, &info.transform); \
|
||||
} \
|
||||
cgltf_write_extras(context, &info.extras); \
|
||||
cgltf_write_line(context, "}"); }
|
||||
|
||||
#define CGLTF_WRITE_NORMAL_TEXTURE_INFO(label, info) if (info.texture) { \
|
||||
cgltf_write_line(context, "\"" label "\": {"); \
|
||||
CGLTF_WRITE_IDXPROP("index", info.texture, context->data->textures); \
|
||||
cgltf_write_intprop(context, "texCoord", info.texcoord, 0); \
|
||||
@ -155,6 +167,28 @@ typedef struct {
|
||||
cgltf_write_extras(context, &info.extras); \
|
||||
cgltf_write_line(context, "}"); }
|
||||
|
||||
#define CGLTF_WRITE_OCCLUSION_TEXTURE_INFO(label, info) if (info.texture) { \
|
||||
cgltf_write_line(context, "\"" label "\": {"); \
|
||||
CGLTF_WRITE_IDXPROP("index", info.texture, context->data->textures); \
|
||||
cgltf_write_intprop(context, "texCoord", info.texcoord, 0); \
|
||||
cgltf_write_floatprop(context, "strength", info.scale, 1.0f); \
|
||||
if (info.has_transform) { \
|
||||
context->extension_flags |= CGLTF_EXTENSION_FLAG_TEXTURE_TRANSFORM; \
|
||||
cgltf_write_texture_transform(context, &info.transform); \
|
||||
} \
|
||||
cgltf_write_extras(context, &info.extras); \
|
||||
cgltf_write_line(context, "}"); }
|
||||
|
||||
#ifndef CGLTF_CONSTS
|
||||
static const cgltf_size GlbHeaderSize = 12;
|
||||
static const cgltf_size GlbChunkHeaderSize = 8;
|
||||
static const uint32_t GlbVersion = 2;
|
||||
static const uint32_t GlbMagic = 0x46546C67;
|
||||
static const uint32_t GlbMagicJsonChunk = 0x4E4F534A;
|
||||
static const uint32_t GlbMagicBinChunk = 0x004E4942;
|
||||
#define CGLTF_CONSTS
|
||||
#endif
|
||||
|
||||
static void cgltf_write_indent(cgltf_write_context* context)
|
||||
{
|
||||
if (context->needs_comma)
|
||||
@ -205,15 +239,24 @@ static void cgltf_write_strprop(cgltf_write_context* context, const char* label,
|
||||
|
||||
static void cgltf_write_extras(cgltf_write_context* context, const cgltf_extras* extras)
|
||||
{
|
||||
cgltf_size length = extras->end_offset - extras->start_offset;
|
||||
if (length > 0 && context->data->file_data)
|
||||
if (extras->data)
|
||||
{
|
||||
char* json_string = ((char*) context->data->file_data) + extras->start_offset;
|
||||
cgltf_write_indent(context);
|
||||
CGLTF_SPRINTF("%s", "\"extras\": ");
|
||||
CGLTF_SNPRINTF(length, "%.*s", (int)(extras->end_offset - extras->start_offset), json_string);
|
||||
CGLTF_SPRINTF("\"extras\": %s", extras->data);
|
||||
context->needs_comma = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
cgltf_size length = extras->end_offset - extras->start_offset;
|
||||
if (length > 0 && context->data->json)
|
||||
{
|
||||
char* json_string = ((char*) context->data->json) + extras->start_offset;
|
||||
cgltf_write_indent(context);
|
||||
CGLTF_SPRINTF("%s", "\"extras\": ");
|
||||
CGLTF_SNPRINTF(length, "%.*s", (int)(extras->end_offset - extras->start_offset), json_string);
|
||||
context->needs_comma = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void cgltf_write_stritem(cgltf_write_context* context, const char* item)
|
||||
@ -508,6 +551,7 @@ static void cgltf_write_mesh(cgltf_write_context* context, const cgltf_mesh* mes
|
||||
{
|
||||
cgltf_write_floatarrayprop(context, "weights", mesh->weights, mesh->weights_count);
|
||||
}
|
||||
|
||||
cgltf_write_extras(context, &mesh->extras);
|
||||
cgltf_write_line(context, "}");
|
||||
}
|
||||
@ -544,7 +588,7 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater
|
||||
{
|
||||
cgltf_write_floatprop(context, "alphaCutoff", material->alpha_cutoff, 0.5f);
|
||||
}
|
||||
cgltf_write_boolprop_optional(context, "doubleSided", material->double_sided, false);
|
||||
cgltf_write_boolprop_optional(context, "doubleSided", (bool)material->double_sided, false);
|
||||
// cgltf_write_boolprop_optional(context, "unlit", material->unlit, false);
|
||||
|
||||
if (material->unlit)
|
||||
@ -587,6 +631,16 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater
|
||||
context->extension_flags |= CGLTF_EXTENSION_FLAG_MATERIALS_SHEEN;
|
||||
}
|
||||
|
||||
if (material->has_emissive_strength)
|
||||
{
|
||||
context->extension_flags |= CGLTF_EXTENSION_FLAG_MATERIALS_EMISSIVE_STRENGTH;
|
||||
}
|
||||
|
||||
if (material->has_iridescence)
|
||||
{
|
||||
context->extension_flags |= CGLTF_EXTENSION_FLAG_MATERIALS_IRIDESCENCE;
|
||||
}
|
||||
|
||||
if (material->has_pbr_metallic_roughness)
|
||||
{
|
||||
const cgltf_pbr_metallic_roughness* params = &material->pbr_metallic_roughness;
|
||||
@ -599,11 +653,10 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater
|
||||
{
|
||||
cgltf_write_floatarrayprop(context, "baseColorFactor", params->base_color_factor, 4);
|
||||
}
|
||||
cgltf_write_extras(context, ¶ms->extras);
|
||||
cgltf_write_line(context, "}");
|
||||
}
|
||||
|
||||
if (material->unlit || material->has_pbr_specular_glossiness || material->has_clearcoat || material->has_ior || material->has_specular || material->has_transmission || material->has_sheen || material->has_volume)
|
||||
if (material->unlit || material->has_pbr_specular_glossiness || material->has_clearcoat || material->has_ior || material->has_specular || material->has_transmission || material->has_sheen || material->has_volume || material->has_emissive_strength || material->has_iridescence)
|
||||
{
|
||||
cgltf_write_line(context, "\"extensions\": {");
|
||||
if (material->has_clearcoat)
|
||||
@ -612,7 +665,7 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater
|
||||
cgltf_write_line(context, "\"KHR_materials_clearcoat\": {");
|
||||
CGLTF_WRITE_TEXTURE_INFO("clearcoatTexture", params->clearcoat_texture);
|
||||
CGLTF_WRITE_TEXTURE_INFO("clearcoatRoughnessTexture", params->clearcoat_roughness_texture);
|
||||
CGLTF_WRITE_TEXTURE_INFO("clearcoatNormalTexture", params->clearcoat_normal_texture);
|
||||
CGLTF_WRITE_NORMAL_TEXTURE_INFO("clearcoatNormalTexture", params->clearcoat_normal_texture);
|
||||
cgltf_write_floatprop(context, "clearcoatFactor", params->clearcoat_factor, 0.0f);
|
||||
cgltf_write_floatprop(context, "clearcoatRoughnessFactor", params->clearcoat_roughness_factor, 0.0f);
|
||||
cgltf_write_line(context, "}");
|
||||
@ -695,11 +748,30 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater
|
||||
{
|
||||
cgltf_write_line(context, "\"KHR_materials_unlit\": {}");
|
||||
}
|
||||
if (material->has_emissive_strength)
|
||||
{
|
||||
cgltf_write_line(context, "\"KHR_materials_emissive_strength\": {");
|
||||
const cgltf_emissive_strength* params = &material->emissive_strength;
|
||||
cgltf_write_floatprop(context, "emissiveStrength", params->emissive_strength, 1.f);
|
||||
cgltf_write_line(context, "}");
|
||||
}
|
||||
if (material->has_iridescence)
|
||||
{
|
||||
cgltf_write_line(context, "\"KHR_materials_iridescence\": {");
|
||||
const cgltf_iridescence* params = &material->iridescence;
|
||||
cgltf_write_floatprop(context, "iridescenceFactor", params->iridescence_factor, 0.f);
|
||||
CGLTF_WRITE_TEXTURE_INFO("iridescenceTexture", params->iridescence_texture);
|
||||
cgltf_write_floatprop(context, "iridescenceIor", params->iridescence_ior, 1.3f);
|
||||
cgltf_write_floatprop(context, "iridescenceThicknessMinimum", params->iridescence_thickness_min, 100.f);
|
||||
cgltf_write_floatprop(context, "iridescenceThicknessMaximum", params->iridescence_thickness_max, 400.f);
|
||||
CGLTF_WRITE_TEXTURE_INFO("iridescenceThicknessTexture", params->iridescence_thickness_texture);
|
||||
cgltf_write_line(context, "}");
|
||||
}
|
||||
cgltf_write_line(context, "}");
|
||||
}
|
||||
|
||||
CGLTF_WRITE_TEXTURE_INFO("normalTexture", material->normal_texture);
|
||||
CGLTF_WRITE_TEXTURE_INFO("occlusionTexture", material->occlusion_texture);
|
||||
CGLTF_WRITE_NORMAL_TEXTURE_INFO("normalTexture", material->normal_texture);
|
||||
CGLTF_WRITE_OCCLUSION_TEXTURE_INFO("occlusionTexture", material->occlusion_texture);
|
||||
CGLTF_WRITE_TEXTURE_INFO("emissiveTexture", material->emissive_texture);
|
||||
if (cgltf_check_floatarray(material->emissive_factor, 3, 0.0f))
|
||||
{
|
||||
@ -766,7 +838,7 @@ static const char* cgltf_write_str_path_type(cgltf_animation_path_type path_type
|
||||
return "scale";
|
||||
case cgltf_animation_path_type_weights:
|
||||
return "weights";
|
||||
case cgltf_animation_path_type_invalid:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return "invalid";
|
||||
@ -782,6 +854,8 @@ static const char* cgltf_write_str_interpolation_type(cgltf_interpolation_type i
|
||||
return "STEP";
|
||||
case cgltf_interpolation_type_cubic_spline:
|
||||
return "CUBICSPLINE";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return "invalid";
|
||||
}
|
||||
@ -884,16 +958,42 @@ static void cgltf_write_node(cgltf_write_context* context, const cgltf_node* nod
|
||||
CGLTF_WRITE_IDXPROP("skin", node->skin, context->data->skins);
|
||||
}
|
||||
|
||||
bool has_extension = node->light || (node->has_mesh_gpu_instancing && node->mesh_gpu_instancing.attributes_count > 0);
|
||||
if(has_extension)
|
||||
cgltf_write_line(context, "\"extensions\": {");
|
||||
|
||||
if (node->light)
|
||||
{
|
||||
context->extension_flags |= CGLTF_EXTENSION_FLAG_LIGHTS_PUNCTUAL;
|
||||
cgltf_write_line(context, "\"extensions\": {");
|
||||
cgltf_write_line(context, "\"KHR_lights_punctual\": {");
|
||||
CGLTF_WRITE_IDXPROP("light", node->light, context->data->lights);
|
||||
cgltf_write_line(context, "}");
|
||||
}
|
||||
|
||||
if (node->has_mesh_gpu_instancing && node->mesh_gpu_instancing.attributes_count > 0)
|
||||
{
|
||||
context->extension_flags |= CGLTF_EXTENSION_FLAG_MESH_GPU_INSTANCING;
|
||||
context->required_extension_flags |= CGLTF_EXTENSION_FLAG_MESH_GPU_INSTANCING;
|
||||
|
||||
cgltf_write_line(context, "\"EXT_mesh_gpu_instancing\": {");
|
||||
{
|
||||
CGLTF_WRITE_IDXPROP("bufferView", node->mesh_gpu_instancing.buffer_view, context->data->buffer_views);
|
||||
cgltf_write_line(context, "\"attributes\": {");
|
||||
{
|
||||
for (cgltf_size i = 0; i < node->mesh_gpu_instancing.attributes_count; ++i)
|
||||
{
|
||||
const cgltf_attribute* attr = node->mesh_gpu_instancing.attributes + i;
|
||||
CGLTF_WRITE_IDXPROP(attr->name, attr->data, context->data->accessors);
|
||||
}
|
||||
}
|
||||
cgltf_write_line(context, "}");
|
||||
}
|
||||
cgltf_write_line(context, "}");
|
||||
}
|
||||
|
||||
if (has_extension)
|
||||
cgltf_write_line(context, "}");
|
||||
|
||||
if (node->weights_count > 0)
|
||||
{
|
||||
cgltf_write_floatarrayprop(context, "weights", node->weights, node->weights_count);
|
||||
@ -925,7 +1025,7 @@ static void cgltf_write_accessor(cgltf_write_context* context, const cgltf_acces
|
||||
cgltf_write_intprop(context, "componentType", cgltf_int_from_component_type(accessor->component_type), 0);
|
||||
cgltf_write_strprop(context, "type", cgltf_str_from_type(accessor->type));
|
||||
cgltf_size dim = cgltf_dim_from_type(accessor->type);
|
||||
cgltf_write_boolprop_optional(context, "normalized", accessor->normalized, false);
|
||||
cgltf_write_boolprop_optional(context, "normalized", (bool)accessor->normalized, false);
|
||||
cgltf_write_sizeprop(context, "byteOffset", (int)accessor->offset, 0);
|
||||
cgltf_write_intprop(context, "count", (int)accessor->count, -1);
|
||||
if (accessor->has_min)
|
||||
@ -1036,6 +1136,47 @@ static void cgltf_write_variant(cgltf_write_context* context, const cgltf_materi
|
||||
cgltf_write_line(context, "}");
|
||||
}
|
||||
|
||||
static void cgltf_write_glb(FILE* file, const void* json_buf, const cgltf_size json_size, const void* bin_buf, const cgltf_size bin_size)
|
||||
{
|
||||
char header[GlbHeaderSize];
|
||||
char chunk_header[GlbChunkHeaderSize];
|
||||
char json_pad[3] = { 0x20, 0x20, 0x20 };
|
||||
char bin_pad[3] = { 0, 0, 0 };
|
||||
|
||||
cgltf_size json_padsize = (json_size % 4 != 0) ? 4 - json_size % 4 : 0;
|
||||
cgltf_size bin_padsize = (bin_size % 4 != 0) ? 4 - bin_size % 4 : 0;
|
||||
cgltf_size total_size = GlbHeaderSize + GlbChunkHeaderSize + json_size + json_padsize;
|
||||
if (bin_buf != NULL && bin_size > 0) {
|
||||
total_size += GlbChunkHeaderSize + bin_size + bin_padsize;
|
||||
}
|
||||
|
||||
// Write a GLB header
|
||||
memcpy(header, &GlbMagic, 4);
|
||||
memcpy(header + 4, &GlbVersion, 4);
|
||||
memcpy(header + 8, &total_size, 4);
|
||||
fwrite(header, 1, GlbHeaderSize, file);
|
||||
|
||||
// Write a JSON chunk (header & data)
|
||||
uint32_t json_chunk_size = (uint32_t)(json_size + json_padsize);
|
||||
memcpy(chunk_header, &json_chunk_size, 4);
|
||||
memcpy(chunk_header + 4, &GlbMagicJsonChunk, 4);
|
||||
fwrite(chunk_header, 1, GlbChunkHeaderSize, file);
|
||||
|
||||
fwrite(json_buf, 1, json_size, file);
|
||||
fwrite(json_pad, 1, json_padsize, file);
|
||||
|
||||
if (bin_buf != NULL && bin_size > 0) {
|
||||
// Write a binary chunk (header & data)
|
||||
uint32_t bin_chunk_size = (uint32_t)(bin_size + bin_padsize);
|
||||
memcpy(chunk_header, &bin_chunk_size, 4);
|
||||
memcpy(chunk_header + 4, &GlbMagicBinChunk, 4);
|
||||
fwrite(chunk_header, 1, GlbChunkHeaderSize, file);
|
||||
|
||||
fwrite(bin_buf, 1, bin_size, file);
|
||||
fwrite(bin_pad, 1, bin_padsize, file);
|
||||
}
|
||||
}
|
||||
|
||||
cgltf_result cgltf_write_file(const cgltf_options* options, const char* path, const cgltf_data* data)
|
||||
{
|
||||
cgltf_size expected = cgltf_write(options, NULL, 0, data);
|
||||
@ -1044,13 +1185,18 @@ cgltf_result cgltf_write_file(const cgltf_options* options, const char* path, co
|
||||
if (expected != actual) {
|
||||
fprintf(stderr, "Error: expected %zu bytes but wrote %zu bytes.\n", expected, actual);
|
||||
}
|
||||
FILE* file = fopen(path, "wt");
|
||||
FILE* file = fopen(path, "wb");
|
||||
if (!file)
|
||||
{
|
||||
return cgltf_result_file_not_found;
|
||||
}
|
||||
// Note that cgltf_write() includes a null terminator, which we omit from the file content.
|
||||
fwrite(buffer, actual - 1, 1, file);
|
||||
if (options->type == cgltf_file_type_glb) {
|
||||
cgltf_write_glb(file, buffer, actual - 1, data->bin, data->bin_size);
|
||||
} else {
|
||||
// Write a plain JSON file.
|
||||
fwrite(buffer, actual - 1, 1, file);
|
||||
}
|
||||
fclose(file);
|
||||
free(buffer);
|
||||
return cgltf_result_success;
|
||||
@ -1097,6 +1243,15 @@ static void cgltf_write_extensions(cgltf_write_context* context, uint32_t extens
|
||||
if (extension_flags & CGLTF_EXTENSION_FLAG_TEXTURE_BASISU) {
|
||||
cgltf_write_stritem(context, "KHR_texture_basisu");
|
||||
}
|
||||
if (extension_flags & CGLTF_EXTENSION_FLAG_MATERIALS_EMISSIVE_STRENGTH) {
|
||||
cgltf_write_stritem(context, "KHR_materials_emissive_strength");
|
||||
}
|
||||
if (extension_flags & CGLTF_EXTENSION_FLAG_MATERIALS_IRIDESCENCE) {
|
||||
cgltf_write_stritem(context, "KHR_materials_iridescence");
|
||||
}
|
||||
if (extension_flags & CGLTF_EXTENSION_FLAG_MESH_GPU_INSTANCING) {
|
||||
cgltf_write_stritem(context, "EXT_mesh_gpu_instancing");
|
||||
}
|
||||
}
|
||||
|
||||
cgltf_size cgltf_write(const cgltf_options* options, char* buffer, cgltf_size size, const cgltf_data* data)
|
||||
|
21
3rdparty/bgfx/3rdparty/dear-imgui/LICENSE.txt
vendored
Normal file
21
3rdparty/bgfx/3rdparty/dear-imgui/LICENSE.txt
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2022 Omar Cornut
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
2
3rdparty/bgfx/3rdparty/dear-imgui/imconfig.h
vendored
2
3rdparty/bgfx/3rdparty/dear-imgui/imconfig.h
vendored
@ -7,6 +7,8 @@
|
||||
#pragma once
|
||||
|
||||
#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
#define IMGUI_DISABLE_OBSOLETE_KEYIO
|
||||
#define IMGUI_DISABLE_DEFAULT_ALLOCATORS
|
||||
|
||||
//---- Define your own ImVector<> type if you don't want to use the provided implementation defined in imgui.h
|
||||
//#include <vector>
|
||||
|
5044
3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp
vendored
5044
3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp
vendored
File diff suppressed because it is too large
Load Diff
920
3rdparty/bgfx/3rdparty/dear-imgui/imgui.h
vendored
920
3rdparty/bgfx/3rdparty/dear-imgui/imgui.h
vendored
File diff suppressed because it is too large
Load Diff
1160
3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp
vendored
1160
3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp
vendored
File diff suppressed because it is too large
Load Diff
298
3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp
vendored
298
3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.85 WIP
|
||||
// dear imgui, v1.89.1 WIP
|
||||
// (drawing and font code)
|
||||
|
||||
/*
|
||||
@ -39,25 +39,12 @@ Index of this file:
|
||||
#endif
|
||||
|
||||
#include <stdio.h> // vsnprintf, sscanf, printf
|
||||
#if !defined(alloca)
|
||||
#if defined(__GLIBC__) || defined(__sun) || defined(__APPLE__) || defined(__NEWLIB__)
|
||||
#include <alloca.h> // alloca (glibc uses <alloca.h>. Note that Cygwin may have _WIN32 defined, so the order matters here)
|
||||
#elif defined(_WIN32)
|
||||
#include <malloc.h> // alloca
|
||||
#if !defined(alloca)
|
||||
#define alloca _alloca // for clang with MS Codegen
|
||||
#endif
|
||||
#else
|
||||
#include <stdlib.h> // alloca
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Visual Studio warnings
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (disable: 4127) // condition expression is constant
|
||||
#pragma warning (disable: 4505) // unreferenced local function has been removed (stb stuff)
|
||||
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
|
||||
#pragma warning (disable: 6255) // [Static Analyzer] _alloca indicates failure by raising a stack overflow exception. Consider using _malloca instead.
|
||||
#pragma warning (disable: 26451) // [Static Analyzer] Arithmetic overflow : Using operator 'xxx' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator 'xxx' to avoid overflow(io.2).
|
||||
#pragma warning (disable: 26812) // [Static Analyzer] The enum type 'xxx' is unscoped. Prefer 'enum class' over 'enum' (Enum.3). [MSVC Static Analyzer)
|
||||
#endif
|
||||
@ -67,9 +54,6 @@ Index of this file:
|
||||
#if __has_warning("-Wunknown-warning-option")
|
||||
#pragma clang diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx' // not all warnings are known by all Clang versions and they tend to be rename-happy.. so ignoring warnings triggers new warnings on some configuration. Great!
|
||||
#endif
|
||||
#if __has_warning("-Walloca")
|
||||
#pragma clang diagnostic ignored "-Walloca" // warning: use of function '__builtin_alloca' is discouraged
|
||||
#endif
|
||||
#pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx'
|
||||
#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast // yes, they are more terse.
|
||||
#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants ok.
|
||||
@ -90,7 +74,7 @@ Index of this file:
|
||||
#endif
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// [SECTION] STB libraries implementation
|
||||
// [SECTION] STB libraries implementation (for stb_truetype and stb_rect_pack)
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
// Compile time options:
|
||||
@ -393,7 +377,7 @@ void ImDrawListSharedData::SetCircleTessellationMaxError(float max_error)
|
||||
for (int i = 0; i < IM_ARRAYSIZE(CircleSegmentCounts); i++)
|
||||
{
|
||||
const float radius = (float)i;
|
||||
CircleSegmentCounts[i] = (ImU8)((i > 0) ? IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(radius, CircleSegmentMaxError) : 0);
|
||||
CircleSegmentCounts[i] = (ImU8)((i > 0) ? IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(radius, CircleSegmentMaxError) : IM_DRAWLIST_ARCFAST_SAMPLE_MAX);
|
||||
}
|
||||
ArcFastRadiusCutoff = IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_R(IM_DRAWLIST_ARCFAST_SAMPLE_MAX, CircleSegmentMaxError);
|
||||
}
|
||||
@ -402,10 +386,9 @@ void ImDrawListSharedData::SetCircleTessellationMaxError(float max_error)
|
||||
void ImDrawList::_ResetForNewFrame()
|
||||
{
|
||||
// Verify that the ImDrawCmd fields we want to memcmp() are contiguous in memory.
|
||||
// (those should be IM_STATIC_ASSERT() in theory but with our pre C++11 setup the whole check doesn't compile with GCC)
|
||||
IM_ASSERT(IM_OFFSETOF(ImDrawCmd, ClipRect) == 0);
|
||||
IM_ASSERT(IM_OFFSETOF(ImDrawCmd, TextureId) == sizeof(ImVec4));
|
||||
IM_ASSERT(IM_OFFSETOF(ImDrawCmd, VtxOffset) == sizeof(ImVec4) + sizeof(ImTextureID));
|
||||
IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, ClipRect) == 0);
|
||||
IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, TextureId) == sizeof(ImVec4));
|
||||
IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, VtxOffset) == sizeof(ImVec4) + sizeof(ImTextureID));
|
||||
|
||||
CmdBuffer.resize(0);
|
||||
IdxBuffer.resize(0);
|
||||
@ -473,6 +456,7 @@ void ImDrawList::_PopUnusedDrawCmd()
|
||||
|
||||
void ImDrawList::AddCallback(ImDrawCallback callback, void* callback_data)
|
||||
{
|
||||
IM_ASSERT_PARANOID(CmdBuffer.Size > 0);
|
||||
ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
|
||||
IM_ASSERT(curr_cmd->UserCallback == NULL);
|
||||
if (curr_cmd->ElemCount != 0)
|
||||
@ -487,16 +471,18 @@ void ImDrawList::AddCallback(ImDrawCallback callback, void* callback_data)
|
||||
}
|
||||
|
||||
// Compare ClipRect, TextureId and VtxOffset with a single memcmp()
|
||||
#define ImDrawCmd_HeaderSize (IM_OFFSETOF(ImDrawCmd, VtxOffset) + sizeof(unsigned int))
|
||||
#define ImDrawCmd_HeaderCompare(CMD_LHS, CMD_RHS) (memcmp(CMD_LHS, CMD_RHS, ImDrawCmd_HeaderSize)) // Compare ClipRect, TextureId, VtxOffset
|
||||
#define ImDrawCmd_HeaderCopy(CMD_DST, CMD_SRC) (memcpy(CMD_DST, CMD_SRC, ImDrawCmd_HeaderSize)) // Copy ClipRect, TextureId, VtxOffset
|
||||
#define ImDrawCmd_HeaderSize (IM_OFFSETOF(ImDrawCmd, VtxOffset) + sizeof(unsigned int))
|
||||
#define ImDrawCmd_HeaderCompare(CMD_LHS, CMD_RHS) (memcmp(CMD_LHS, CMD_RHS, ImDrawCmd_HeaderSize)) // Compare ClipRect, TextureId, VtxOffset
|
||||
#define ImDrawCmd_HeaderCopy(CMD_DST, CMD_SRC) (memcpy(CMD_DST, CMD_SRC, ImDrawCmd_HeaderSize)) // Copy ClipRect, TextureId, VtxOffset
|
||||
#define ImDrawCmd_AreSequentialIdxOffset(CMD_0, CMD_1) (CMD_0->IdxOffset + CMD_0->ElemCount == CMD_1->IdxOffset)
|
||||
|
||||
// Try to merge two last draw commands
|
||||
void ImDrawList::_TryMergeDrawCmds()
|
||||
{
|
||||
IM_ASSERT_PARANOID(CmdBuffer.Size > 0);
|
||||
ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
|
||||
ImDrawCmd* prev_cmd = curr_cmd - 1;
|
||||
if (ImDrawCmd_HeaderCompare(curr_cmd, prev_cmd) == 0 && curr_cmd->UserCallback == NULL && prev_cmd->UserCallback == NULL)
|
||||
if (ImDrawCmd_HeaderCompare(curr_cmd, prev_cmd) == 0 && ImDrawCmd_AreSequentialIdxOffset(prev_cmd, curr_cmd) && curr_cmd->UserCallback == NULL && prev_cmd->UserCallback == NULL)
|
||||
{
|
||||
prev_cmd->ElemCount += curr_cmd->ElemCount;
|
||||
CmdBuffer.pop_back();
|
||||
@ -508,6 +494,7 @@ void ImDrawList::_TryMergeDrawCmds()
|
||||
void ImDrawList::_OnChangedClipRect()
|
||||
{
|
||||
// If current command is used with different settings we need to add a new command
|
||||
IM_ASSERT_PARANOID(CmdBuffer.Size > 0);
|
||||
ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
|
||||
if (curr_cmd->ElemCount != 0 && memcmp(&curr_cmd->ClipRect, &_CmdHeader.ClipRect, sizeof(ImVec4)) != 0)
|
||||
{
|
||||
@ -518,7 +505,7 @@ void ImDrawList::_OnChangedClipRect()
|
||||
|
||||
// Try to merge with previous command if it matches, else use current command
|
||||
ImDrawCmd* prev_cmd = curr_cmd - 1;
|
||||
if (curr_cmd->ElemCount == 0 && CmdBuffer.Size > 1 && ImDrawCmd_HeaderCompare(&_CmdHeader, prev_cmd) == 0 && prev_cmd->UserCallback == NULL)
|
||||
if (curr_cmd->ElemCount == 0 && CmdBuffer.Size > 1 && ImDrawCmd_HeaderCompare(&_CmdHeader, prev_cmd) == 0 && ImDrawCmd_AreSequentialIdxOffset(prev_cmd, curr_cmd) && prev_cmd->UserCallback == NULL)
|
||||
{
|
||||
CmdBuffer.pop_back();
|
||||
return;
|
||||
@ -530,6 +517,7 @@ void ImDrawList::_OnChangedClipRect()
|
||||
void ImDrawList::_OnChangedTextureID()
|
||||
{
|
||||
// If current command is used with different settings we need to add a new command
|
||||
IM_ASSERT_PARANOID(CmdBuffer.Size > 0);
|
||||
ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
|
||||
if (curr_cmd->ElemCount != 0 && curr_cmd->TextureId != _CmdHeader.TextureId)
|
||||
{
|
||||
@ -540,7 +528,7 @@ void ImDrawList::_OnChangedTextureID()
|
||||
|
||||
// Try to merge with previous command if it matches, else use current command
|
||||
ImDrawCmd* prev_cmd = curr_cmd - 1;
|
||||
if (curr_cmd->ElemCount == 0 && CmdBuffer.Size > 1 && ImDrawCmd_HeaderCompare(&_CmdHeader, prev_cmd) == 0 && prev_cmd->UserCallback == NULL)
|
||||
if (curr_cmd->ElemCount == 0 && CmdBuffer.Size > 1 && ImDrawCmd_HeaderCompare(&_CmdHeader, prev_cmd) == 0 && ImDrawCmd_AreSequentialIdxOffset(prev_cmd, curr_cmd) && prev_cmd->UserCallback == NULL)
|
||||
{
|
||||
CmdBuffer.pop_back();
|
||||
return;
|
||||
@ -553,6 +541,7 @@ void ImDrawList::_OnChangedVtxOffset()
|
||||
{
|
||||
// We don't need to compare curr_cmd->VtxOffset != _CmdHeader.VtxOffset because we know it'll be different at the time we call this.
|
||||
_VtxCurrentIdx = 0;
|
||||
IM_ASSERT_PARANOID(CmdBuffer.Size > 0);
|
||||
ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
|
||||
//IM_ASSERT(curr_cmd->VtxOffset != _CmdHeader.VtxOffset); // See #3349
|
||||
if (curr_cmd->ElemCount != 0)
|
||||
@ -575,7 +564,7 @@ int ImDrawList::_CalcCircleAutoSegmentCount(float radius) const
|
||||
}
|
||||
|
||||
// Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling)
|
||||
void ImDrawList::PushClipRect(ImVec2 cr_min, ImVec2 cr_max, bool intersect_with_current_clip_rect)
|
||||
void ImDrawList::PushClipRect(const ImVec2& cr_min, const ImVec2& cr_max, bool intersect_with_current_clip_rect)
|
||||
{
|
||||
ImVec4 cr(cr_min.x, cr_min.y, cr_max.x, cr_max.y);
|
||||
if (intersect_with_current_clip_rect)
|
||||
@ -748,7 +737,8 @@ void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32
|
||||
|
||||
// Temporary buffer
|
||||
// The first <points_count> items are normals at each line point, then after that there are either 2 or 4 temp points for each line point
|
||||
ImVec2* temp_normals = (ImVec2*)alloca(points_count * ((use_texture || !thick_line) ? 3 : 5) * sizeof(ImVec2)); //-V630
|
||||
_Data->TempBuffer.reserve_discard(points_count * ((use_texture || !thick_line) ? 3 : 5));
|
||||
ImVec2* temp_normals = _Data->TempBuffer.Data;
|
||||
ImVec2* temp_points = temp_normals + points_count;
|
||||
|
||||
// Calculate normals (tangents) for each line segment
|
||||
@ -968,7 +958,8 @@ void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32
|
||||
}
|
||||
}
|
||||
|
||||
// We intentionally avoid using ImVec2 and its math operators here to reduce cost to a minimum for debug/non-inlined builds.
|
||||
// - We intentionally avoid using ImVec2 and its math operators here to reduce cost to a minimum for debug/non-inlined builds.
|
||||
// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
||||
void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_count, ImU32 col)
|
||||
{
|
||||
if (points_count < 3)
|
||||
@ -995,7 +986,8 @@ void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_coun
|
||||
}
|
||||
|
||||
// Compute normals
|
||||
ImVec2* temp_normals = (ImVec2*)alloca(points_count * sizeof(ImVec2)); //-V630
|
||||
_Data->TempBuffer.reserve_discard(points_count);
|
||||
ImVec2* temp_normals = _Data->TempBuffer.Data;
|
||||
for (int i0 = points_count - 1, i1 = 0; i1 < points_count; i0 = i1++)
|
||||
{
|
||||
const ImVec2& p0 = points[i0];
|
||||
@ -1052,7 +1044,7 @@ void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_coun
|
||||
|
||||
void ImDrawList::_PathArcToFastEx(const ImVec2& center, float radius, int a_min_sample, int a_max_sample, int a_step)
|
||||
{
|
||||
if (radius <= 0.0f)
|
||||
if (radius < 0.5f)
|
||||
{
|
||||
_Path.push_back(center);
|
||||
return;
|
||||
@ -1144,7 +1136,7 @@ void ImDrawList::_PathArcToFastEx(const ImVec2& center, float radius, int a_min_
|
||||
|
||||
void ImDrawList::_PathArcToN(const ImVec2& center, float radius, float a_min, float a_max, int num_segments)
|
||||
{
|
||||
if (radius <= 0.0f)
|
||||
if (radius < 0.5f)
|
||||
{
|
||||
_Path.push_back(center);
|
||||
return;
|
||||
@ -1163,7 +1155,7 @@ void ImDrawList::_PathArcToN(const ImVec2& center, float radius, float a_min, fl
|
||||
// 0: East, 3: South, 6: West, 9: North, 12: East
|
||||
void ImDrawList::PathArcToFast(const ImVec2& center, float radius, int a_min_of_12, int a_max_of_12)
|
||||
{
|
||||
if (radius <= 0.0f)
|
||||
if (radius < 0.5f)
|
||||
{
|
||||
_Path.push_back(center);
|
||||
return;
|
||||
@ -1173,7 +1165,7 @@ void ImDrawList::PathArcToFast(const ImVec2& center, float radius, int a_min_of_
|
||||
|
||||
void ImDrawList::PathArcTo(const ImVec2& center, float radius, float a_min, float a_max, int num_segments)
|
||||
{
|
||||
if (radius <= 0.0f)
|
||||
if (radius < 0.5f)
|
||||
{
|
||||
_Path.push_back(center);
|
||||
return;
|
||||
@ -1201,8 +1193,8 @@ void ImDrawList::PathArcTo(const ImVec2& center, float radius, float a_min, floa
|
||||
|
||||
const float a_min_segment_angle = a_min_sample * IM_PI * 2.0f / IM_DRAWLIST_ARCFAST_SAMPLE_MAX;
|
||||
const float a_max_segment_angle = a_max_sample * IM_PI * 2.0f / IM_DRAWLIST_ARCFAST_SAMPLE_MAX;
|
||||
const bool a_emit_start = (a_min_segment_angle - a_min) != 0.0f;
|
||||
const bool a_emit_end = (a_max - a_max_segment_angle) != 0.0f;
|
||||
const bool a_emit_start = ImAbs(a_min_segment_angle - a_min) >= 1e-5f;
|
||||
const bool a_emit_end = ImAbs(a_max - a_max_segment_angle) >= 1e-5f;
|
||||
|
||||
_Path.reserve(_Path.Size + (a_mid_samples + 1 + (a_emit_start ? 1 : 0) + (a_emit_end ? 1 : 0)));
|
||||
if (a_emit_start)
|
||||
@ -1289,6 +1281,7 @@ void ImDrawList::PathBezierCubicCurveTo(const ImVec2& p2, const ImVec2& p3, cons
|
||||
ImVec2 p1 = _Path.back();
|
||||
if (num_segments == 0)
|
||||
{
|
||||
IM_ASSERT(_Data->CurveTessellationTol > 0.0f);
|
||||
PathBezierCubicCurveToCasteljau(&_Path, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, _Data->CurveTessellationTol, 0); // Auto-tessellated
|
||||
}
|
||||
else
|
||||
@ -1304,6 +1297,7 @@ void ImDrawList::PathBezierQuadraticCurveTo(const ImVec2& p2, const ImVec2& p3,
|
||||
ImVec2 p1 = _Path.back();
|
||||
if (num_segments == 0)
|
||||
{
|
||||
IM_ASSERT(_Data->CurveTessellationTol > 0.0f);
|
||||
PathBezierQuadraticCurveToCasteljau(&_Path, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, _Data->CurveTessellationTol, 0);// Auto-tessellated
|
||||
}
|
||||
else
|
||||
@ -1318,6 +1312,7 @@ IM_STATIC_ASSERT(ImDrawFlags_RoundCornersTopLeft == (1 << 4));
|
||||
static inline ImDrawFlags FixRectCornerFlags(ImDrawFlags flags)
|
||||
{
|
||||
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
// Obsoleted in 1.82 (from February 2021)
|
||||
// Legacy Support for hard coded ~0 (used to be a suggested equivalent to ImDrawCornerFlags_All)
|
||||
// ~0 --> ImDrawFlags_RoundCornersAll or 0
|
||||
if (flags == ~0)
|
||||
@ -1354,7 +1349,7 @@ void ImDrawList::PathRect(const ImVec2& a, const ImVec2& b, float rounding, ImDr
|
||||
rounding = ImMin(rounding, ImFabs(b.x - a.x) * ( ((flags & ImDrawFlags_RoundCornersTop) == ImDrawFlags_RoundCornersTop) || ((flags & ImDrawFlags_RoundCornersBottom) == ImDrawFlags_RoundCornersBottom) ? 0.5f : 1.0f ) - 1.0f);
|
||||
rounding = ImMin(rounding, ImFabs(b.y - a.y) * ( ((flags & ImDrawFlags_RoundCornersLeft) == ImDrawFlags_RoundCornersLeft) || ((flags & ImDrawFlags_RoundCornersRight) == ImDrawFlags_RoundCornersRight) ? 0.5f : 1.0f ) - 1.0f);
|
||||
|
||||
if (rounding <= 0.0f || (flags & ImDrawFlags_RoundCornersMask_) == ImDrawFlags_RoundCornersNone)
|
||||
if (rounding < 0.5f || (flags & ImDrawFlags_RoundCornersMask_) == ImDrawFlags_RoundCornersNone)
|
||||
{
|
||||
PathLineTo(a);
|
||||
PathLineTo(ImVec2(b.x, a.y));
|
||||
@ -1400,7 +1395,7 @@ void ImDrawList::AddRectFilled(const ImVec2& p_min, const ImVec2& p_max, ImU32 c
|
||||
{
|
||||
if ((col & IM_COL32_A_MASK) == 0)
|
||||
return;
|
||||
if (rounding <= 0.0f || (flags & ImDrawFlags_RoundCornersMask_) == ImDrawFlags_RoundCornersNone)
|
||||
if (rounding < 0.5f || (flags & ImDrawFlags_RoundCornersMask_) == ImDrawFlags_RoundCornersNone)
|
||||
{
|
||||
PrimReserve(6, 4);
|
||||
PrimRect(p_min, p_max, col);
|
||||
@ -1476,7 +1471,7 @@ void ImDrawList::AddTriangleFilled(const ImVec2& p1, const ImVec2& p2, const ImV
|
||||
|
||||
void ImDrawList::AddCircle(const ImVec2& center, float radius, ImU32 col, int num_segments, float thickness)
|
||||
{
|
||||
if ((col & IM_COL32_A_MASK) == 0 || radius <= 0.0f)
|
||||
if ((col & IM_COL32_A_MASK) == 0 || radius < 0.5f)
|
||||
return;
|
||||
|
||||
if (num_segments <= 0)
|
||||
@ -1500,7 +1495,7 @@ void ImDrawList::AddCircle(const ImVec2& center, float radius, ImU32 col, int nu
|
||||
|
||||
void ImDrawList::AddCircleFilled(const ImVec2& center, float radius, ImU32 col, int num_segments)
|
||||
{
|
||||
if ((col & IM_COL32_A_MASK) == 0 || radius <= 0.0f)
|
||||
if ((col & IM_COL32_A_MASK) == 0 || radius < 0.5f)
|
||||
return;
|
||||
|
||||
if (num_segments <= 0)
|
||||
@ -1640,7 +1635,7 @@ void ImDrawList::AddImageRounded(ImTextureID user_texture_id, const ImVec2& p_mi
|
||||
return;
|
||||
|
||||
flags = FixRectCornerFlags(flags);
|
||||
if (rounding <= 0.0f || (flags & ImDrawFlags_RoundCornersMask_) == ImDrawFlags_RoundCornersNone)
|
||||
if (rounding < 0.5f || (flags & ImDrawFlags_RoundCornersMask_) == ImDrawFlags_RoundCornersNone)
|
||||
{
|
||||
AddImage(user_texture_id, p_min, p_max, uv_min, uv_max, col);
|
||||
return;
|
||||
@ -1728,13 +1723,13 @@ void ImDrawListSplitter::Merge(ImDrawList* draw_list)
|
||||
for (int i = 1; i < _Count; i++)
|
||||
{
|
||||
ImDrawChannel& ch = _Channels[i];
|
||||
|
||||
// Equivalent of PopUnusedDrawCmd() for this channel's cmdbuffer and except we don't need to test for UserCallback.
|
||||
if (ch._CmdBuffer.Size > 0 && ch._CmdBuffer.back().ElemCount == 0)
|
||||
if (ch._CmdBuffer.Size > 0 && ch._CmdBuffer.back().ElemCount == 0 && ch._CmdBuffer.back().UserCallback == NULL) // Equivalent of PopUnusedDrawCmd()
|
||||
ch._CmdBuffer.pop_back();
|
||||
|
||||
if (ch._CmdBuffer.Size > 0 && last_cmd != NULL)
|
||||
{
|
||||
// Do not include ImDrawCmd_AreSequentialIdxOffset() in the compare as we rebuild IdxOffset values ourselves.
|
||||
// Manipulating IdxOffset (e.g. by reordering draw commands like done by RenderDimmedBackgroundBehindWindow()) is not supported within a splitter.
|
||||
ImDrawCmd* next_cmd = &ch._CmdBuffer[0];
|
||||
if (ImDrawCmd_HeaderCompare(last_cmd, next_cmd) == 0 && last_cmd->UserCallback == NULL && next_cmd->UserCallback == NULL)
|
||||
{
|
||||
@ -1919,37 +1914,38 @@ ImFontConfig::ImFontConfig()
|
||||
|
||||
// A work of art lies ahead! (. = white layer, X = black layer, others are blank)
|
||||
// The 2x2 white texels on the top left are the ones we'll use everywhere in Dear ImGui to render filled shapes.
|
||||
const int FONT_ATLAS_DEFAULT_TEX_DATA_W = 108; // Actual texture will be 2 times that + 1 spacing.
|
||||
// (This is used when io.MouseDrawCursor = true)
|
||||
const int FONT_ATLAS_DEFAULT_TEX_DATA_W = 122; // Actual texture will be 2 times that + 1 spacing.
|
||||
const int FONT_ATLAS_DEFAULT_TEX_DATA_H = 27;
|
||||
static const char FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS[FONT_ATLAS_DEFAULT_TEX_DATA_W * FONT_ATLAS_DEFAULT_TEX_DATA_H + 1] =
|
||||
{
|
||||
"..- -XXXXXXX- X - X -XXXXXXX - XXXXXXX- XX "
|
||||
"..- -X.....X- X.X - X.X -X.....X - X.....X- X..X "
|
||||
"--- -XXX.XXX- X...X - X...X -X....X - X....X- X..X "
|
||||
"X - X.X - X.....X - X.....X -X...X - X...X- X..X "
|
||||
"XX - X.X -X.......X- X.......X -X..X.X - X.X..X- X..X "
|
||||
"X.X - X.X -XXXX.XXXX- XXXX.XXXX -X.X X.X - X.X X.X- X..XXX "
|
||||
"X..X - X.X - X.X - X.X -XX X.X - X.X XX- X..X..XXX "
|
||||
"X...X - X.X - X.X - XX X.X XX - X.X - X.X - X..X..X..XX "
|
||||
"X....X - X.X - X.X - X.X X.X X.X - X.X - X.X - X..X..X..X.X "
|
||||
"X.....X - X.X - X.X - X..X X.X X..X - X.X - X.X -XXX X..X..X..X..X"
|
||||
"X......X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X XX-XX X.X -X..XX........X..X"
|
||||
"X.......X - X.X - X.X -X.....................X- X.X X.X-X.X X.X -X...X...........X"
|
||||
"X........X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X..X-X..X.X - X..............X"
|
||||
"X.........X -XXX.XXX- X.X - X..X X.X X..X - X...X-X...X - X.............X"
|
||||
"X..........X-X.....X- X.X - X.X X.X X.X - X....X-X....X - X.............X"
|
||||
"X......XXXXX-XXXXXXX- X.X - XX X.X XX - X.....X-X.....X - X............X"
|
||||
"X...X..X --------- X.X - X.X - XXXXXXX-XXXXXXX - X...........X "
|
||||
"X..X X..X - -XXXX.XXXX- XXXX.XXXX ------------------------------------- X..........X "
|
||||
"X.X X..X - -X.......X- X.......X - XX XX - - X..........X "
|
||||
"XX X..X - - X.....X - X.....X - X.X X.X - - X........X "
|
||||
" X..X - X...X - X...X - X..X X..X - - X........X "
|
||||
" XX - X.X - X.X - X...XXXXXXXXXXXXX...X - - XXXXXXXXXX "
|
||||
"------------ - X - X -X.....................X- ------------------"
|
||||
" ----------------------------------- X...XXXXXXXXXXXXX...X - "
|
||||
" - X..X X..X - "
|
||||
" - X.X X.X - "
|
||||
" - XX XX - "
|
||||
"..- -XXXXXXX- X - X -XXXXXXX - XXXXXXX- XX - XX XX "
|
||||
"..- -X.....X- X.X - X.X -X.....X - X.....X- X..X -X..X X..X"
|
||||
"--- -XXX.XXX- X...X - X...X -X....X - X....X- X..X -X...X X...X"
|
||||
"X - X.X - X.....X - X.....X -X...X - X...X- X..X - X...X X...X "
|
||||
"XX - X.X -X.......X- X.......X -X..X.X - X.X..X- X..X - X...X...X "
|
||||
"X.X - X.X -XXXX.XXXX- XXXX.XXXX -X.X X.X - X.X X.X- X..XXX - X.....X "
|
||||
"X..X - X.X - X.X - X.X -XX X.X - X.X XX- X..X..XXX - X...X "
|
||||
"X...X - X.X - X.X - XX X.X XX - X.X - X.X - X..X..X..XX - X.X "
|
||||
"X....X - X.X - X.X - X.X X.X X.X - X.X - X.X - X..X..X..X.X - X...X "
|
||||
"X.....X - X.X - X.X - X..X X.X X..X - X.X - X.X -XXX X..X..X..X..X- X.....X "
|
||||
"X......X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X XX-XX X.X -X..XX........X..X- X...X...X "
|
||||
"X.......X - X.X - X.X -X.....................X- X.X X.X-X.X X.X -X...X...........X- X...X X...X "
|
||||
"X........X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X..X-X..X.X - X..............X-X...X X...X"
|
||||
"X.........X -XXX.XXX- X.X - X..X X.X X..X - X...X-X...X - X.............X-X..X X..X"
|
||||
"X..........X-X.....X- X.X - X.X X.X X.X - X....X-X....X - X.............X- XX XX "
|
||||
"X......XXXXX-XXXXXXX- X.X - XX X.X XX - X.....X-X.....X - X............X--------------"
|
||||
"X...X..X --------- X.X - X.X - XXXXXXX-XXXXXXX - X...........X - "
|
||||
"X..X X..X - -XXXX.XXXX- XXXX.XXXX ------------------------------------- X..........X - "
|
||||
"X.X X..X - -X.......X- X.......X - XX XX - - X..........X - "
|
||||
"XX X..X - - X.....X - X.....X - X.X X.X - - X........X - "
|
||||
" X..X - - X...X - X...X - X..X X..X - - X........X - "
|
||||
" XX - - X.X - X.X - X...XXXXXXXXXXXXX...X - - XXXXXXXXXX - "
|
||||
"------------- - X - X -X.....................X- ------------------- "
|
||||
" ----------------------------------- X...XXXXXXXXXXXXX...X - "
|
||||
" - X..X X..X - "
|
||||
" - X.X X.X - "
|
||||
" - XX XX - "
|
||||
};
|
||||
|
||||
static const ImVec2 FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[ImGuiMouseCursor_COUNT][3] =
|
||||
@ -1963,6 +1959,7 @@ static const ImVec2 FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[ImGuiMouseCursor_COUNT][3
|
||||
{ ImVec2(73,0), ImVec2(17,17), ImVec2( 8, 8) }, // ImGuiMouseCursor_ResizeNESW
|
||||
{ ImVec2(55,0), ImVec2(17,17), ImVec2( 8, 8) }, // ImGuiMouseCursor_ResizeNWSE
|
||||
{ ImVec2(91,0), ImVec2(17,22), ImVec2( 5, 0) }, // ImGuiMouseCursor_Hand
|
||||
{ ImVec2(109,0),ImVec2(13,15), ImVec2( 6, 7) }, // ImGuiMouseCursor_NotAllowed
|
||||
};
|
||||
|
||||
ImFontAtlas::ImFontAtlas()
|
||||
@ -2290,10 +2287,11 @@ void ImFontAtlasBuildMultiplyCalcLookupTable(unsigned char out_table[256], fl
|
||||
|
||||
void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256], unsigned char* pixels, int x, int y, int w, int h, int stride)
|
||||
{
|
||||
IM_ASSERT_PARANOID(w <= stride);
|
||||
unsigned char* data = pixels + x + y * stride;
|
||||
for (int j = h; j > 0; j--, data += stride)
|
||||
for (int i = 0; i < w; i++)
|
||||
data[i] = table[data[i]];
|
||||
for (int j = h; j > 0; j--, data += stride - w)
|
||||
for (int i = w; i > 0; i--, data++)
|
||||
*data = table[*data];
|
||||
}
|
||||
|
||||
#ifdef IMGUI_ENABLE_STB_TRUETYPE
|
||||
@ -2310,7 +2308,7 @@ struct ImFontBuildSrcData
|
||||
int GlyphsHighest; // Highest requested codepoint
|
||||
int GlyphsCount; // Glyph count (excluding missing glyphs and glyphs already set by an earlier source font)
|
||||
ImBitVector GlyphsSet; // Glyph bit map (random access, 1-bit per codepoint. This will be a maximum of 8KB)
|
||||
ImVector<int> GlyphsList; // Glyph codepoints list (flattened version of GlyphsMap)
|
||||
ImVector<int> GlyphsList; // Glyph codepoints list (flattened version of GlyphsSet)
|
||||
};
|
||||
|
||||
// Temporary data for one destination ImFont* (multiple source fonts can be merged into one destination ImFont)
|
||||
@ -2630,8 +2628,8 @@ void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* stbrp_context_opa
|
||||
for (int i = 0; i < pack_rects.Size; i++)
|
||||
if (pack_rects[i].was_packed)
|
||||
{
|
||||
user_rects[i].X = pack_rects[i].x;
|
||||
user_rects[i].Y = pack_rects[i].y;
|
||||
user_rects[i].X = (unsigned short)pack_rects[i].x;
|
||||
user_rects[i].Y = (unsigned short)pack_rects[i].y;
|
||||
IM_ASSERT(pack_rects[i].w == user_rects[i].Width && pack_rects[i].h == user_rects[i].Height);
|
||||
atlas->TexHeight = ImMax(atlas->TexHeight, pack_rects[i].y + pack_rects[i].h);
|
||||
}
|
||||
@ -2731,13 +2729,13 @@ static void ImFontAtlasBuildRenderLinesTexData(ImFontAtlas* atlas)
|
||||
{
|
||||
unsigned int* write_ptr = &atlas->TexPixelsRGBA32[r->X + ((r->Y + y) * atlas->TexWidth)];
|
||||
for (unsigned int i = 0; i < pad_left; i++)
|
||||
*(write_ptr + i) = IM_COL32_BLACK_TRANS;
|
||||
*(write_ptr + i) = IM_COL32(255, 255, 255, 0);
|
||||
|
||||
for (unsigned int i = 0; i < line_width; i++)
|
||||
*(write_ptr + pad_left + i) = IM_COL32_WHITE;
|
||||
|
||||
for (unsigned int i = 0; i < pad_right; i++)
|
||||
*(write_ptr + pad_left + line_width + i) = IM_COL32_BLACK_TRANS;
|
||||
*(write_ptr + pad_left + line_width + i) = IM_COL32(255, 255, 255, 0);
|
||||
}
|
||||
|
||||
// Calculate UVs for this line
|
||||
@ -2810,6 +2808,17 @@ const ImWchar* ImFontAtlas::GetGlyphRangesDefault()
|
||||
return &ranges[0];
|
||||
}
|
||||
|
||||
const ImWchar* ImFontAtlas::GetGlyphRangesGreek()
|
||||
{
|
||||
static const ImWchar ranges[] =
|
||||
{
|
||||
0x0020, 0x00FF, // Basic Latin + Latin Supplement
|
||||
0x0370, 0x03FF, // Greek and Coptic
|
||||
0,
|
||||
};
|
||||
return &ranges[0];
|
||||
}
|
||||
|
||||
const ImWchar* ImFontAtlas::GetGlyphRangesKorean()
|
||||
{
|
||||
static const ImWchar ranges[] =
|
||||
@ -3073,8 +3082,8 @@ void ImFontGlyphRangesBuilder::AddText(const char* text, const char* text_end)
|
||||
void ImFontGlyphRangesBuilder::AddRanges(const ImWchar* ranges)
|
||||
{
|
||||
for (; ranges[0]; ranges += 2)
|
||||
for (ImWchar c = ranges[0]; c <= ranges[1]; c++)
|
||||
AddChar(c);
|
||||
for (unsigned int c = ranges[0]; c <= ranges[1] && c <= IM_UNICODE_CODEPOINT_MAX; c++) //-V560
|
||||
AddChar((ImWchar)c);
|
||||
}
|
||||
|
||||
void ImFontGlyphRangesBuilder::BuildRanges(ImVector<ImWchar>* out_ranges)
|
||||
@ -3322,11 +3331,21 @@ const ImFontGlyph* ImFont::FindGlyphNoFallback(ImWchar c) const
|
||||
return &Glyphs.Data[i];
|
||||
}
|
||||
|
||||
// Wrapping skips upcoming blanks
|
||||
static inline const char* CalcWordWrapNextLineStartA(const char* text, const char* text_end)
|
||||
{
|
||||
while (text < text_end && ImCharIsBlankA(*text))
|
||||
text++;
|
||||
if (*text == '\n')
|
||||
text++;
|
||||
return text;
|
||||
}
|
||||
|
||||
// Simple word-wrapping for English, not full-featured. Please submit failing cases!
|
||||
// This will return the next location to wrap from. If no wrapping if necessary, this will fast-forward to e.g. text_end.
|
||||
// FIXME: Much possible improvements (don't cut things like "word !", "word!!!" but cut within "word,,,,", more sensible support for punctuations, support for Unicode punctuations, etc.)
|
||||
const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const
|
||||
{
|
||||
// Simple word-wrapping for English, not full-featured. Please submit failing cases!
|
||||
// FIXME: Much possible improvements (don't cut things like "word !", "word!!!" but cut within "word,,,,", more sensible support for punctuations, support for Unicode punctuations, etc.)
|
||||
|
||||
// For references, possible wrap point marked with ^
|
||||
// "aaa bbb, ccc,ddd. eee fff. ggg!"
|
||||
// ^ ^ ^ ^ ^__ ^ ^
|
||||
@ -3338,7 +3357,6 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c
|
||||
|
||||
// Cut words that cannot possibly fit within one line.
|
||||
// e.g.: "The tropical fish" with ~5 characters worth of width --> "The tr" "opical" "fish"
|
||||
|
||||
float line_width = 0.0f;
|
||||
float word_width = 0.0f;
|
||||
float blank_width = 0.0f;
|
||||
@ -3418,6 +3436,10 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c
|
||||
s = next_s;
|
||||
}
|
||||
|
||||
// Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity.
|
||||
// +1 may not be a character start point in UTF-8 but it's ok because caller loops use (text >= word_wrap_eol).
|
||||
if (s == text && text < text_end)
|
||||
return s + 1;
|
||||
return s;
|
||||
}
|
||||
|
||||
@ -3442,11 +3464,7 @@ ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, cons
|
||||
{
|
||||
// Calculate how far we can render. Requires two passes on the string data but keeps the code simple and not intrusive for what's essentially an uncommon feature.
|
||||
if (!word_wrap_eol)
|
||||
{
|
||||
word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - line_width);
|
||||
if (word_wrap_eol == s) // Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity.
|
||||
word_wrap_eol++; // +1 may not be a character start point in UTF-8 but it's ok because we use s >= word_wrap_eol below
|
||||
}
|
||||
|
||||
if (s >= word_wrap_eol)
|
||||
{
|
||||
@ -3455,13 +3473,7 @@ ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, cons
|
||||
text_size.y += line_height;
|
||||
line_width = 0.0f;
|
||||
word_wrap_eol = NULL;
|
||||
|
||||
// Wrapping skips upcoming blanks
|
||||
while (s < text_end)
|
||||
{
|
||||
const char c = *s;
|
||||
if (ImCharIsBlankA(c)) { s++; } else if (c == '\n') { s++; break; } else { break; }
|
||||
}
|
||||
s = CalcWordWrapNextLineStartA(s, text_end); // Wrapping skips upcoming blanks
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -3516,7 +3528,7 @@ ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, cons
|
||||
}
|
||||
|
||||
// Note: as with every ImDrawList drawing function, this expects that the font atlas texture is bound.
|
||||
void ImFont::RenderChar(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, ImWchar c) const
|
||||
void ImFont::RenderChar(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, ImWchar c) const
|
||||
{
|
||||
const ImFontGlyph* glyph = FindGlyph(c);
|
||||
if (!glyph || !glyph->Visible)
|
||||
@ -3524,38 +3536,47 @@ void ImFont::RenderChar(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
|
||||
if (glyph->Colored)
|
||||
col |= ~IM_COL32_A_MASK;
|
||||
float scale = (size >= 0.0f) ? (size / FontSize) : 1.0f;
|
||||
pos.x = IM_FLOOR(pos.x);
|
||||
pos.y = IM_FLOOR(pos.y);
|
||||
float x = IM_FLOOR(pos.x);
|
||||
float y = IM_FLOOR(pos.y);
|
||||
draw_list->PrimReserve(6, 4);
|
||||
draw_list->PrimRectUV(ImVec2(pos.x + glyph->X0 * scale, pos.y + glyph->Y0 * scale), ImVec2(pos.x + glyph->X1 * scale, pos.y + glyph->Y1 * scale), ImVec2(glyph->U0, glyph->V0), ImVec2(glyph->U1, glyph->V1), col);
|
||||
draw_list->PrimRectUV(ImVec2(x + glyph->X0 * scale, y + glyph->Y0 * scale), ImVec2(x + glyph->X1 * scale, y + glyph->Y1 * scale), ImVec2(glyph->U0, glyph->V0), ImVec2(glyph->U1, glyph->V1), col);
|
||||
}
|
||||
|
||||
// Note: as with every ImDrawList drawing function, this expects that the font atlas texture is bound.
|
||||
void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width, bool cpu_fine_clip) const
|
||||
void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width, bool cpu_fine_clip) const
|
||||
{
|
||||
if (!text_end)
|
||||
text_end = text_begin + strlen(text_begin); // ImGui:: functions generally already provides a valid text_end, so this is merely to handle direct calls.
|
||||
|
||||
// Align to be pixel perfect
|
||||
pos.x = IM_FLOOR(pos.x);
|
||||
pos.y = IM_FLOOR(pos.y);
|
||||
float x = pos.x;
|
||||
float y = pos.y;
|
||||
float x = IM_FLOOR(pos.x);
|
||||
float y = IM_FLOOR(pos.y);
|
||||
if (y > clip_rect.w)
|
||||
return;
|
||||
|
||||
const float start_x = x;
|
||||
const float scale = size / FontSize;
|
||||
const float line_height = FontSize * scale;
|
||||
const bool word_wrap_enabled = (wrap_width > 0.0f);
|
||||
const char* word_wrap_eol = NULL;
|
||||
|
||||
// Fast-forward to first visible line
|
||||
const char* s = text_begin;
|
||||
if (y + line_height < clip_rect.y && !word_wrap_enabled)
|
||||
if (y + line_height < clip_rect.y)
|
||||
while (y + line_height < clip_rect.y && s < text_end)
|
||||
{
|
||||
s = (const char*)memchr(s, '\n', text_end - s);
|
||||
s = s ? s + 1 : text_end;
|
||||
const char* line_end = (const char*)memchr(s, '\n', text_end - s);
|
||||
if (word_wrap_enabled)
|
||||
{
|
||||
// FIXME-OPT: This is not optimal as do first do a search for \n before calling CalcWordWrapPositionA().
|
||||
// If the specs for CalcWordWrapPositionA() were reworked to optionally return on \n we could combine both.
|
||||
// However it is still better than nothing performing the fast-forward!
|
||||
s = CalcWordWrapPositionA(scale, s, line_end, wrap_width);
|
||||
s = CalcWordWrapNextLineStartA(s, text_end);
|
||||
}
|
||||
else
|
||||
{
|
||||
s = line_end ? line_end + 1 : text_end;
|
||||
}
|
||||
y += line_height;
|
||||
}
|
||||
|
||||
@ -3587,6 +3608,7 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
|
||||
unsigned int vtx_current_idx = draw_list->_VtxCurrentIdx;
|
||||
|
||||
const ImU32 col_untinted = col | ~IM_COL32_A_MASK;
|
||||
const char* word_wrap_eol = NULL;
|
||||
|
||||
while (s < text_end)
|
||||
{
|
||||
@ -3594,24 +3616,14 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
|
||||
{
|
||||
// Calculate how far we can render. Requires two passes on the string data but keeps the code simple and not intrusive for what's essentially an uncommon feature.
|
||||
if (!word_wrap_eol)
|
||||
{
|
||||
word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - (x - pos.x));
|
||||
if (word_wrap_eol == s) // Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity.
|
||||
word_wrap_eol++; // +1 may not be a character start point in UTF-8 but it's ok because we use s >= word_wrap_eol below
|
||||
}
|
||||
word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - (x - start_x));
|
||||
|
||||
if (s >= word_wrap_eol)
|
||||
{
|
||||
x = pos.x;
|
||||
x = start_x;
|
||||
y += line_height;
|
||||
word_wrap_eol = NULL;
|
||||
|
||||
// Wrapping skips upcoming blanks
|
||||
while (s < text_end)
|
||||
{
|
||||
const char c = *s;
|
||||
if (ImCharIsBlankA(c)) { s++; } else if (c == '\n') { s++; break; } else { break; }
|
||||
}
|
||||
s = CalcWordWrapNextLineStartA(s, text_end); // Wrapping skips upcoming blanks
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -3633,7 +3645,7 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
|
||||
{
|
||||
if (c == '\n')
|
||||
{
|
||||
x = pos.x;
|
||||
x = start_x;
|
||||
y += line_height;
|
||||
if (y > clip_rect.w)
|
||||
break; // break out of main loop
|
||||
@ -3729,7 +3741,6 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
|
||||
// - RenderArrow()
|
||||
// - RenderBullet()
|
||||
// - RenderCheckMark()
|
||||
// - RenderMouseCursor()
|
||||
// - RenderArrowPointingAt()
|
||||
// - RenderRectFilledRangeH()
|
||||
// - RenderRectFilledWithHole()
|
||||
@ -3790,27 +3801,6 @@ void ImGui::RenderCheckMark(ImDrawList* draw_list, ImVec2 pos, ImU32 col, float
|
||||
draw_list->PathStroke(col, 0, thickness);
|
||||
}
|
||||
|
||||
void ImGui::RenderMouseCursor(ImDrawList* draw_list, ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow)
|
||||
{
|
||||
if (mouse_cursor == ImGuiMouseCursor_None)
|
||||
return;
|
||||
IM_ASSERT(mouse_cursor > ImGuiMouseCursor_None && mouse_cursor < ImGuiMouseCursor_COUNT);
|
||||
|
||||
ImFontAtlas* font_atlas = draw_list->_Data->Font->ContainerAtlas;
|
||||
ImVec2 offset, size, uv[4];
|
||||
if (font_atlas->GetMouseCursorTexData(mouse_cursor, &offset, &size, &uv[0], &uv[2]))
|
||||
{
|
||||
pos -= offset;
|
||||
ImTextureID tex_id = font_atlas->TexID;
|
||||
draw_list->PushTextureID(tex_id);
|
||||
draw_list->AddImage(tex_id, pos + ImVec2(1, 0) * scale, pos + (ImVec2(1, 0) + size) * scale, uv[2], uv[3], col_shadow);
|
||||
draw_list->AddImage(tex_id, pos + ImVec2(2, 0) * scale, pos + (ImVec2(2, 0) + size) * scale, uv[2], uv[3], col_shadow);
|
||||
draw_list->AddImage(tex_id, pos, pos + size * scale, uv[2], uv[3], col_border);
|
||||
draw_list->AddImage(tex_id, pos, pos + size * scale, uv[0], uv[1], col_fill);
|
||||
draw_list->PopTextureID();
|
||||
}
|
||||
}
|
||||
|
||||
// Render an arrow. 'pos' is position of the arrow tip. half_sz.x is length from base to tip. half_sz.y is length on each side.
|
||||
void ImGui::RenderArrowPointingAt(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, ImGuiDir direction, ImU32 col)
|
||||
{
|
||||
@ -3893,16 +3883,16 @@ void ImGui::RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, Im
|
||||
draw_list->PathFillConvex(col);
|
||||
}
|
||||
|
||||
void ImGui::RenderRectFilledWithHole(ImDrawList* draw_list, ImRect outer, ImRect inner, ImU32 col, float rounding)
|
||||
void ImGui::RenderRectFilledWithHole(ImDrawList* draw_list, const ImRect& outer, const ImRect& inner, ImU32 col, float rounding)
|
||||
{
|
||||
const bool fill_L = (inner.Min.x > outer.Min.x);
|
||||
const bool fill_R = (inner.Max.x < outer.Max.x);
|
||||
const bool fill_U = (inner.Min.y > outer.Min.y);
|
||||
const bool fill_D = (inner.Max.y < outer.Max.y);
|
||||
if (fill_L) draw_list->AddRectFilled(ImVec2(outer.Min.x, inner.Min.y), ImVec2(inner.Min.x, inner.Max.y), col, rounding, (fill_U ? 0 : ImDrawFlags_RoundCornersTopLeft) | (fill_D ? 0 : ImDrawFlags_RoundCornersBottomLeft));
|
||||
if (fill_R) draw_list->AddRectFilled(ImVec2(inner.Max.x, inner.Min.y), ImVec2(outer.Max.x, inner.Max.y), col, rounding, (fill_U ? 0 : ImDrawFlags_RoundCornersTopRight) | (fill_D ? 0 : ImDrawFlags_RoundCornersBottomRight));
|
||||
if (fill_U) draw_list->AddRectFilled(ImVec2(inner.Min.x, outer.Min.y), ImVec2(inner.Max.x, inner.Min.y), col, rounding, (fill_L ? 0 : ImDrawFlags_RoundCornersTopLeft) | (fill_R ? 0 : ImDrawFlags_RoundCornersTopRight));
|
||||
if (fill_D) draw_list->AddRectFilled(ImVec2(inner.Min.x, inner.Max.y), ImVec2(inner.Max.x, outer.Max.y), col, rounding, (fill_L ? 0 : ImDrawFlags_RoundCornersBottomLeft) | (fill_R ? 0 : ImDrawFlags_RoundCornersBottomRight));
|
||||
if (fill_L) draw_list->AddRectFilled(ImVec2(outer.Min.x, inner.Min.y), ImVec2(inner.Min.x, inner.Max.y), col, rounding, ImDrawFlags_RoundCornersNone | (fill_U ? 0 : ImDrawFlags_RoundCornersTopLeft) | (fill_D ? 0 : ImDrawFlags_RoundCornersBottomLeft));
|
||||
if (fill_R) draw_list->AddRectFilled(ImVec2(inner.Max.x, inner.Min.y), ImVec2(outer.Max.x, inner.Max.y), col, rounding, ImDrawFlags_RoundCornersNone | (fill_U ? 0 : ImDrawFlags_RoundCornersTopRight) | (fill_D ? 0 : ImDrawFlags_RoundCornersBottomRight));
|
||||
if (fill_U) draw_list->AddRectFilled(ImVec2(inner.Min.x, outer.Min.y), ImVec2(inner.Max.x, inner.Min.y), col, rounding, ImDrawFlags_RoundCornersNone | (fill_L ? 0 : ImDrawFlags_RoundCornersTopLeft) | (fill_R ? 0 : ImDrawFlags_RoundCornersTopRight));
|
||||
if (fill_D) draw_list->AddRectFilled(ImVec2(inner.Min.x, inner.Max.y), ImVec2(inner.Max.x, outer.Max.y), col, rounding, ImDrawFlags_RoundCornersNone | (fill_L ? 0 : ImDrawFlags_RoundCornersBottomLeft) | (fill_R ? 0 : ImDrawFlags_RoundCornersBottomRight));
|
||||
if (fill_L && fill_U) draw_list->AddRectFilled(ImVec2(outer.Min.x, outer.Min.y), ImVec2(inner.Min.x, inner.Min.y), col, rounding, ImDrawFlags_RoundCornersTopLeft);
|
||||
if (fill_R && fill_U) draw_list->AddRectFilled(ImVec2(inner.Max.x, outer.Min.y), ImVec2(outer.Max.x, inner.Min.y), col, rounding, ImDrawFlags_RoundCornersTopRight);
|
||||
if (fill_L && fill_D) draw_list->AddRectFilled(ImVec2(outer.Min.x, inner.Max.y), ImVec2(inner.Min.x, outer.Max.y), col, rounding, ImDrawFlags_RoundCornersBottomLeft);
|
||||
|
1028
3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h
vendored
1028
3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h
vendored
File diff suppressed because it is too large
Load Diff
146
3rdparty/bgfx/3rdparty/dear-imgui/imgui_tables.cpp
vendored
146
3rdparty/bgfx/3rdparty/dear-imgui/imgui_tables.cpp
vendored
@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.85 WIP
|
||||
// dear imgui, v1.89.1 WIP
|
||||
// (tables and columns code)
|
||||
|
||||
/*
|
||||
@ -24,7 +24,7 @@ Index of this file:
|
||||
*/
|
||||
|
||||
// Navigating this file:
|
||||
// - In Visual Studio IDE: CTRL+comma ("Edit.NavigateTo") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
|
||||
// - In Visual Studio IDE: CTRL+comma ("Edit.GoToAll") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
|
||||
// - With Visual Assist installed: ALT+G ("VAssistX.GoToImplementation") can also follow symbols in comments.
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -340,10 +340,9 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
|
||||
// Acquire temporary buffers
|
||||
const int table_idx = g.Tables.GetIndex(table);
|
||||
g.CurrentTableStackIdx++;
|
||||
if (g.CurrentTableStackIdx + 1 > g.TablesTempDataStack.Size)
|
||||
g.TablesTempDataStack.resize(g.CurrentTableStackIdx + 1, ImGuiTableTempData());
|
||||
ImGuiTableTempData* temp_data = table->TempData = &g.TablesTempDataStack[g.CurrentTableStackIdx];
|
||||
if (++g.TablesTempDataStacked > g.TablesTempData.Size)
|
||||
g.TablesTempData.resize(g.TablesTempDataStacked, ImGuiTableTempData());
|
||||
ImGuiTableTempData* temp_data = table->TempData = &g.TablesTempData[g.TablesTempDataStacked - 1];
|
||||
temp_data->TableIndex = table_idx;
|
||||
table->DrawSplitter = &table->TempData->DrawSplitter;
|
||||
table->DrawSplitter->Clear();
|
||||
@ -362,6 +361,8 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
table->IsLayoutLocked = false;
|
||||
table->InnerWidth = inner_width;
|
||||
temp_data->UserOuterSize = outer_size;
|
||||
if (instance_no > 0 && table->InstanceDataExtra.Size < instance_no)
|
||||
table->InstanceDataExtra.push_back(ImGuiTableInstanceData());
|
||||
|
||||
// When not using a child window, WorkRect.Max will grow as we append contents.
|
||||
if (use_child_window)
|
||||
@ -538,7 +539,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
if (table->RefScale != 0.0f && table->RefScale != new_ref_scale_unit)
|
||||
{
|
||||
const float scale_factor = new_ref_scale_unit / table->RefScale;
|
||||
//IMGUI_DEBUG_LOG("[table] %08X RefScaleUnit %.3f -> %.3f, scaling width by %.3f\n", table->ID, table->RefScaleUnit, new_ref_scale_unit, scale_factor);
|
||||
//IMGUI_DEBUG_PRINT("[table] %08X RefScaleUnit %.3f -> %.3f, scaling width by %.3f\n", table->ID, table->RefScaleUnit, new_ref_scale_unit, scale_factor);
|
||||
for (int n = 0; n < columns_count; n++)
|
||||
table->Columns[n].WidthRequest = table->Columns[n].WidthRequest * scale_factor;
|
||||
}
|
||||
@ -564,6 +565,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
||||
// + 0 (for ImGuiTable instance, we are pooling allocations in g.Tables)
|
||||
// + 1 (for table->RawData allocated below)
|
||||
// + 1 (for table->ColumnsNames, if names are used)
|
||||
// Shared allocations per number of nested tables
|
||||
// + 1 (for table->Splitter._Channels)
|
||||
// + 2 * active_channels_count (for ImDrawCmd and ImDrawIdx buffers inside channels)
|
||||
// Where active_channels_count is variable but often == columns_count or columns_count + 1, see TableSetupDrawChannels() for details.
|
||||
@ -886,6 +888,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
sum_width_requests += table->CellPaddingX * 2.0f;
|
||||
}
|
||||
table->ColumnsEnabledFixedCount = (ImGuiTableColumnIdx)count_fixed;
|
||||
table->ColumnsStretchSumWeights = stretch_sum_weights;
|
||||
|
||||
// [Part 4] Apply final widths based on requested widths
|
||||
const ImRect work_rect = table->WorkRect;
|
||||
@ -933,10 +936,19 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
width_remaining_for_stretched_columns -= 1.0f;
|
||||
}
|
||||
|
||||
// Determine if table is hovered which will be used to flag columns as hovered.
|
||||
// - In principle we'd like to use the equivalent of IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem),
|
||||
// but because our item is partially submitted at this point we use ItemHoverable() and a workaround (temporarily
|
||||
// clear ActiveId, which is equivalent to the change provided by _AllowWhenBLockedByActiveItem).
|
||||
// - This allows columns to be marked as hovered when e.g. clicking a button inside the column, or using drag and drop.
|
||||
ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
|
||||
table->HoveredColumnBody = -1;
|
||||
table->HoveredColumnBorder = -1;
|
||||
const ImRect mouse_hit_rect(table->OuterRect.Min.x, table->OuterRect.Min.y, table->OuterRect.Max.x, ImMax(table->OuterRect.Max.y, table->OuterRect.Min.y + table->LastOuterHeight));
|
||||
const ImRect mouse_hit_rect(table->OuterRect.Min.x, table->OuterRect.Min.y, table->OuterRect.Max.x, ImMax(table->OuterRect.Max.y, table->OuterRect.Min.y + table_instance->LastOuterHeight));
|
||||
const ImGuiID backup_active_id = g.ActiveId;
|
||||
g.ActiveId = 0;
|
||||
const bool is_hovering_table = ItemHoverable(mouse_hit_rect, 0);
|
||||
g.ActiveId = backup_active_id;
|
||||
|
||||
// [Part 6] Setup final position, offset, skip/clip states and clipping rectangles, detect hovered column
|
||||
// Process columns in their visible orders as we are comparing the visible order and adjusting host_clip_rect while looping.
|
||||
@ -1096,23 +1108,15 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||
// [Part 10] Hit testing on borders
|
||||
if (table->Flags & ImGuiTableFlags_Resizable)
|
||||
TableUpdateBorders(table);
|
||||
table->LastFirstRowHeight = 0.0f;
|
||||
table_instance->LastFirstRowHeight = 0.0f;
|
||||
table->IsLayoutLocked = true;
|
||||
table->IsUsingHeaders = false;
|
||||
|
||||
// [Part 11] Context menu
|
||||
if (table->IsContextPopupOpen && table->InstanceCurrent == table->InstanceInteracted)
|
||||
if (TableBeginContextMenuPopup(table))
|
||||
{
|
||||
const ImGuiID context_menu_id = ImHashStr("##ContextMenu", 0, table->ID);
|
||||
if (BeginPopupEx(context_menu_id, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings))
|
||||
{
|
||||
TableDrawContextMenu(table);
|
||||
EndPopup();
|
||||
}
|
||||
else
|
||||
{
|
||||
table->IsContextPopupOpen = false;
|
||||
}
|
||||
TableDrawContextMenu(table);
|
||||
EndPopup();
|
||||
}
|
||||
|
||||
// [Part 13] Sanitize and build sort specs before we have a change to use them for display.
|
||||
@ -1141,10 +1145,11 @@ void ImGui::TableUpdateBorders(ImGuiTable* table)
|
||||
// use the final height from last frame. Because this is only affecting _interaction_ with columns, it is not
|
||||
// really problematic (whereas the actual visual will be displayed in EndTable() and using the current frame height).
|
||||
// Actual columns highlight/render will be performed in EndTable() and not be affected.
|
||||
ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
|
||||
const float hit_half_width = TABLE_RESIZE_SEPARATOR_HALF_THICKNESS;
|
||||
const float hit_y1 = table->OuterRect.Min.y;
|
||||
const float hit_y2_body = ImMax(table->OuterRect.Max.y, hit_y1 + table->LastOuterHeight);
|
||||
const float hit_y2_head = hit_y1 + table->LastFirstRowHeight;
|
||||
const float hit_y2_body = ImMax(table->OuterRect.Max.y, hit_y1 + table_instance->LastOuterHeight);
|
||||
const float hit_y2_head = hit_y1 + table_instance->LastFirstRowHeight;
|
||||
|
||||
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
|
||||
{
|
||||
@ -1166,8 +1171,8 @@ void ImGui::TableUpdateBorders(ImGuiTable* table)
|
||||
|
||||
ImGuiID column_id = TableGetColumnResizeID(table, column_n, table->InstanceCurrent);
|
||||
ImRect hit_rect(column->MaxX - hit_half_width, hit_y1, column->MaxX + hit_half_width, border_y2_hit);
|
||||
ItemAdd(hit_rect, column_id, NULL, ImGuiItemFlags_NoNav);
|
||||
//GetForegroundDrawList()->AddRect(hit_rect.Min, hit_rect.Max, IM_COL32(255, 0, 0, 100));
|
||||
KeepAliveID(column_id);
|
||||
|
||||
bool hovered = false, held = false;
|
||||
bool pressed = ButtonBehavior(hit_rect, column_id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_AllowItemOverlap | ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_NoNavFocus);
|
||||
@ -1223,6 +1228,7 @@ void ImGui::EndTable()
|
||||
TableOpenContextMenu((int)table->HoveredColumnBody);
|
||||
|
||||
// Finalize table height
|
||||
ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
|
||||
inner_window->DC.PrevLineSize = temp_data->HostBackupPrevLineSize;
|
||||
inner_window->DC.CurrLineSize = temp_data->HostBackupCurrLineSize;
|
||||
inner_window->DC.CursorMaxPos = temp_data->HostBackupCursorMaxPos;
|
||||
@ -1233,7 +1239,7 @@ void ImGui::EndTable()
|
||||
else if (!(flags & ImGuiTableFlags_NoHostExtendY))
|
||||
table->OuterRect.Max.y = table->InnerRect.Max.y = ImMax(table->OuterRect.Max.y, inner_content_max_y); // Patch OuterRect/InnerRect height
|
||||
table->WorkRect.Max.y = ImMax(table->WorkRect.Max.y, table->OuterRect.Max.y);
|
||||
table->LastOuterHeight = table->OuterRect.GetHeight();
|
||||
table_instance->LastOuterHeight = table->OuterRect.GetHeight();
|
||||
|
||||
// Setup inner scrolling range
|
||||
// FIXME: This ideally should be done earlier, in BeginTable() SetNextWindowContentSize call, just like writing to inner_window->DC.CursorMaxPos.y,
|
||||
@ -1279,17 +1285,23 @@ void ImGui::EndTable()
|
||||
splitter->Merge(inner_window->DrawList);
|
||||
|
||||
// Update ColumnsAutoFitWidth to get us ahead for host using our size to auto-resize without waiting for next BeginTable()
|
||||
const float width_spacings = (table->OuterPaddingX * 2.0f) + (table->CellSpacingX1 + table->CellSpacingX2) * (table->ColumnsEnabledCount - 1);
|
||||
table->ColumnsAutoFitWidth = width_spacings + (table->CellPaddingX * 2.0f) * table->ColumnsEnabledCount;
|
||||
float auto_fit_width_for_fixed = 0.0f;
|
||||
float auto_fit_width_for_stretched = 0.0f;
|
||||
float auto_fit_width_for_stretched_min = 0.0f;
|
||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||
if (table->EnabledMaskByIndex & ((ImU64)1 << column_n))
|
||||
{
|
||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
||||
if ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !(column->Flags & ImGuiTableColumnFlags_NoResize))
|
||||
table->ColumnsAutoFitWidth += column->WidthRequest;
|
||||
float column_width_request = ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !(column->Flags & ImGuiTableColumnFlags_NoResize)) ? column->WidthRequest : TableGetColumnWidthAuto(table, column);
|
||||
if (column->Flags & ImGuiTableColumnFlags_WidthFixed)
|
||||
auto_fit_width_for_fixed += column_width_request;
|
||||
else
|
||||
table->ColumnsAutoFitWidth += TableGetColumnWidthAuto(table, column);
|
||||
auto_fit_width_for_stretched += column_width_request;
|
||||
if ((column->Flags & ImGuiTableColumnFlags_WidthStretch) && (column->Flags & ImGuiTableColumnFlags_NoResize) != 0)
|
||||
auto_fit_width_for_stretched_min = ImMax(auto_fit_width_for_stretched_min, column_width_request / (column->StretchWeight / table->ColumnsStretchSumWeights));
|
||||
}
|
||||
const float width_spacings = (table->OuterPaddingX * 2.0f) + (table->CellSpacingX1 + table->CellSpacingX2) * (table->ColumnsEnabledCount - 1);
|
||||
table->ColumnsAutoFitWidth = width_spacings + (table->CellPaddingX * 2.0f) * table->ColumnsEnabledCount + auto_fit_width_for_fixed + ImMax(auto_fit_width_for_stretched, auto_fit_width_for_stretched_min);
|
||||
|
||||
// Update scroll
|
||||
if ((table->Flags & ImGuiTableFlags_ScrollX) == 0 && inner_window != outer_window)
|
||||
@ -1381,9 +1393,8 @@ void ImGui::EndTable()
|
||||
|
||||
// Clear or restore current table, if any
|
||||
IM_ASSERT(g.CurrentWindow == outer_window && g.CurrentTable == table);
|
||||
IM_ASSERT(g.CurrentTableStackIdx >= 0);
|
||||
g.CurrentTableStackIdx--;
|
||||
temp_data = g.CurrentTableStackIdx >= 0 ? &g.TablesTempDataStack[g.CurrentTableStackIdx] : NULL;
|
||||
IM_ASSERT(g.TablesTempDataStacked > 0);
|
||||
temp_data = (--g.TablesTempDataStacked > 0) ? &g.TablesTempData[g.TablesTempDataStacked - 1] : NULL;
|
||||
g.CurrentTable = temp_data ? g.Tables.GetByIndex(temp_data->TableIndex) : NULL;
|
||||
if (g.CurrentTable)
|
||||
{
|
||||
@ -1570,18 +1581,21 @@ ImGuiTableColumnFlags ImGui::TableGetColumnFlags(int column_n)
|
||||
|
||||
// Return the cell rectangle based on currently known height.
|
||||
// - Important: we generally don't know our row height until the end of the row, so Max.y will be incorrect in many situations.
|
||||
// The only case where this is correct is if we provided a min_row_height to TableNextRow() and don't go below it.
|
||||
// The only case where this is correct is if we provided a min_row_height to TableNextRow() and don't go below it, or in TableEndRow() when we locked that height.
|
||||
// - Important: if ImGuiTableFlags_PadOuterX is set but ImGuiTableFlags_PadInnerX is not set, the outer-most left and right
|
||||
// columns report a small offset so their CellBgRect can extend up to the outer border.
|
||||
// FIXME: But the rendering code in TableEndRow() nullifies that with clamping required for scrolling.
|
||||
ImRect ImGui::TableGetCellBgRect(const ImGuiTable* table, int column_n)
|
||||
{
|
||||
const ImGuiTableColumn* column = &table->Columns[column_n];
|
||||
float x1 = column->MinX;
|
||||
float x2 = column->MaxX;
|
||||
if (column->PrevEnabledColumn == -1)
|
||||
x1 -= table->CellSpacingX1;
|
||||
if (column->NextEnabledColumn == -1)
|
||||
x2 += table->CellSpacingX2;
|
||||
//if (column->PrevEnabledColumn == -1)
|
||||
// x1 -= table->OuterPaddingX;
|
||||
//if (column->NextEnabledColumn == -1)
|
||||
// x2 += table->OuterPaddingX;
|
||||
x1 = ImMax(x1, table->WorkRect.Min.x);
|
||||
x2 = ImMin(x2, table->WorkRect.Max.x);
|
||||
return ImRect(x1, table->RowPosY1, x2, table->RowPosY2);
|
||||
}
|
||||
|
||||
@ -1711,6 +1725,8 @@ void ImGui::TableBeginRow(ImGuiTable* table)
|
||||
table->RowTextBaseline = 0.0f;
|
||||
table->RowIndentOffsetX = window->DC.Indent.x - table->HostIndentX; // Lock indent
|
||||
window->DC.PrevLineTextBaseOffset = 0.0f;
|
||||
window->DC.CurrLineSize = ImVec2(0.0f, 0.0f);
|
||||
window->DC.IsSameLine = window->DC.IsSetPos = false;
|
||||
window->DC.CursorMaxPos.y = next_y1;
|
||||
|
||||
// Making the header BG color non-transparent will allow us to overlay it multiple times when handling smooth dragging.
|
||||
@ -1747,7 +1763,7 @@ void ImGui::TableEndRow(ImGuiTable* table)
|
||||
const bool unfreeze_rows_actual = (table->CurrentRow + 1 == table->FreezeRowsCount);
|
||||
const bool unfreeze_rows_request = (table->CurrentRow + 1 == table->FreezeRowsRequest);
|
||||
if (table->CurrentRow == 0)
|
||||
table->LastFirstRowHeight = bg_y2 - bg_y1;
|
||||
TableGetInstanceData(table, table->InstanceCurrent)->LastFirstRowHeight = bg_y2 - bg_y1;
|
||||
|
||||
const bool is_visible = (bg_y2 >= table->InnerClipRect.Min.y && bg_y1 <= table->InnerClipRect.Max.y);
|
||||
if (is_visible)
|
||||
@ -1798,10 +1814,12 @@ void ImGui::TableEndRow(ImGuiTable* table)
|
||||
ImGuiTableCellData* cell_data_end = &table->RowCellData[table->RowCellDataCurrent];
|
||||
for (ImGuiTableCellData* cell_data = &table->RowCellData[0]; cell_data <= cell_data_end; cell_data++)
|
||||
{
|
||||
// As we render the BG here we need to clip things (for layout we would not)
|
||||
// FIXME: This cancels the OuterPadding addition done by TableGetCellBgRect(), need to keep it while rendering correctly while scrolling.
|
||||
const ImGuiTableColumn* column = &table->Columns[cell_data->Column];
|
||||
ImRect cell_bg_rect = TableGetCellBgRect(table, cell_data->Column);
|
||||
cell_bg_rect.ClipWith(table->BgClipRect);
|
||||
cell_bg_rect.Min.x = ImMax(cell_bg_rect.Min.x, column->ClipRect.Min.x); // So that first column after frozen one gets clipped
|
||||
cell_bg_rect.Min.x = ImMax(cell_bg_rect.Min.x, column->ClipRect.Min.x); // So that first column after frozen one gets clipped when scrolling
|
||||
cell_bg_rect.Max.x = ImMin(cell_bg_rect.Max.x, column->MaxX);
|
||||
window->DrawList->AddRectFilled(cell_bg_rect.Min, cell_bg_rect.Max, cell_data->BgColor);
|
||||
}
|
||||
@ -1990,6 +2008,9 @@ void ImGui::TableEndCell(ImGuiTable* table)
|
||||
ImGuiTableColumn* column = &table->Columns[table->CurrentColumn];
|
||||
ImGuiWindow* window = table->InnerWindow;
|
||||
|
||||
if (window->DC.IsSetPos)
|
||||
ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
|
||||
|
||||
// Report maximum position so we can infer content size per column.
|
||||
float* p_max_pos_x;
|
||||
if (table->RowFlags & ImGuiTableRowFlags_Headers)
|
||||
@ -2084,7 +2105,7 @@ void ImGui::TableSetColumnWidth(int column_n, float width)
|
||||
if (column_0->WidthGiven == column_0_width || column_0->WidthRequest == column_0_width)
|
||||
return;
|
||||
|
||||
//IMGUI_DEBUG_LOG("TableSetColumnWidth(%d, %.1f->%.1f)\n", column_0_idx, column_0->WidthGiven, column_0_width);
|
||||
//IMGUI_DEBUG_PRINT("TableSetColumnWidth(%d, %.1f->%.1f)\n", column_0_idx, column_0->WidthGiven, column_0_width);
|
||||
ImGuiTableColumn* column_1 = (column_0->NextEnabledColumn != -1) ? &table->Columns[column_0->NextEnabledColumn] : NULL;
|
||||
|
||||
// In this surprisingly not simple because of how we support mixing Fixed and multiple Stretch columns.
|
||||
@ -2354,7 +2375,7 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
|
||||
|
||||
// Don't attempt to merge if there are multiple draw calls within the column
|
||||
ImDrawChannel* src_channel = &splitter->_Channels[channel_no];
|
||||
if (src_channel->_CmdBuffer.Size > 0 && src_channel->_CmdBuffer.back().ElemCount == 0)
|
||||
if (src_channel->_CmdBuffer.Size > 0 && src_channel->_CmdBuffer.back().ElemCount == 0 && src_channel->_CmdBuffer.back().UserCallback == NULL) // Equivalent of PopUnusedDrawCmd()
|
||||
src_channel->_CmdBuffer.pop_back();
|
||||
if (src_channel->_CmdBuffer.Size != 1)
|
||||
continue;
|
||||
@ -2498,10 +2519,11 @@ void ImGui::TableDrawBorders(ImGuiTable* table)
|
||||
inner_drawlist->PushClipRect(table->Bg0ClipRectForDrawCmd.Min, table->Bg0ClipRectForDrawCmd.Max, false);
|
||||
|
||||
// Draw inner border and resizing feedback
|
||||
ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
|
||||
const float border_size = TABLE_BORDER_SIZE;
|
||||
const float draw_y1 = table->InnerRect.Min.y;
|
||||
const float draw_y2_body = table->InnerRect.Max.y;
|
||||
const float draw_y2_head = table->IsUsingHeaders ? ImMin(table->InnerRect.Max.y, (table->FreezeRowsCount >= 1 ? table->InnerRect.Min.y : table->WorkRect.Min.y) + table->LastFirstRowHeight) : draw_y1;
|
||||
const float draw_y2_head = table->IsUsingHeaders ? ImMin(table->InnerRect.Max.y, (table->FreezeRowsCount >= 1 ? table->InnerRect.Min.y : table->WorkRect.Min.y) + table_instance->LastFirstRowHeight) : draw_y1;
|
||||
if (table->Flags & ImGuiTableFlags_BordersInnerV)
|
||||
{
|
||||
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
|
||||
@ -2983,7 +3005,7 @@ void ImGui::TableHeader(const char* label)
|
||||
RenderTextEllipsis(window->DrawList, label_pos, ImVec2(ellipsis_max, label_pos.y + label_height + g.Style.FramePadding.y), ellipsis_max, ellipsis_max, label, label_end, &label_size);
|
||||
|
||||
const bool text_clipped = label_size.x > (ellipsis_max - label_pos.x);
|
||||
if (text_clipped && hovered && g.HoveredIdNotActiveTimer > g.TooltipSlowDelay)
|
||||
if (text_clipped && hovered && g.ActiveId == 0 && IsItemHovered(ImGuiHoveredFlags_DelayNormal))
|
||||
SetTooltip("%.*s", (int)(label_end - label), label);
|
||||
|
||||
// We don't use BeginPopupContextItem() because we want the popup to stay up even after the column is hidden
|
||||
@ -3018,6 +3040,17 @@ void ImGui::TableOpenContextMenu(int column_n)
|
||||
}
|
||||
}
|
||||
|
||||
bool ImGui::TableBeginContextMenuPopup(ImGuiTable* table)
|
||||
{
|
||||
if (!table->IsContextPopupOpen || table->InstanceCurrent != table->InstanceInteracted)
|
||||
return false;
|
||||
const ImGuiID context_menu_id = ImHashStr("##ContextMenu", 0, table->ID);
|
||||
if (BeginPopupEx(context_menu_id, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings))
|
||||
return true;
|
||||
table->IsContextPopupOpen = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Output context menu into current window (generally a popup)
|
||||
// FIXME-TABLE: Ideally this should be writable by the user. Full programmatic access to that data?
|
||||
void ImGui::TableDrawContextMenu(ImGuiTable* table)
|
||||
@ -3037,15 +3070,15 @@ void ImGui::TableDrawContextMenu(ImGuiTable* table)
|
||||
if (column != NULL)
|
||||
{
|
||||
const bool can_resize = !(column->Flags & ImGuiTableColumnFlags_NoResize) && column->IsEnabled;
|
||||
if (MenuItem("Size column to fit###SizeOne", NULL, false, can_resize))
|
||||
if (MenuItem(LocalizeGetMsg(ImGuiLocKey_TableSizeOne), NULL, false, can_resize)) // "###SizeOne"
|
||||
TableSetColumnWidthAutoSingle(table, column_n);
|
||||
}
|
||||
|
||||
const char* size_all_desc;
|
||||
if (table->ColumnsEnabledFixedCount == table->ColumnsEnabledCount && (table->Flags & ImGuiTableFlags_SizingMask_) != ImGuiTableFlags_SizingFixedSame)
|
||||
size_all_desc = "Size all columns to fit###SizeAll"; // All fixed
|
||||
size_all_desc = LocalizeGetMsg(ImGuiLocKey_TableSizeAllFit); // "###SizeAll" All fixed
|
||||
else
|
||||
size_all_desc = "Size all columns to default###SizeAll"; // All stretch or mixed
|
||||
size_all_desc = LocalizeGetMsg(ImGuiLocKey_TableSizeAllDefault); // "###SizeAll" All stretch or mixed
|
||||
if (MenuItem(size_all_desc, NULL))
|
||||
TableSetColumnWidthAutoAll(table);
|
||||
want_separator = true;
|
||||
@ -3054,7 +3087,7 @@ void ImGui::TableDrawContextMenu(ImGuiTable* table)
|
||||
// Ordering
|
||||
if (table->Flags & ImGuiTableFlags_Reorderable)
|
||||
{
|
||||
if (MenuItem("Reset order", NULL, false, !table->IsDefaultDisplayOrder))
|
||||
if (MenuItem(LocalizeGetMsg(ImGuiLocKey_TableResetOrder), NULL, false, !table->IsDefaultDisplayOrder))
|
||||
table->IsResetDisplayOrderRequest = true;
|
||||
want_separator = true;
|
||||
}
|
||||
@ -3423,9 +3456,8 @@ static void TableSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandle
|
||||
}
|
||||
}
|
||||
|
||||
void ImGui::TableSettingsInstallHandler(ImGuiContext* context)
|
||||
void ImGui::TableSettingsAddSettingsHandler()
|
||||
{
|
||||
ImGuiContext& g = *context;
|
||||
ImGuiSettingsHandler ini_handler;
|
||||
ini_handler.TypeName = "Table";
|
||||
ini_handler.TypeHash = ImHashStr("Table");
|
||||
@ -3434,7 +3466,7 @@ void ImGui::TableSettingsInstallHandler(ImGuiContext* context)
|
||||
ini_handler.ReadLineFn = TableSettingsHandler_ReadLine;
|
||||
ini_handler.ApplyAllFn = TableSettingsHandler_ApplyAll;
|
||||
ini_handler.WriteAllFn = TableSettingsHandler_WriteAll;
|
||||
g.SettingsHandlers.push_back(ini_handler);
|
||||
AddSettingsHandler(&ini_handler);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@ -3448,7 +3480,7 @@ void ImGui::TableSettingsInstallHandler(ImGuiContext* context)
|
||||
// Remove Table (currently only used by TestEngine)
|
||||
void ImGui::TableRemove(ImGuiTable* table)
|
||||
{
|
||||
//IMGUI_DEBUG_LOG("TableRemove() id=0x%08X\n", table->ID);
|
||||
//IMGUI_DEBUG_PRINT("TableRemove() id=0x%08X\n", table->ID);
|
||||
ImGuiContext& g = *GImGui;
|
||||
int table_idx = g.Tables.GetIndex(table);
|
||||
//memset(table->RawData.Data, 0, table->RawData.size_in_bytes());
|
||||
@ -3460,7 +3492,7 @@ void ImGui::TableRemove(ImGuiTable* table)
|
||||
// Free up/compact internal Table buffers for when it gets unused
|
||||
void ImGui::TableGcCompactTransientBuffers(ImGuiTable* table)
|
||||
{
|
||||
//IMGUI_DEBUG_LOG("TableGcCompactTransientBuffers() id=0x%08X\n", table->ID);
|
||||
//IMGUI_DEBUG_PRINT("TableGcCompactTransientBuffers() id=0x%08X\n", table->ID);
|
||||
ImGuiContext& g = *GImGui;
|
||||
IM_ASSERT(table->MemoryCompacted == false);
|
||||
table->SortSpecs.Specs = NULL;
|
||||
@ -3504,7 +3536,7 @@ void ImGui::TableGcCompactSettings()
|
||||
// - DebugNodeTable() [Internal]
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
#ifndef IMGUI_DISABLE_METRICS_WINDOW
|
||||
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
|
||||
|
||||
static const char* DebugNodeTableGetSizingPolicyDesc(ImGuiTableFlags sizing_policy)
|
||||
{
|
||||
@ -3532,6 +3564,8 @@ void ImGui::DebugNodeTable(ImGuiTable* table)
|
||||
GetForegroundDrawList()->AddRect(GetItemRectMin(), GetItemRectMax(), IM_COL32(255, 255, 0, 255));
|
||||
if (!open)
|
||||
return;
|
||||
if (table->InstanceCurrent > 0)
|
||||
ImGui::Text("** %d instances of same table! Some data below will refer to last instance.", table->InstanceCurrent + 1);
|
||||
bool clear_settings = SmallButton("Clear settings");
|
||||
BulletText("OuterRect: Pos: (%.1f,%.1f) Size: (%.1f,%.1f) Sizing: '%s'", table->OuterRect.Min.x, table->OuterRect.Min.y, table->OuterRect.GetWidth(), table->OuterRect.GetHeight(), DebugNodeTableGetSizingPolicyDesc(table->Flags));
|
||||
BulletText("ColumnsGivenWidth: %.1f, ColumnsAutoFitWidth: %.1f, InnerWidth: %.1f%s", table->ColumnsGivenWidth, table->ColumnsAutoFitWidth, table->InnerWidth, table->InnerWidth == 0.0f ? " (auto)" : "");
|
||||
@ -3596,7 +3630,7 @@ void ImGui::DebugNodeTableSettings(ImGuiTableSettings* settings)
|
||||
TreePop();
|
||||
}
|
||||
|
||||
#else // #ifndef IMGUI_DISABLE_METRICS_WINDOW
|
||||
#else // #ifndef IMGUI_DISABLE_DEBUG_TOOLS
|
||||
|
||||
void ImGui::DebugNodeTable(ImGuiTable*) {}
|
||||
void ImGui::DebugNodeTableSettings(ImGuiTableSettings*) {}
|
||||
@ -3936,6 +3970,7 @@ void ImGui::NextColumn()
|
||||
{
|
||||
// New row/line: column 0 honor IndentX.
|
||||
window->DC.ColumnsOffset.x = ImMax(column_padding - window->WindowPadding.x, 0.0f);
|
||||
window->DC.IsSameLine = false;
|
||||
columns->LineMinY = columns->LineMaxY;
|
||||
}
|
||||
window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
|
||||
@ -3987,8 +4022,7 @@ void ImGui::EndColumns()
|
||||
const ImGuiID column_id = columns->ID + ImGuiID(n);
|
||||
const float column_hit_hw = COLUMNS_HIT_RECT_HALF_WIDTH;
|
||||
const ImRect column_hit_rect(ImVec2(x - column_hit_hw, y1), ImVec2(x + column_hit_hw, y2));
|
||||
KeepAliveID(column_id);
|
||||
if (IsClippedEx(column_hit_rect, column_id)) // FIXME: Can be removed or replaced with a lower-level test
|
||||
if (!ItemAdd(column_hit_rect, column_id, NULL, ImGuiItemFlags_NoNav))
|
||||
continue;
|
||||
|
||||
bool hovered = false, held = false;
|
||||
|
1515
3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp
vendored
1515
3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp
vendored
File diff suppressed because it is too large
Load Diff
279
3rdparty/bgfx/3rdparty/dear-imgui/widgets/gizmo.h
vendored
279
3rdparty/bgfx/3rdparty/dear-imgui/widgets/gizmo.h
vendored
@ -1,20 +1,20 @@
|
||||
// https://github.com/CedricGuillemet/ImGuizmo
|
||||
// v 1.61 WIP
|
||||
// v 1.84 WIP
|
||||
//
|
||||
// The MIT License(MIT)
|
||||
//
|
||||
// Copyright(c) 2016 Cedric Guillemet
|
||||
//
|
||||
//
|
||||
// Copyright(c) 2021 Cedric Guillemet
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files(the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions :
|
||||
//
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
|
||||
@ -24,7 +24,8 @@
|
||||
// SOFTWARE.
|
||||
//
|
||||
// -------------------------------------------------------------------------------------------
|
||||
// History :
|
||||
// History :
|
||||
// 2019/11/03 View gizmo
|
||||
// 2016/09/11 Behind camera culling. Scaling Delta matrix not multiplied by source matrix scales. local/world rotation and translation fixed. Display message is incorrect (X: ... Y:...) in local mode.
|
||||
// 2016/09/09 Hatched negative axis. Snapping. Documentation update.
|
||||
// 2016/09/04 Axis switch and translation plan autohiding. Scale transform stability improved
|
||||
@ -44,123 +45,179 @@
|
||||
#if 0
|
||||
void EditTransform(const Camera& camera, matrix_t& matrix)
|
||||
{
|
||||
static ImGuizmo::OPERATION mCurrentGizmoOperation(ImGuizmo::ROTATE);
|
||||
static ImGuizmo::MODE mCurrentGizmoMode(ImGuizmo::WORLD);
|
||||
if (ImGui::IsKeyPressed(90))
|
||||
mCurrentGizmoOperation = ImGuizmo::TRANSLATE;
|
||||
if (ImGui::IsKeyPressed(69))
|
||||
mCurrentGizmoOperation = ImGuizmo::ROTATE;
|
||||
if (ImGui::IsKeyPressed(82)) // r Key
|
||||
mCurrentGizmoOperation = ImGuizmo::SCALE;
|
||||
if (ImGui::RadioButton("Translate", mCurrentGizmoOperation == ImGuizmo::TRANSLATE))
|
||||
mCurrentGizmoOperation = ImGuizmo::TRANSLATE;
|
||||
ImGui::SameLine();
|
||||
if (ImGui::RadioButton("Rotate", mCurrentGizmoOperation == ImGuizmo::ROTATE))
|
||||
mCurrentGizmoOperation = ImGuizmo::ROTATE;
|
||||
ImGui::SameLine();
|
||||
if (ImGui::RadioButton("Scale", mCurrentGizmoOperation == ImGuizmo::SCALE))
|
||||
mCurrentGizmoOperation = ImGuizmo::SCALE;
|
||||
float matrixTranslation[3], matrixRotation[3], matrixScale[3];
|
||||
ImGuizmo::DecomposeMatrixToComponents(matrix.m16, matrixTranslation, matrixRotation, matrixScale);
|
||||
ImGui::InputFloat3("Tr", matrixTranslation, 3);
|
||||
ImGui::InputFloat3("Rt", matrixRotation, 3);
|
||||
ImGui::InputFloat3("Sc", matrixScale, 3);
|
||||
ImGuizmo::RecomposeMatrixFromComponents(matrixTranslation, matrixRotation, matrixScale, matrix.m16);
|
||||
static ImGuizmo::OPERATION mCurrentGizmoOperation(ImGuizmo::ROTATE);
|
||||
static ImGuizmo::MODE mCurrentGizmoMode(ImGuizmo::WORLD);
|
||||
if (ImGui::IsKeyPressed(90))
|
||||
mCurrentGizmoOperation = ImGuizmo::TRANSLATE;
|
||||
if (ImGui::IsKeyPressed(69))
|
||||
mCurrentGizmoOperation = ImGuizmo::ROTATE;
|
||||
if (ImGui::IsKeyPressed(82)) // r Key
|
||||
mCurrentGizmoOperation = ImGuizmo::SCALE;
|
||||
if (ImGui::RadioButton("Translate", mCurrentGizmoOperation == ImGuizmo::TRANSLATE))
|
||||
mCurrentGizmoOperation = ImGuizmo::TRANSLATE;
|
||||
ImGui::SameLine();
|
||||
if (ImGui::RadioButton("Rotate", mCurrentGizmoOperation == ImGuizmo::ROTATE))
|
||||
mCurrentGizmoOperation = ImGuizmo::ROTATE;
|
||||
ImGui::SameLine();
|
||||
if (ImGui::RadioButton("Scale", mCurrentGizmoOperation == ImGuizmo::SCALE))
|
||||
mCurrentGizmoOperation = ImGuizmo::SCALE;
|
||||
float matrixTranslation[3], matrixRotation[3], matrixScale[3];
|
||||
ImGuizmo::DecomposeMatrixToComponents(matrix.m16, matrixTranslation, matrixRotation, matrixScale);
|
||||
ImGui::InputFloat3("Tr", matrixTranslation, 3);
|
||||
ImGui::InputFloat3("Rt", matrixRotation, 3);
|
||||
ImGui::InputFloat3("Sc", matrixScale, 3);
|
||||
ImGuizmo::RecomposeMatrixFromComponents(matrixTranslation, matrixRotation, matrixScale, matrix.m16);
|
||||
|
||||
if (mCurrentGizmoOperation != ImGuizmo::SCALE)
|
||||
{
|
||||
if (ImGui::RadioButton("Local", mCurrentGizmoMode == ImGuizmo::LOCAL))
|
||||
mCurrentGizmoMode = ImGuizmo::LOCAL;
|
||||
ImGui::SameLine();
|
||||
if (ImGui::RadioButton("World", mCurrentGizmoMode == ImGuizmo::WORLD))
|
||||
mCurrentGizmoMode = ImGuizmo::WORLD;
|
||||
}
|
||||
static bool useSnap(false);
|
||||
if (ImGui::IsKeyPressed(83))
|
||||
useSnap = !useSnap;
|
||||
ImGui::Checkbox("", &useSnap);
|
||||
ImGui::SameLine();
|
||||
vec_t snap;
|
||||
switch (mCurrentGizmoOperation)
|
||||
{
|
||||
case ImGuizmo::TRANSLATE:
|
||||
snap = config.mSnapTranslation;
|
||||
ImGui::InputFloat3("Snap", &snap.x);
|
||||
break;
|
||||
case ImGuizmo::ROTATE:
|
||||
snap = config.mSnapRotation;
|
||||
ImGui::InputFloat("Angle Snap", &snap.x);
|
||||
break;
|
||||
case ImGuizmo::SCALE:
|
||||
snap = config.mSnapScale;
|
||||
ImGui::InputFloat("Scale Snap", &snap.x);
|
||||
break;
|
||||
}
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
ImGuizmo::SetRect(0, 0, io.DisplaySize.x, io.DisplaySize.y);
|
||||
ImGuizmo::Manipulate(camera.mView.m16, camera.mProjection.m16, mCurrentGizmoOperation, mCurrentGizmoMode, matrix.m16, NULL, useSnap ? &snap.x : NULL);
|
||||
if (mCurrentGizmoOperation != ImGuizmo::SCALE)
|
||||
{
|
||||
if (ImGui::RadioButton("Local", mCurrentGizmoMode == ImGuizmo::LOCAL))
|
||||
mCurrentGizmoMode = ImGuizmo::LOCAL;
|
||||
ImGui::SameLine();
|
||||
if (ImGui::RadioButton("World", mCurrentGizmoMode == ImGuizmo::WORLD))
|
||||
mCurrentGizmoMode = ImGuizmo::WORLD;
|
||||
}
|
||||
static bool useSnap(false);
|
||||
if (ImGui::IsKeyPressed(83))
|
||||
useSnap = !useSnap;
|
||||
ImGui::Checkbox("", &useSnap);
|
||||
ImGui::SameLine();
|
||||
vec_t snap;
|
||||
switch (mCurrentGizmoOperation)
|
||||
{
|
||||
case ImGuizmo::TRANSLATE:
|
||||
snap = config.mSnapTranslation;
|
||||
ImGui::InputFloat3("Snap", &snap.x);
|
||||
break;
|
||||
case ImGuizmo::ROTATE:
|
||||
snap = config.mSnapRotation;
|
||||
ImGui::InputFloat("Angle Snap", &snap.x);
|
||||
break;
|
||||
case ImGuizmo::SCALE:
|
||||
snap = config.mSnapScale;
|
||||
ImGui::InputFloat("Scale Snap", &snap.x);
|
||||
break;
|
||||
}
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
ImGuizmo::SetRect(0, 0, io.DisplaySize.x, io.DisplaySize.y);
|
||||
ImGuizmo::Manipulate(camera.mView.m16, camera.mProjection.m16, mCurrentGizmoOperation, mCurrentGizmoMode, matrix.m16, NULL, useSnap ? &snap.x : NULL);
|
||||
}
|
||||
#endif
|
||||
#pragma once
|
||||
|
||||
namespace ImGuizmo
|
||||
#ifdef USE_IMGUI_API
|
||||
#include "imconfig.h"
|
||||
#endif
|
||||
#ifndef IMGUI_API
|
||||
#define IMGUI_API
|
||||
#endif
|
||||
|
||||
#ifndef IMGUIZMO_NAMESPACE
|
||||
#define IMGUIZMO_NAMESPACE ImGuizmo
|
||||
#endif
|
||||
|
||||
namespace IMGUIZMO_NAMESPACE
|
||||
{
|
||||
// call inside your own window and before Manipulate() in order to draw gizmo to that window.
|
||||
IMGUI_API void SetDrawlist();
|
||||
// call inside your own window and before Manipulate() in order to draw gizmo to that window.
|
||||
// Or pass a specific ImDrawList to draw to (e.g. ImGui::GetForegroundDrawList()).
|
||||
IMGUI_API void SetDrawlist(ImDrawList* drawlist = nullptr);
|
||||
|
||||
// call BeginFrame right after ImGui_XXXX_NewFrame();
|
||||
IMGUI_API void BeginFrame();
|
||||
// call BeginFrame right after ImGui_XXXX_NewFrame();
|
||||
IMGUI_API void BeginFrame();
|
||||
|
||||
// return true if mouse cursor is over any gizmo control (axis, plan or screen component)
|
||||
IMGUI_API bool IsOver();
|
||||
// this is necessary because when imguizmo is compiled into a dll, and imgui into another
|
||||
// globals are not shared between them.
|
||||
// More details at https://stackoverflow.com/questions/19373061/what-happens-to-global-and-static-variables-in-a-shared-library-when-it-is-dynam
|
||||
// expose method to set imgui context
|
||||
IMGUI_API void SetImGuiContext(ImGuiContext* ctx);
|
||||
|
||||
// return true if mouse IsOver or if the gizmo is in moving state
|
||||
IMGUI_API bool IsUsing();
|
||||
// return true if mouse cursor is over any gizmo control (axis, plan or screen component)
|
||||
IMGUI_API bool IsOver();
|
||||
|
||||
// enable/disable the gizmo. Stay in the state until next call to Enable.
|
||||
// gizmo is rendered with gray half transparent color when disabled
|
||||
IMGUI_API void Enable(bool enable);
|
||||
// return true if mouse IsOver or if the gizmo is in moving state
|
||||
IMGUI_API bool IsUsing();
|
||||
|
||||
// helper functions for manualy editing translation/rotation/scale with an input float
|
||||
// translation, rotation and scale float points to 3 floats each
|
||||
// Angles are in degrees (more suitable for human editing)
|
||||
// example:
|
||||
// float matrixTranslation[3], matrixRotation[3], matrixScale[3];
|
||||
// ImGuizmo::DecomposeMatrixToComponents(gizmoMatrix.m16, matrixTranslation, matrixRotation, matrixScale);
|
||||
// ImGui::InputFloat3("Tr", matrixTranslation, 3);
|
||||
// ImGui::InputFloat3("Rt", matrixRotation, 3);
|
||||
// ImGui::InputFloat3("Sc", matrixScale, 3);
|
||||
// ImGuizmo::RecomposeMatrixFromComponents(matrixTranslation, matrixRotation, matrixScale, gizmoMatrix.m16);
|
||||
//
|
||||
// These functions have some numerical stability issues for now. Use with caution.
|
||||
IMGUI_API void DecomposeMatrixToComponents(const float *matrix, float *translation, float *rotation, float *scale);
|
||||
IMGUI_API void RecomposeMatrixFromComponents(const float *translation, const float *rotation, const float *scale, float *matrix);
|
||||
// enable/disable the gizmo. Stay in the state until next call to Enable.
|
||||
// gizmo is rendered with gray half transparent color when disabled
|
||||
IMGUI_API void Enable(bool enable);
|
||||
|
||||
IMGUI_API void SetRect(float x, float y, float width, float height);
|
||||
// default is false
|
||||
IMGUI_API void SetOrthographic(bool isOrthographic);
|
||||
// helper functions for manualy editing translation/rotation/scale with an input float
|
||||
// translation, rotation and scale float points to 3 floats each
|
||||
// Angles are in degrees (more suitable for human editing)
|
||||
// example:
|
||||
// float matrixTranslation[3], matrixRotation[3], matrixScale[3];
|
||||
// ImGuizmo::DecomposeMatrixToComponents(gizmoMatrix.m16, matrixTranslation, matrixRotation, matrixScale);
|
||||
// ImGui::InputFloat3("Tr", matrixTranslation, 3);
|
||||
// ImGui::InputFloat3("Rt", matrixRotation, 3);
|
||||
// ImGui::InputFloat3("Sc", matrixScale, 3);
|
||||
// ImGuizmo::RecomposeMatrixFromComponents(matrixTranslation, matrixRotation, matrixScale, gizmoMatrix.m16);
|
||||
//
|
||||
// These functions have some numerical stability issues for now. Use with caution.
|
||||
IMGUI_API void DecomposeMatrixToComponents(const float* matrix, float* translation, float* rotation, float* scale);
|
||||
IMGUI_API void RecomposeMatrixFromComponents(const float* translation, const float* rotation, const float* scale, float* matrix);
|
||||
|
||||
// Render a cube with face color corresponding to face normal. Usefull for debug/tests
|
||||
IMGUI_API void DrawCube(const float *view, const float *projection, const float *matrix);
|
||||
IMGUI_API void DrawGrid(const float *view, const float *projection, const float *matrix, const float gridSize);
|
||||
IMGUI_API void SetRect(float x, float y, float width, float height);
|
||||
// default is false
|
||||
IMGUI_API void SetOrthographic(bool isOrthographic);
|
||||
|
||||
// call it when you want a gizmo
|
||||
// Needs view and projection matrices.
|
||||
// matrix parameter is the source matrix (where will be gizmo be drawn) and might be transformed by the function. Return deltaMatrix is optional
|
||||
// translation is applied in world space
|
||||
enum OPERATION
|
||||
{
|
||||
TRANSLATE,
|
||||
ROTATE,
|
||||
SCALE,
|
||||
BOUNDS,
|
||||
};
|
||||
// Render a cube with face color corresponding to face normal. Usefull for debug/tests
|
||||
IMGUI_API void DrawCubes(const float* view, const float* projection, const float* matrices, int matrixCount);
|
||||
IMGUI_API void DrawGrid(const float* view, const float* projection, const float* matrix, const float gridSize);
|
||||
|
||||
enum MODE
|
||||
{
|
||||
LOCAL,
|
||||
WORLD
|
||||
};
|
||||
// call it when you want a gizmo
|
||||
// Needs view and projection matrices.
|
||||
// matrix parameter is the source matrix (where will be gizmo be drawn) and might be transformed by the function. Return deltaMatrix is optional
|
||||
// translation is applied in world space
|
||||
enum OPERATION
|
||||
{
|
||||
TRANSLATE_X = (1u << 0),
|
||||
TRANSLATE_Y = (1u << 1),
|
||||
TRANSLATE_Z = (1u << 2),
|
||||
ROTATE_X = (1u << 3),
|
||||
ROTATE_Y = (1u << 4),
|
||||
ROTATE_Z = (1u << 5),
|
||||
ROTATE_SCREEN = (1u << 6),
|
||||
SCALE_X = (1u << 7),
|
||||
SCALE_Y = (1u << 8),
|
||||
SCALE_Z = (1u << 9),
|
||||
BOUNDS = (1u << 10),
|
||||
SCALE_XU = (1u << 11),
|
||||
SCALE_YU = (1u << 12),
|
||||
SCALE_ZU = (1u << 13),
|
||||
|
||||
IMGUI_API void Manipulate(const float *view, const float *projection, OPERATION operation, MODE mode, float *matrix, float *deltaMatrix = 0, float *snap = 0, float *localBounds = NULL, float *boundsSnap = NULL);
|
||||
};
|
||||
TRANSLATE = TRANSLATE_X | TRANSLATE_Y | TRANSLATE_Z,
|
||||
ROTATE = ROTATE_X | ROTATE_Y | ROTATE_Z | ROTATE_SCREEN,
|
||||
SCALE = SCALE_X | SCALE_Y | SCALE_Z,
|
||||
SCALEU = SCALE_XU | SCALE_YU | SCALE_ZU, // universal
|
||||
UNIVERSAL = TRANSLATE | ROTATE | SCALEU
|
||||
};
|
||||
|
||||
inline OPERATION operator|(OPERATION lhs, OPERATION rhs)
|
||||
{
|
||||
return static_cast<OPERATION>(static_cast<int>(lhs) | static_cast<int>(rhs));
|
||||
}
|
||||
|
||||
enum MODE
|
||||
{
|
||||
LOCAL,
|
||||
WORLD
|
||||
};
|
||||
|
||||
IMGUI_API bool Manipulate(const float* view, const float* projection, OPERATION operation, MODE mode, float* matrix, float* deltaMatrix = NULL, const float* snap = NULL, const float* localBounds = NULL, const float* boundsSnap = NULL);
|
||||
//
|
||||
// Please note that this cubeview is patented by Autodesk : https://patents.google.com/patent/US7782319B2/en
|
||||
// It seems to be a defensive patent in the US. I don't think it will bring troubles using it as
|
||||
// other software are using the same mechanics. But just in case, you are now warned!
|
||||
//
|
||||
IMGUI_API void ViewManipulate(float* view, float length, ImVec2 position, ImVec2 size, ImU32 backgroundColor);
|
||||
|
||||
IMGUI_API void SetID(int id);
|
||||
|
||||
// return true if the cursor is over the operation's gizmo
|
||||
IMGUI_API bool IsOver(OPERATION op);
|
||||
IMGUI_API void SetGizmoSizeClipSpace(float value);
|
||||
|
||||
// Allow axis to flip
|
||||
// When true (default), the guizmo axis flip for better visibility
|
||||
// When false, they always stay along the positive world/local axis
|
||||
IMGUI_API void AllowAxisFlip(bool value);
|
||||
}
|
||||
|
2202
3rdparty/bgfx/3rdparty/dear-imgui/widgets/gizmo.inl
vendored
2202
3rdparty/bgfx/3rdparty/dear-imgui/widgets/gizmo.inl
vendored
File diff suppressed because it is too large
Load Diff
@ -1,3 +1,5 @@
|
||||
#include <bx/string.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define snprintf _snprintf
|
||||
#endif
|
||||
@ -142,7 +144,7 @@ namespace ImGui
|
||||
if (HexII)
|
||||
{
|
||||
unsigned char byte = mem_data[addr];
|
||||
if (isprint(byte) )
|
||||
if (bx::isPrint(byte) )
|
||||
{
|
||||
Text(".%c ", byte);
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ bool RangeSliderFloat(const char* label, float* v1, float* v2, float v_min, floa
|
||||
|
||||
// Tabbing or CTRL-clicking on Slider turns it into an input box
|
||||
bool start_text_input = false;
|
||||
const bool tab_focus_requested = (GetItemStatusFlags() & ImGuiItemStatusFlags_Focused) != 0;
|
||||
const bool tab_focus_requested = (GetItemStatusFlags() & ImGuiItemStatusFlags_FocusedByTabbing) != 0;
|
||||
if (tab_focus_requested || (hovered && g.IO.MouseClicked[0]))
|
||||
{
|
||||
SetActiveID(id, window);
|
||||
|
21
3rdparty/bgfx/3rdparty/directx-headers/LICENSE
vendored
Normal file
21
3rdparty/bgfx/3rdparty/directx-headers/LICENSE
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
1
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10.h
vendored
Normal file
1
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10.h
vendored
Normal file
@ -0,0 +1 @@
|
||||
#pragma once
|
1
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10_1.h
vendored
Normal file
1
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10_1.h
vendored
Normal file
@ -0,0 +1 @@
|
||||
#pragma once
|
1
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10_1shader.h
vendored
Normal file
1
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10_1shader.h
vendored
Normal file
@ -0,0 +1 @@
|
||||
#pragma once
|
1
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10effect.h
vendored
Normal file
1
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10effect.h
vendored
Normal file
@ -0,0 +1 @@
|
||||
#pragma once
|
1
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10misc.h
vendored
Normal file
1
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10misc.h
vendored
Normal file
@ -0,0 +1 @@
|
||||
#pragma once
|
1
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10sdklayers.h
vendored
Normal file
1
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10sdklayers.h
vendored
Normal file
@ -0,0 +1 @@
|
||||
#pragma once
|
1
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10shader.h
vendored
Normal file
1
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10shader.h
vendored
Normal file
@ -0,0 +1 @@
|
||||
#pragma once
|
@ -15,7 +15,7 @@
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
@ -15,7 +15,7 @@
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
@ -15,7 +15,7 @@
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
@ -15,7 +15,7 @@
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
@ -15,7 +15,7 @@
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
@ -15,7 +15,7 @@
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
@ -10,7 +10,7 @@
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
File diff suppressed because it is too large
Load Diff
739
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12compatibility.h
vendored
Normal file
739
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12compatibility.h
vendored
Normal file
@ -0,0 +1,739 @@
|
||||
/*-------------------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (c) Microsoft Corporation
|
||||
* Licensed under the MIT license
|
||||
*
|
||||
*-------------------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
|
||||
|
||||
|
||||
/* File created by MIDL compiler version 8.01.0628 */
|
||||
|
||||
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCSAL_H_VERSION__
|
||||
#define __REQUIRED_RPCSAL_H_VERSION__ 100
|
||||
#endif
|
||||
|
||||
#include "rpc.h"
|
||||
#include "rpcndr.h"
|
||||
|
||||
#ifndef __RPCNDR_H_VERSION__
|
||||
#error this stub requires an updated version of <rpcndr.h>
|
||||
#endif /* __RPCNDR_H_VERSION__ */
|
||||
|
||||
#ifndef COM_NO_WINDOWS_H
|
||||
#include "windows.h"
|
||||
#include "ole2.h"
|
||||
#endif /*COM_NO_WINDOWS_H*/
|
||||
|
||||
#ifndef __d3d12compatibility_h__
|
||||
#define __d3d12compatibility_h__
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifndef DECLSPEC_XFGVIRT
|
||||
#if defined(_CONTROL_FLOW_GUARD_XFG)
|
||||
#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func))
|
||||
#else
|
||||
#define DECLSPEC_XFGVIRT(base, func)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Forward Declarations */
|
||||
|
||||
#ifndef __ID3D12CompatibilityDevice_FWD_DEFINED__
|
||||
#define __ID3D12CompatibilityDevice_FWD_DEFINED__
|
||||
typedef interface ID3D12CompatibilityDevice ID3D12CompatibilityDevice;
|
||||
|
||||
#endif /* __ID3D12CompatibilityDevice_FWD_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __D3D11On12CreatorID_FWD_DEFINED__
|
||||
#define __D3D11On12CreatorID_FWD_DEFINED__
|
||||
typedef interface D3D11On12CreatorID D3D11On12CreatorID;
|
||||
|
||||
#endif /* __D3D11On12CreatorID_FWD_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __D3D9On12CreatorID_FWD_DEFINED__
|
||||
#define __D3D9On12CreatorID_FWD_DEFINED__
|
||||
typedef interface D3D9On12CreatorID D3D9On12CreatorID;
|
||||
|
||||
#endif /* __D3D9On12CreatorID_FWD_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __OpenGLOn12CreatorID_FWD_DEFINED__
|
||||
#define __OpenGLOn12CreatorID_FWD_DEFINED__
|
||||
typedef interface OpenGLOn12CreatorID OpenGLOn12CreatorID;
|
||||
|
||||
#endif /* __OpenGLOn12CreatorID_FWD_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __OpenCLOn12CreatorID_FWD_DEFINED__
|
||||
#define __OpenCLOn12CreatorID_FWD_DEFINED__
|
||||
typedef interface OpenCLOn12CreatorID OpenCLOn12CreatorID;
|
||||
|
||||
#endif /* __OpenCLOn12CreatorID_FWD_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __DirectMLTensorFlowCreatorID_FWD_DEFINED__
|
||||
#define __DirectMLTensorFlowCreatorID_FWD_DEFINED__
|
||||
typedef interface DirectMLTensorFlowCreatorID DirectMLTensorFlowCreatorID;
|
||||
|
||||
#endif /* __DirectMLTensorFlowCreatorID_FWD_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __DirectMLPyTorchCreatorID_FWD_DEFINED__
|
||||
#define __DirectMLPyTorchCreatorID_FWD_DEFINED__
|
||||
typedef interface DirectMLPyTorchCreatorID DirectMLPyTorchCreatorID;
|
||||
|
||||
#endif /* __DirectMLPyTorchCreatorID_FWD_DEFINED__ */
|
||||
|
||||
|
||||
/* header files for imported files */
|
||||
#include "oaidl.h"
|
||||
#include "ocidl.h"
|
||||
#include "d3d11on12.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
|
||||
/* interface __MIDL_itf_d3d12compatibility_0000_0000 */
|
||||
/* [local] */
|
||||
|
||||
#include <winapifamily.h>
|
||||
#pragma region Desktop Family
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES)
|
||||
typedef
|
||||
enum D3D12_COMPATIBILITY_SHARED_FLAGS
|
||||
{
|
||||
D3D12_COMPATIBILITY_SHARED_FLAG_NONE = 0,
|
||||
D3D12_COMPATIBILITY_SHARED_FLAG_NON_NT_HANDLE = 0x1,
|
||||
D3D12_COMPATIBILITY_SHARED_FLAG_KEYED_MUTEX = 0x2,
|
||||
D3D12_COMPATIBILITY_SHARED_FLAG_9_ON_12 = 0x4
|
||||
} D3D12_COMPATIBILITY_SHARED_FLAGS;
|
||||
|
||||
DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMPATIBILITY_SHARED_FLAGS );
|
||||
typedef
|
||||
enum D3D12_REFLECT_SHARED_PROPERTY
|
||||
{
|
||||
D3D12_REFLECT_SHARED_PROPERTY_D3D11_RESOURCE_FLAGS = 0,
|
||||
D3D12_REFELCT_SHARED_PROPERTY_COMPATIBILITY_SHARED_FLAGS = ( D3D12_REFLECT_SHARED_PROPERTY_D3D11_RESOURCE_FLAGS + 1 ) ,
|
||||
D3D12_REFLECT_SHARED_PROPERTY_NON_NT_SHARED_HANDLE = ( D3D12_REFELCT_SHARED_PROPERTY_COMPATIBILITY_SHARED_FLAGS + 1 )
|
||||
} D3D12_REFLECT_SHARED_PROPERTY;
|
||||
|
||||
|
||||
|
||||
extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0000_v0_0_c_ifspec;
|
||||
extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0000_v0_0_s_ifspec;
|
||||
|
||||
#ifndef __ID3D12CompatibilityDevice_INTERFACE_DEFINED__
|
||||
#define __ID3D12CompatibilityDevice_INTERFACE_DEFINED__
|
||||
|
||||
/* interface ID3D12CompatibilityDevice */
|
||||
/* [unique][local][object][uuid] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_ID3D12CompatibilityDevice;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("8f1c0e3c-fae3-4a82-b098-bfe1708207ff")
|
||||
ID3D12CompatibilityDevice : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateSharedResource(
|
||||
_In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
|
||||
D3D12_HEAP_FLAGS HeapFlags,
|
||||
_In_ const D3D12_RESOURCE_DESC *pDesc,
|
||||
D3D12_RESOURCE_STATES InitialResourceState,
|
||||
_In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
|
||||
_In_opt_ const D3D11_RESOURCE_FLAGS *pFlags11,
|
||||
D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags,
|
||||
_In_opt_ ID3D12LifetimeTracker *pLifetimeTracker,
|
||||
_In_opt_ ID3D12SwapChainAssistant *pOwningSwapchain,
|
||||
REFIID riid,
|
||||
_COM_Outptr_opt_ void **ppResource) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateSharedHeap(
|
||||
_In_ const D3D12_HEAP_DESC *pHeapDesc,
|
||||
D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags,
|
||||
REFIID riid,
|
||||
_COM_Outptr_opt_ void **ppHeap) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE ReflectSharedProperties(
|
||||
_In_ ID3D12Object *pHeapOrResource,
|
||||
D3D12_REFLECT_SHARED_PROPERTY ReflectType,
|
||||
_Out_writes_bytes_(DataSize) void *pData,
|
||||
UINT DataSize) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct ID3D12CompatibilityDeviceVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
ID3D12CompatibilityDevice * This,
|
||||
REFIID riid,
|
||||
_COM_Outptr_ void **ppvObject);
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, AddRef)
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
ID3D12CompatibilityDevice * This);
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, Release)
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
ID3D12CompatibilityDevice * This);
|
||||
|
||||
DECLSPEC_XFGVIRT(ID3D12CompatibilityDevice, CreateSharedResource)
|
||||
HRESULT ( STDMETHODCALLTYPE *CreateSharedResource )(
|
||||
ID3D12CompatibilityDevice * This,
|
||||
_In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
|
||||
D3D12_HEAP_FLAGS HeapFlags,
|
||||
_In_ const D3D12_RESOURCE_DESC *pDesc,
|
||||
D3D12_RESOURCE_STATES InitialResourceState,
|
||||
_In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
|
||||
_In_opt_ const D3D11_RESOURCE_FLAGS *pFlags11,
|
||||
D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags,
|
||||
_In_opt_ ID3D12LifetimeTracker *pLifetimeTracker,
|
||||
_In_opt_ ID3D12SwapChainAssistant *pOwningSwapchain,
|
||||
REFIID riid,
|
||||
_COM_Outptr_opt_ void **ppResource);
|
||||
|
||||
DECLSPEC_XFGVIRT(ID3D12CompatibilityDevice, CreateSharedHeap)
|
||||
HRESULT ( STDMETHODCALLTYPE *CreateSharedHeap )(
|
||||
ID3D12CompatibilityDevice * This,
|
||||
_In_ const D3D12_HEAP_DESC *pHeapDesc,
|
||||
D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags,
|
||||
REFIID riid,
|
||||
_COM_Outptr_opt_ void **ppHeap);
|
||||
|
||||
DECLSPEC_XFGVIRT(ID3D12CompatibilityDevice, ReflectSharedProperties)
|
||||
HRESULT ( STDMETHODCALLTYPE *ReflectSharedProperties )(
|
||||
ID3D12CompatibilityDevice * This,
|
||||
_In_ ID3D12Object *pHeapOrResource,
|
||||
D3D12_REFLECT_SHARED_PROPERTY ReflectType,
|
||||
_Out_writes_bytes_(DataSize) void *pData,
|
||||
UINT DataSize);
|
||||
|
||||
END_INTERFACE
|
||||
} ID3D12CompatibilityDeviceVtbl;
|
||||
|
||||
interface ID3D12CompatibilityDevice
|
||||
{
|
||||
CONST_VTBL struct ID3D12CompatibilityDeviceVtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define ID3D12CompatibilityDevice_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define ID3D12CompatibilityDevice_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define ID3D12CompatibilityDevice_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#define ID3D12CompatibilityDevice_CreateSharedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pFlags11,CompatibilityFlags,pLifetimeTracker,pOwningSwapchain,riid,ppResource) \
|
||||
( (This)->lpVtbl -> CreateSharedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pFlags11,CompatibilityFlags,pLifetimeTracker,pOwningSwapchain,riid,ppResource) )
|
||||
|
||||
#define ID3D12CompatibilityDevice_CreateSharedHeap(This,pHeapDesc,CompatibilityFlags,riid,ppHeap) \
|
||||
( (This)->lpVtbl -> CreateSharedHeap(This,pHeapDesc,CompatibilityFlags,riid,ppHeap) )
|
||||
|
||||
#define ID3D12CompatibilityDevice_ReflectSharedProperties(This,pHeapOrResource,ReflectType,pData,DataSize) \
|
||||
( (This)->lpVtbl -> ReflectSharedProperties(This,pHeapOrResource,ReflectType,pData,DataSize) )
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __ID3D12CompatibilityDevice_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __D3D11On12CreatorID_INTERFACE_DEFINED__
|
||||
#define __D3D11On12CreatorID_INTERFACE_DEFINED__
|
||||
|
||||
/* interface D3D11On12CreatorID */
|
||||
/* [unique][local][object][uuid] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_D3D11On12CreatorID;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("edbf5678-2960-4e81-8429-99d4b2630c4e")
|
||||
D3D11On12CreatorID : public IUnknown
|
||||
{
|
||||
public:
|
||||
};
|
||||
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct D3D11On12CreatorIDVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
D3D11On12CreatorID * This,
|
||||
REFIID riid,
|
||||
_COM_Outptr_ void **ppvObject);
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, AddRef)
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
D3D11On12CreatorID * This);
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, Release)
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
D3D11On12CreatorID * This);
|
||||
|
||||
END_INTERFACE
|
||||
} D3D11On12CreatorIDVtbl;
|
||||
|
||||
interface D3D11On12CreatorID
|
||||
{
|
||||
CONST_VTBL struct D3D11On12CreatorIDVtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define D3D11On12CreatorID_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define D3D11On12CreatorID_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define D3D11On12CreatorID_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __D3D11On12CreatorID_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __D3D9On12CreatorID_INTERFACE_DEFINED__
|
||||
#define __D3D9On12CreatorID_INTERFACE_DEFINED__
|
||||
|
||||
/* interface D3D9On12CreatorID */
|
||||
/* [unique][local][object][uuid] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_D3D9On12CreatorID;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("fffcbb7f-15d3-42a2-841e-9d8d32f37ddd")
|
||||
D3D9On12CreatorID : public IUnknown
|
||||
{
|
||||
public:
|
||||
};
|
||||
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct D3D9On12CreatorIDVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
D3D9On12CreatorID * This,
|
||||
REFIID riid,
|
||||
_COM_Outptr_ void **ppvObject);
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, AddRef)
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
D3D9On12CreatorID * This);
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, Release)
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
D3D9On12CreatorID * This);
|
||||
|
||||
END_INTERFACE
|
||||
} D3D9On12CreatorIDVtbl;
|
||||
|
||||
interface D3D9On12CreatorID
|
||||
{
|
||||
CONST_VTBL struct D3D9On12CreatorIDVtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define D3D9On12CreatorID_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define D3D9On12CreatorID_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define D3D9On12CreatorID_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __D3D9On12CreatorID_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __OpenGLOn12CreatorID_INTERFACE_DEFINED__
|
||||
#define __OpenGLOn12CreatorID_INTERFACE_DEFINED__
|
||||
|
||||
/* interface OpenGLOn12CreatorID */
|
||||
/* [unique][local][object][uuid] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_OpenGLOn12CreatorID;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("6bb3cd34-0d19-45ab-97ed-d720ba3dfc80")
|
||||
OpenGLOn12CreatorID : public IUnknown
|
||||
{
|
||||
public:
|
||||
};
|
||||
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct OpenGLOn12CreatorIDVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
OpenGLOn12CreatorID * This,
|
||||
REFIID riid,
|
||||
_COM_Outptr_ void **ppvObject);
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, AddRef)
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
OpenGLOn12CreatorID * This);
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, Release)
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
OpenGLOn12CreatorID * This);
|
||||
|
||||
END_INTERFACE
|
||||
} OpenGLOn12CreatorIDVtbl;
|
||||
|
||||
interface OpenGLOn12CreatorID
|
||||
{
|
||||
CONST_VTBL struct OpenGLOn12CreatorIDVtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define OpenGLOn12CreatorID_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define OpenGLOn12CreatorID_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define OpenGLOn12CreatorID_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __OpenGLOn12CreatorID_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __OpenCLOn12CreatorID_INTERFACE_DEFINED__
|
||||
#define __OpenCLOn12CreatorID_INTERFACE_DEFINED__
|
||||
|
||||
/* interface OpenCLOn12CreatorID */
|
||||
/* [unique][local][object][uuid] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_OpenCLOn12CreatorID;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("3f76bb74-91b5-4a88-b126-20ca0331cd60")
|
||||
OpenCLOn12CreatorID : public IUnknown
|
||||
{
|
||||
public:
|
||||
};
|
||||
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct OpenCLOn12CreatorIDVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
OpenCLOn12CreatorID * This,
|
||||
REFIID riid,
|
||||
_COM_Outptr_ void **ppvObject);
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, AddRef)
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
OpenCLOn12CreatorID * This);
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, Release)
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
OpenCLOn12CreatorID * This);
|
||||
|
||||
END_INTERFACE
|
||||
} OpenCLOn12CreatorIDVtbl;
|
||||
|
||||
interface OpenCLOn12CreatorID
|
||||
{
|
||||
CONST_VTBL struct OpenCLOn12CreatorIDVtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define OpenCLOn12CreatorID_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define OpenCLOn12CreatorID_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define OpenCLOn12CreatorID_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __OpenCLOn12CreatorID_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __DirectMLTensorFlowCreatorID_INTERFACE_DEFINED__
|
||||
#define __DirectMLTensorFlowCreatorID_INTERFACE_DEFINED__
|
||||
|
||||
/* interface DirectMLTensorFlowCreatorID */
|
||||
/* [unique][local][object][uuid] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_DirectMLTensorFlowCreatorID;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("cb7490ac-8a0f-44ec-9b7b-6f4cafe8e9ab")
|
||||
DirectMLTensorFlowCreatorID : public IUnknown
|
||||
{
|
||||
public:
|
||||
};
|
||||
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct DirectMLTensorFlowCreatorIDVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
DirectMLTensorFlowCreatorID * This,
|
||||
REFIID riid,
|
||||
_COM_Outptr_ void **ppvObject);
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, AddRef)
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
DirectMLTensorFlowCreatorID * This);
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, Release)
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
DirectMLTensorFlowCreatorID * This);
|
||||
|
||||
END_INTERFACE
|
||||
} DirectMLTensorFlowCreatorIDVtbl;
|
||||
|
||||
interface DirectMLTensorFlowCreatorID
|
||||
{
|
||||
CONST_VTBL struct DirectMLTensorFlowCreatorIDVtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define DirectMLTensorFlowCreatorID_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define DirectMLTensorFlowCreatorID_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define DirectMLTensorFlowCreatorID_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __DirectMLTensorFlowCreatorID_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
#ifndef __DirectMLPyTorchCreatorID_INTERFACE_DEFINED__
|
||||
#define __DirectMLPyTorchCreatorID_INTERFACE_DEFINED__
|
||||
|
||||
/* interface DirectMLPyTorchCreatorID */
|
||||
/* [unique][local][object][uuid] */
|
||||
|
||||
|
||||
EXTERN_C const IID IID_DirectMLPyTorchCreatorID;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
|
||||
MIDL_INTERFACE("af029192-fba1-4b05-9116-235e06560354")
|
||||
DirectMLPyTorchCreatorID : public IUnknown
|
||||
{
|
||||
public:
|
||||
};
|
||||
|
||||
|
||||
#else /* C style interface */
|
||||
|
||||
typedef struct DirectMLPyTorchCreatorIDVtbl
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
DirectMLPyTorchCreatorID * This,
|
||||
REFIID riid,
|
||||
_COM_Outptr_ void **ppvObject);
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, AddRef)
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
DirectMLPyTorchCreatorID * This);
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, Release)
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
DirectMLPyTorchCreatorID * This);
|
||||
|
||||
END_INTERFACE
|
||||
} DirectMLPyTorchCreatorIDVtbl;
|
||||
|
||||
interface DirectMLPyTorchCreatorID
|
||||
{
|
||||
CONST_VTBL struct DirectMLPyTorchCreatorIDVtbl *lpVtbl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef COBJMACROS
|
||||
|
||||
|
||||
#define DirectMLPyTorchCreatorID_QueryInterface(This,riid,ppvObject) \
|
||||
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
|
||||
|
||||
#define DirectMLPyTorchCreatorID_AddRef(This) \
|
||||
( (This)->lpVtbl -> AddRef(This) )
|
||||
|
||||
#define DirectMLPyTorchCreatorID_Release(This) \
|
||||
( (This)->lpVtbl -> Release(This) )
|
||||
|
||||
|
||||
#endif /* COBJMACROS */
|
||||
|
||||
|
||||
#endif /* C style interface */
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* __DirectMLPyTorchCreatorID_INTERFACE_DEFINED__ */
|
||||
|
||||
|
||||
/* interface __MIDL_itf_d3d12compatibility_0000_0007 */
|
||||
/* [local] */
|
||||
|
||||
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */
|
||||
#pragma endregion
|
||||
DEFINE_GUID(IID_ID3D12CompatibilityDevice,0x8f1c0e3c,0xfae3,0x4a82,0xb0,0x98,0xbf,0xe1,0x70,0x82,0x07,0xff);
|
||||
DEFINE_GUID(IID_D3D11On12CreatorID,0xedbf5678,0x2960,0x4e81,0x84,0x29,0x99,0xd4,0xb2,0x63,0x0c,0x4e);
|
||||
DEFINE_GUID(IID_D3D9On12CreatorID,0xfffcbb7f,0x15d3,0x42a2,0x84,0x1e,0x9d,0x8d,0x32,0xf3,0x7d,0xdd);
|
||||
DEFINE_GUID(IID_OpenGLOn12CreatorID,0x6bb3cd34,0x0d19,0x45ab,0x97,0xed,0xd7,0x20,0xba,0x3d,0xfc,0x80);
|
||||
DEFINE_GUID(IID_OpenCLOn12CreatorID,0x3f76bb74,0x91b5,0x4a88,0xb1,0x26,0x20,0xca,0x03,0x31,0xcd,0x60);
|
||||
DEFINE_GUID(IID_DirectMLTensorFlowCreatorID,0xcb7490ac,0x8a0f,0x44ec,0x9b,0x7b,0x6f,0x4c,0xaf,0xe8,0xe9,0xab);
|
||||
DEFINE_GUID(IID_DirectMLPyTorchCreatorID,0xaf029192,0xfba1,0x4b05,0x91,0x16,0x23,0x5e,0x06,0x56,0x03,0x54);
|
||||
|
||||
|
||||
extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0007_v0_0_c_ifspec;
|
||||
extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0007_v0_0_s_ifspec;
|
||||
|
||||
/* Additional Prototypes for ALL interfaces */
|
||||
|
||||
/* end of Additional Prototypes */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
4110
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12sdklayers.h
vendored
Normal file
4110
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12sdklayers.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,7 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
//
|
||||
// File: D3D12Shader.h
|
||||
// Content: D3D12 Shader Types and APIs
|
||||
@ -14,16 +15,29 @@
|
||||
|
||||
typedef enum D3D12_SHADER_VERSION_TYPE
|
||||
{
|
||||
D3D12_SHVER_PIXEL_SHADER = 0,
|
||||
D3D12_SHVER_VERTEX_SHADER = 1,
|
||||
D3D12_SHVER_GEOMETRY_SHADER = 2,
|
||||
D3D12_SHVER_PIXEL_SHADER = 0,
|
||||
D3D12_SHVER_VERTEX_SHADER = 1,
|
||||
D3D12_SHVER_GEOMETRY_SHADER = 2,
|
||||
|
||||
// D3D11 Shaders
|
||||
D3D12_SHVER_HULL_SHADER = 3,
|
||||
D3D12_SHVER_DOMAIN_SHADER = 4,
|
||||
D3D12_SHVER_COMPUTE_SHADER = 5,
|
||||
D3D12_SHVER_HULL_SHADER = 3,
|
||||
D3D12_SHVER_DOMAIN_SHADER = 4,
|
||||
D3D12_SHVER_COMPUTE_SHADER = 5,
|
||||
|
||||
D3D12_SHVER_RESERVED0 = 0xFFF0,
|
||||
// D3D12 Shaders
|
||||
D3D12_SHVER_LIBRARY = 6,
|
||||
|
||||
D3D12_SHVER_RAY_GENERATION_SHADER = 7,
|
||||
D3D12_SHVER_INTERSECTION_SHADER = 8,
|
||||
D3D12_SHVER_ANY_HIT_SHADER = 9,
|
||||
D3D12_SHVER_CLOSEST_HIT_SHADER = 10,
|
||||
D3D12_SHVER_MISS_SHADER = 11,
|
||||
D3D12_SHVER_CALLABLE_SHADER = 12,
|
||||
|
||||
D3D12_SHVER_MESH_SHADER = 13,
|
||||
D3D12_SHVER_AMPLIFICATION_SHADER = 14,
|
||||
|
||||
D3D12_SHVER_RESERVED0 = 0xFFF0,
|
||||
} D3D12_SHADER_VERSION_TYPE;
|
||||
|
||||
#define D3D12_SHVER_GET_TYPE(_Version) \
|
||||
@ -172,6 +186,23 @@ typedef struct _D3D12_SHADER_INPUT_BIND_DESC
|
||||
#define D3D_SHADER_REQUIRES_TYPED_UAV_LOAD_ADDITIONAL_FORMATS 0x00000800
|
||||
#define D3D_SHADER_REQUIRES_ROVS 0x00001000
|
||||
#define D3D_SHADER_REQUIRES_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x00002000
|
||||
#define D3D_SHADER_REQUIRES_WAVE_OPS 0x00004000
|
||||
#define D3D_SHADER_REQUIRES_INT64_OPS 0x00008000
|
||||
#define D3D_SHADER_REQUIRES_VIEW_ID 0x00010000
|
||||
#define D3D_SHADER_REQUIRES_BARYCENTRICS 0x00020000
|
||||
#define D3D_SHADER_REQUIRES_NATIVE_16BIT_OPS 0x00040000
|
||||
#define D3D_SHADER_REQUIRES_SHADING_RATE 0x00080000
|
||||
#define D3D_SHADER_REQUIRES_RAYTRACING_TIER_1_1 0x00100000
|
||||
#define D3D_SHADER_REQUIRES_SAMPLER_FEEDBACK 0x00200000
|
||||
#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_TYPED_RESOURCE 0x00400000
|
||||
#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_GROUP_SHARED 0x00800000
|
||||
#define D3D_SHADER_REQUIRES_DERIVATIVES_IN_MESH_AND_AMPLIFICATION_SHADERS 0x01000000
|
||||
#define D3D_SHADER_REQUIRES_RESOURCE_DESCRIPTOR_HEAP_INDEXING 0x02000000
|
||||
#define D3D_SHADER_REQUIRES_SAMPLER_DESCRIPTOR_HEAP_INDEXING 0x04000000
|
||||
#define D3D_SHADER_REQUIRES_WAVE_MMA 0x08000000
|
||||
#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE 0x10000000
|
||||
#define D3D_SHADER_FEATURE_ADVANCED_TEXTURE_OPS 0x20000000
|
||||
#define D3D_SHADER_FEATURE_WRITEABLE_MSAA_TEXTURES 0x40000000
|
||||
|
||||
|
||||
typedef struct _D3D12_LIBRARY_DESC
|
8584
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12video.h
vendored
Normal file
8584
3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12video.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -42,7 +42,7 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500)
|
||||
#if !defined(HMONITOR_DECLARED) && (!defined(WINVER) || WINVER < 0x0500)
|
||||
#define HMONITOR_DECLARED
|
||||
DECLARE_HANDLE(HMONITOR);
|
||||
#endif
|
@ -1,16 +1,22 @@
|
||||
/*-------------------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (c) Microsoft Corporation
|
||||
* Licensed under the MIT license
|
||||
*
|
||||
*-------------------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
|
||||
|
||||
|
||||
/* File created by MIDL compiler version 8.01.0622 */
|
||||
/* File created by MIDL compiler version 8.01.0628 */
|
||||
/* @@MIDL_FILE_HEADING( ) */
|
||||
|
||||
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
||||
@ -37,59 +43,13 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER <= 1600
|
||||
#ifndef VS2008_SAL_COMPAT
|
||||
#define VS2008_SAL_COMPAT
|
||||
// BK - SAL compatibility for VS2008
|
||||
|
||||
#if _MSC_VER < 1600
|
||||
#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \
|
||||
extern "C++" { \
|
||||
inline ENUMTYPE operator | (ENUMTYPE _a, ENUMTYPE _b) { return ENUMTYPE ( ( (int) _a) | ( (int)_b) ); } \
|
||||
inline ENUMTYPE operator |= (ENUMTYPE &_a, ENUMTYPE _b) { return (ENUMTYPE &)( ( (int &)_a) |= ( (int)_b) ); } \
|
||||
inline ENUMTYPE operator & (ENUMTYPE _a, ENUMTYPE _b) { return ENUMTYPE ( ( (int) _a) & ( (int)_b) ); } \
|
||||
inline ENUMTYPE operator &= (ENUMTYPE &_a, ENUMTYPE _b) { return (ENUMTYPE &)( ( (int &)_a) &= ( (int)_b) ); } \
|
||||
inline ENUMTYPE operator ~ (ENUMTYPE _a) { return (ENUMTYPE) (~( (int) _a) ); } \
|
||||
inline ENUMTYPE operator ^ (ENUMTYPE _a, ENUMTYPE _b) { return ENUMTYPE ( ( (int) _a) ^ ( (int)_b) ); } \
|
||||
inline ENUMTYPE operator ^= (ENUMTYPE &_a, ENUMTYPE _b) { return (ENUMTYPE &)( ( (int &)_a) ^= ( (int)_b) ); } \
|
||||
}
|
||||
#endif // _MSC_VER < 1600
|
||||
|
||||
#undef _Out_
|
||||
#define _Out_
|
||||
#undef _In_
|
||||
#define _In_
|
||||
#undef _Always_
|
||||
#define _Always_(annos)
|
||||
#define _In_reads_(size)
|
||||
#define _In_reads_opt_(size)
|
||||
#define _In_reads_bytes_(size)
|
||||
#define _In_reads_bytes_opt_(size)
|
||||
#define _Inout_updates_bytes_(size)
|
||||
#define _Out_writes_(size)
|
||||
#define _Out_writes_opt_(size)
|
||||
#define _Out_writes_to_opt_(size,count)
|
||||
#define _Out_writes_bytes_(size)
|
||||
#define _Out_writes_bytes_opt_(size)
|
||||
#define _Out_writes_bytes_to_(size,count)
|
||||
#define _Outptr_
|
||||
#define _Outptr_opt_
|
||||
#define _Outptr_opt_result_maybenull_
|
||||
#define _Outptr_opt_result_bytebuffer_(size)
|
||||
#define _Outptr_result_maybenull_
|
||||
#define _Outptr_result_bytebuffer_(size)
|
||||
#define _Out_writes_all_opt_(size)
|
||||
#define _COM_Outptr_
|
||||
#define _COM_Outptr_opt_
|
||||
#define _COM_Outptr_opt_result_maybenull_
|
||||
#define _Field_size_(size)
|
||||
#define _Field_size_full_(size)
|
||||
#define _Field_size_opt_(size)
|
||||
#define _Field_size_bytes_full_(size)
|
||||
#define nullptr NULL
|
||||
|
||||
#endif // BK - VS2008_SAL_COMPAT
|
||||
#endif //
|
||||
#ifndef DECLSPEC_XFGVIRT
|
||||
#if defined(_CONTROL_FLOW_GUARD_XFG)
|
||||
#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func))
|
||||
#else
|
||||
#define DECLSPEC_XFGVIRT(base, func)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Forward Declarations */
|
||||
|
||||
@ -133,6 +93,7 @@ enum D3D_DRIVER_TYPE
|
||||
typedef
|
||||
enum D3D_FEATURE_LEVEL
|
||||
{
|
||||
D3D_FEATURE_LEVEL_1_0_CORE = 0x1000,
|
||||
D3D_FEATURE_LEVEL_9_1 = 0x9100,
|
||||
D3D_FEATURE_LEVEL_9_2 = 0x9200,
|
||||
D3D_FEATURE_LEVEL_9_3 = 0x9300,
|
||||
@ -141,7 +102,8 @@ enum D3D_FEATURE_LEVEL
|
||||
D3D_FEATURE_LEVEL_11_0 = 0xb000,
|
||||
D3D_FEATURE_LEVEL_11_1 = 0xb100,
|
||||
D3D_FEATURE_LEVEL_12_0 = 0xc000,
|
||||
D3D_FEATURE_LEVEL_12_1 = 0xc100
|
||||
D3D_FEATURE_LEVEL_12_1 = 0xc100,
|
||||
D3D_FEATURE_LEVEL_12_2 = 0xc200
|
||||
} D3D_FEATURE_LEVEL;
|
||||
|
||||
#define D3D_FL9_1_REQ_TEXTURE1D_U_DIMENSION 2048
|
||||
@ -168,6 +130,7 @@ enum D3D_PRIMITIVE_TOPOLOGY
|
||||
D3D_PRIMITIVE_TOPOLOGY_LINESTRIP = 3,
|
||||
D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4,
|
||||
D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5,
|
||||
D3D_PRIMITIVE_TOPOLOGY_TRIANGLEFAN = 6,
|
||||
D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10,
|
||||
D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11,
|
||||
D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12,
|
||||
@ -395,6 +358,37 @@ enum D3D_SRV_DIMENSION
|
||||
D3D11_SRV_DIMENSION_BUFFEREX = D3D_SRV_DIMENSION_BUFFEREX
|
||||
} D3D_SRV_DIMENSION;
|
||||
|
||||
#define D3D_SHADER_FEATURE_DOUBLES 0x00001
|
||||
#define D3D_SHADER_FEATURE_COMPUTE_SHADERS_PLUS_RAW_AND_STRUCTURED_BUFFERS_VIA_SHADER_4_X 0x00002
|
||||
#define D3D_SHADER_FEATURE_UAVS_AT_EVERY_STAGE 0x00004
|
||||
#define D3D_SHADER_FEATURE_64_UAVS 0x00008
|
||||
#define D3D_SHADER_FEATURE_MINIMUM_PRECISION 0x00010
|
||||
#define D3D_SHADER_FEATURE_11_1_DOUBLE_EXTENSIONS 0x00020
|
||||
#define D3D_SHADER_FEATURE_11_1_SHADER_EXTENSIONS 0x00040
|
||||
#define D3D_SHADER_FEATURE_LEVEL_9_COMPARISON_FILTERING 0x00080
|
||||
#define D3D_SHADER_FEATURE_TILED_RESOURCES 0x00100
|
||||
#define D3D_SHADER_FEATURE_STENCIL_REF 0x00200
|
||||
#define D3D_SHADER_FEATURE_INNER_COVERAGE 0x00400
|
||||
#define D3D_SHADER_FEATURE_TYPED_UAV_LOAD_ADDITIONAL_FORMATS 0x00800
|
||||
#define D3D_SHADER_FEATURE_ROVS 0x01000
|
||||
#define D3D_SHADER_FEATURE_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x02000
|
||||
#define D3D_SHADER_FEATURE_WAVE_OPS 0x04000
|
||||
#define D3D_SHADER_FEATURE_INT64_OPS 0x08000
|
||||
#define D3D_SHADER_FEATURE_VIEW_ID 0x10000
|
||||
#define D3D_SHADER_FEATURE_BARYCENTRICS 0x20000
|
||||
#define D3D_SHADER_FEATURE_NATIVE_16BIT_OPS 0x40000
|
||||
#define D3D_SHADER_FEATURE_SHADING_RATE 0x80000
|
||||
#define D3D_SHADER_FEATURE_RAYTRACING_TIER_1_1 0x100000
|
||||
#define D3D_SHADER_FEATURE_SAMPLER_FEEDBACK 0x200000
|
||||
#define D3D_SHADER_FEATURE_ATOMIC_INT64_ON_TYPED_RESOURCE 0x400000
|
||||
#define D3D_SHADER_FEATURE_ATOMIC_INT64_ON_GROUP_SHARED 0x800000
|
||||
#define D3D_SHADER_FEATURE_DERIVATIVES_IN_MESH_AND_AMPLIFICATION_SHADERS 0x1000000
|
||||
#define D3D_SHADER_FEATURE_RESOURCE_DESCRIPTOR_HEAP_INDEXING 0x2000000
|
||||
#define D3D_SHADER_FEATURE_SAMPLER_DESCRIPTOR_HEAP_INDEXING 0x4000000
|
||||
#define D3D_SHADER_FEATURE_WAVE_MMA 0x8000000
|
||||
#define D3D_SHADER_FEATURE_ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE 0x10000000
|
||||
#define D3D_SHADER_FEATURE_ADVANCED_TEXTURE_OPS 0x20000000
|
||||
#define D3D_SHADER_FEATURE_WRITEABLE_MSAA_TEXTURES 0x40000000
|
||||
typedef struct _D3D_SHADER_MACRO
|
||||
{
|
||||
LPCSTR Name;
|
||||
@ -437,21 +431,26 @@ EXTERN_C const IID IID_ID3D10Blob;
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
ID3D10Blob * This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [annotation][iid_is][out] */
|
||||
_COM_Outptr_ void **ppvObject);
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, AddRef)
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
ID3D10Blob * This);
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, Release)
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
ID3D10Blob * This);
|
||||
|
||||
DECLSPEC_XFGVIRT(ID3D10Blob, GetBufferPointer)
|
||||
LPVOID ( STDMETHODCALLTYPE *GetBufferPointer )(
|
||||
ID3D10Blob * This);
|
||||
|
||||
DECLSPEC_XFGVIRT(ID3D10Blob, GetBufferSize)
|
||||
SIZE_T ( STDMETHODCALLTYPE *GetBufferSize )(
|
||||
ID3D10Blob * This);
|
||||
|
||||
@ -547,18 +546,22 @@ EXTERN_C const IID IID_ID3DDestructionNotifier;
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
|
||||
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
|
||||
ID3DDestructionNotifier * This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [annotation][iid_is][out] */
|
||||
_COM_Outptr_ void **ppvObject);
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, AddRef)
|
||||
ULONG ( STDMETHODCALLTYPE *AddRef )(
|
||||
ID3DDestructionNotifier * This);
|
||||
|
||||
DECLSPEC_XFGVIRT(IUnknown, Release)
|
||||
ULONG ( STDMETHODCALLTYPE *Release )(
|
||||
ID3DDestructionNotifier * This);
|
||||
|
||||
DECLSPEC_XFGVIRT(ID3DDestructionNotifier, RegisterDestructionCallback)
|
||||
HRESULT ( STDMETHODCALLTYPE *RegisterDestructionCallback )(
|
||||
ID3DDestructionNotifier * This,
|
||||
/* [annotation] */
|
||||
@ -568,6 +571,7 @@ EXTERN_C const IID IID_ID3DDestructionNotifier;
|
||||
/* [annotation] */
|
||||
_Out_ UINT *pCallbackID);
|
||||
|
||||
DECLSPEC_XFGVIRT(ID3DDestructionNotifier, UnregisterDestructionCallback)
|
||||
HRESULT ( STDMETHODCALLTYPE *UnregisterDestructionCallback )(
|
||||
ID3DDestructionNotifier * This,
|
||||
/* [annotation] */
|
||||
@ -732,6 +736,11 @@ enum _D3D_SHADER_VARIABLE_TYPE
|
||||
D3D_SVT_MIN12INT = 55,
|
||||
D3D_SVT_MIN16INT = 56,
|
||||
D3D_SVT_MIN16UINT = 57,
|
||||
D3D_SVT_INT16 = 58,
|
||||
D3D_SVT_UINT16 = 59,
|
||||
D3D_SVT_FLOAT16 = 60,
|
||||
D3D_SVT_INT64 = 61,
|
||||
D3D_SVT_UINT64 = 62,
|
||||
D3D10_SVT_VOID = D3D_SVT_VOID,
|
||||
D3D10_SVT_BOOL = D3D_SVT_BOOL,
|
||||
D3D10_SVT_INT = D3D_SVT_INT,
|
||||
@ -819,6 +828,8 @@ enum _D3D_SHADER_INPUT_TYPE
|
||||
D3D_SIT_UAV_APPEND_STRUCTURED = ( D3D_SIT_UAV_RWBYTEADDRESS + 1 ) ,
|
||||
D3D_SIT_UAV_CONSUME_STRUCTURED = ( D3D_SIT_UAV_APPEND_STRUCTURED + 1 ) ,
|
||||
D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER = ( D3D_SIT_UAV_CONSUME_STRUCTURED + 1 ) ,
|
||||
D3D_SIT_RTACCELERATIONSTRUCTURE = ( D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER + 1 ) ,
|
||||
D3D_SIT_UAV_FEEDBACKTEXTURE = ( D3D_SIT_RTACCELERATIONSTRUCTURE + 1 ) ,
|
||||
D3D10_SIT_CBUFFER = D3D_SIT_CBUFFER,
|
||||
D3D10_SIT_TBUFFER = D3D_SIT_TBUFFER,
|
||||
D3D10_SIT_TEXTURE = D3D_SIT_TEXTURE,
|
||||
@ -876,6 +887,9 @@ enum D3D_NAME
|
||||
D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR = 14,
|
||||
D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR = 15,
|
||||
D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR = 16,
|
||||
D3D_NAME_BARYCENTRICS = 23,
|
||||
D3D_NAME_SHADINGRATE = 24,
|
||||
D3D_NAME_CULLPRIMITIVE = 25,
|
||||
D3D_NAME_TARGET = 64,
|
||||
D3D_NAME_DEPTH = 65,
|
||||
D3D_NAME_COVERAGE = 66,
|
||||
@ -906,7 +920,10 @@ enum D3D_NAME
|
||||
D3D11_NAME_DEPTH_GREATER_EQUAL = D3D_NAME_DEPTH_GREATER_EQUAL,
|
||||
D3D11_NAME_DEPTH_LESS_EQUAL = D3D_NAME_DEPTH_LESS_EQUAL,
|
||||
D3D11_NAME_STENCIL_REF = D3D_NAME_STENCIL_REF,
|
||||
D3D11_NAME_INNER_COVERAGE = D3D_NAME_INNER_COVERAGE
|
||||
D3D11_NAME_INNER_COVERAGE = D3D_NAME_INNER_COVERAGE,
|
||||
D3D12_NAME_BARYCENTRICS = D3D_NAME_BARYCENTRICS,
|
||||
D3D12_NAME_SHADINGRATE = D3D_NAME_SHADINGRATE,
|
||||
D3D12_NAME_CULLPRIMITIVE = D3D_NAME_CULLPRIMITIVE
|
||||
} D3D_NAME;
|
||||
|
||||
typedef
|
||||
@ -1027,9 +1044,50 @@ enum _D3D_PARAMETER_FLAGS
|
||||
D3D_PF_FORCE_DWORD = 0x7fffffff
|
||||
} D3D_PARAMETER_FLAGS;
|
||||
|
||||
typedef
|
||||
enum D3D_FORMAT_LAYOUT
|
||||
{
|
||||
D3DFL_STANDARD = 0,
|
||||
D3DFL_CUSTOM = -1
|
||||
} D3D_FORMAT_LAYOUT;
|
||||
|
||||
typedef
|
||||
enum D3D_FORMAT_TYPE_LEVEL
|
||||
{
|
||||
D3DFTL_NO_TYPE = 0,
|
||||
D3DFTL_PARTIAL_TYPE = -2,
|
||||
D3DFTL_FULL_TYPE = -1
|
||||
} D3D_FORMAT_TYPE_LEVEL;
|
||||
|
||||
typedef
|
||||
enum D3D_FORMAT_COMPONENT_NAME
|
||||
{
|
||||
D3DFCN_R = -4,
|
||||
D3DFCN_G = -3,
|
||||
D3DFCN_B = -2,
|
||||
D3DFCN_A = -1,
|
||||
D3DFCN_D = 0,
|
||||
D3DFCN_S = 1,
|
||||
D3DFCN_X = 2
|
||||
} D3D_FORMAT_COMPONENT_NAME;
|
||||
|
||||
typedef
|
||||
enum D3D_FORMAT_COMPONENT_INTERPRETATION
|
||||
{
|
||||
D3DFCI_TYPELESS = 0,
|
||||
D3DFCI_FLOAT = -4,
|
||||
D3DFCI_SNORM = -3,
|
||||
D3DFCI_UNORM = -2,
|
||||
D3DFCI_SINT = -1,
|
||||
D3DFCI_UINT = 1,
|
||||
D3DFCI_UNORM_SRGB = 2,
|
||||
D3DFCI_BIASED_FIXED_2_8 = 3
|
||||
} D3D_FORMAT_COMPONENT_INTERPRETATION;
|
||||
|
||||
DEFINE_GUID(WKPDID_D3DDebugObjectName,0x429b8c22,0x9188,0x4b0c,0x87,0x42,0xac,0xb0,0xbf,0x85,0xc2,0x00);
|
||||
DEFINE_GUID(WKPDID_D3DDebugObjectNameW,0x4cca5fd8,0x921f,0x42c8,0x85,0x66,0x70,0xca,0xf2,0xa9,0xb7,0x41);
|
||||
DEFINE_GUID(WKPDID_CommentStringW,0xd0149dc0,0x90e8,0x4ec8,0x81, 0x44, 0xe9, 0x00, 0xad, 0x26, 0x6b, 0xb2);
|
||||
DEFINE_GUID(WKPDID_D3D12UniqueObjectId, 0x1b39de15, 0xec04, 0x4bae, 0xba, 0x4d, 0x8c, 0xef, 0x79, 0xfc, 0x04, 0xc1);
|
||||
#define D3D_SET_OBJECT_NAME_N_A(pObject, Chars, pName) (pObject)->SetPrivateData(WKPDID_D3DDebugObjectName, Chars, pName)
|
||||
#define D3D_SET_OBJECT_NAME_A(pObject, pName) D3D_SET_OBJECT_NAME_N_A(pObject, lstrlenA(pName), pName)
|
||||
#define D3D_SET_OBJECT_NAME_N_W(pObject, Chars, pName) (pObject)->SetPrivateData(WKPDID_D3DDebugObjectNameW, Chars*2, pName)
|
||||
@ -1038,6 +1096,8 @@ DEFINE_GUID(WKPDID_CommentStringW,0xd0149dc0,0x90e8,0x4ec8,0x81, 0x44, 0xe9, 0x0
|
||||
#define D3D_COMPONENT_MASK_Y 2
|
||||
#define D3D_COMPONENT_MASK_Z 4
|
||||
#define D3D_COMPONENT_MASK_W 8
|
||||
DEFINE_GUID(D3D_TEXTURE_LAYOUT_ROW_MAJOR,0xb5dc234f,0x72bb,0x4bec,0x97,0x05,0x8c,0xf2,0x58,0xdf,0x6b,0x6c);
|
||||
DEFINE_GUID(D3D_TEXTURE_LAYOUT_64KB_STANDARD_SWIZZLE,0x4c0f29e3,0x3f5f,0x4d35,0x84,0xc9,0xbc,0x09,0x83,0xb6,0x2c,0x28);
|
||||
|
||||
|
||||
extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0002_v0_0_c_ifspec;
|
41
3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxcore.h
vendored
Normal file
41
3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxcore.h
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
/************************************************************
|
||||
* *
|
||||
* Copyright (c) Microsoft Corporation. *
|
||||
* Licensed under the MIT license. *
|
||||
* *
|
||||
************************************************************/
|
||||
|
||||
#ifndef _DXCOREEXTMODULE_H_
|
||||
#define _DXCOREEXTMODULE_H_
|
||||
|
||||
#include <winapifamily.h>
|
||||
#include "dxcore_interface.h"
|
||||
|
||||
#pragma region Application Family or OneCore Family
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
|
||||
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10)
|
||||
|
||||
STDAPI
|
||||
DXCoreCreateAdapterFactory(
|
||||
REFIID riid,
|
||||
_COM_Outptr_ void** ppvFactory
|
||||
);
|
||||
|
||||
template <class T>
|
||||
HRESULT
|
||||
DXCoreCreateAdapterFactory(
|
||||
_COM_Outptr_ T** ppvFactory
|
||||
)
|
||||
{
|
||||
return DXCoreCreateAdapterFactory(IID_PPV_ARGS(ppvFactory));
|
||||
}
|
||||
|
||||
#endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN10)
|
||||
|
||||
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
|
||||
#pragma endregion
|
||||
|
||||
#endif // _DXCOREEXTMODULE_H_
|
||||
|
||||
|
316
3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxcore_interface.h
vendored
Normal file
316
3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxcore_interface.h
vendored
Normal file
@ -0,0 +1,316 @@
|
||||
//
|
||||
// DXCore Interface
|
||||
// Copyright (C) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
//
|
||||
|
||||
#ifndef __dxcore_interface_h__
|
||||
#define __dxcore_interface_h__
|
||||
|
||||
#ifndef COM_NO_WINDOWS_H
|
||||
#include "windows.h"
|
||||
#include "ole2.h"
|
||||
#endif /*COM_NO_WINDOWS_H*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#define _FACDXCORE 0x880
|
||||
#define MAKE_DXCORE_HRESULT( code ) MAKE_HRESULT( 1, _FACDXCORE, code )
|
||||
|
||||
enum class DXCoreAdapterProperty : uint32_t
|
||||
{
|
||||
InstanceLuid = 0,
|
||||
DriverVersion = 1,
|
||||
DriverDescription = 2,
|
||||
HardwareID = 3, // Use HardwareIDParts instead, if available.
|
||||
KmdModelVersion = 4,
|
||||
ComputePreemptionGranularity = 5,
|
||||
GraphicsPreemptionGranularity = 6,
|
||||
DedicatedAdapterMemory = 7,
|
||||
DedicatedSystemMemory = 8,
|
||||
SharedSystemMemory = 9,
|
||||
AcgCompatible = 10,
|
||||
IsHardware = 11,
|
||||
IsIntegrated = 12,
|
||||
IsDetachable = 13,
|
||||
HardwareIDParts = 14
|
||||
};
|
||||
|
||||
enum class DXCoreAdapterState : uint32_t
|
||||
{
|
||||
IsDriverUpdateInProgress = 0,
|
||||
AdapterMemoryBudget = 1
|
||||
};
|
||||
|
||||
enum class DXCoreSegmentGroup : uint32_t
|
||||
{
|
||||
Local = 0,
|
||||
NonLocal = 1
|
||||
};
|
||||
|
||||
enum class DXCoreNotificationType : uint32_t
|
||||
{
|
||||
AdapterListStale = 0,
|
||||
AdapterNoLongerValid = 1,
|
||||
AdapterBudgetChange = 2,
|
||||
AdapterHardwareContentProtectionTeardown = 3
|
||||
};
|
||||
|
||||
enum class DXCoreAdapterPreference : uint32_t
|
||||
{
|
||||
Hardware = 0,
|
||||
MinimumPower = 1,
|
||||
HighPerformance = 2
|
||||
};
|
||||
|
||||
struct DXCoreHardwareID
|
||||
{
|
||||
uint32_t vendorID;
|
||||
uint32_t deviceID;
|
||||
uint32_t subSysID;
|
||||
uint32_t revision;
|
||||
};
|
||||
|
||||
struct DXCoreHardwareIDParts
|
||||
{
|
||||
uint32_t vendorID;
|
||||
uint32_t deviceID;
|
||||
uint32_t subSystemID;
|
||||
uint32_t subVendorID;
|
||||
uint32_t revisionID;
|
||||
};
|
||||
|
||||
struct DXCoreAdapterMemoryBudgetNodeSegmentGroup
|
||||
{
|
||||
uint32_t nodeIndex;
|
||||
DXCoreSegmentGroup segmentGroup;
|
||||
};
|
||||
|
||||
struct DXCoreAdapterMemoryBudget
|
||||
{
|
||||
uint64_t budget;
|
||||
uint64_t currentUsage;
|
||||
uint64_t availableForReservation;
|
||||
uint64_t currentReservation;
|
||||
};
|
||||
|
||||
typedef void (STDMETHODCALLTYPE *PFN_DXCORE_NOTIFICATION_CALLBACK)(
|
||||
DXCoreNotificationType notificationType,
|
||||
_In_ IUnknown *object,
|
||||
_In_opt_ void *context);
|
||||
|
||||
static_assert(sizeof(bool) == 1, "bool assumed as one byte");
|
||||
|
||||
DEFINE_GUID(IID_IDXCoreAdapterFactory, 0x78ee5945, 0xc36e, 0x4b13, 0xa6, 0x69, 0x00, 0x5d, 0xd1, 0x1c, 0x0f, 0x06);
|
||||
DEFINE_GUID(IID_IDXCoreAdapterList, 0x526c7776, 0x40e9, 0x459b, 0xb7, 0x11, 0xf3, 0x2a, 0xd7, 0x6d, 0xfc, 0x28);
|
||||
DEFINE_GUID(IID_IDXCoreAdapter, 0xf0db4c7f, 0xfe5a, 0x42a2, 0xbd, 0x62, 0xf2, 0xa6, 0xcf, 0x6f, 0xc8, 0x3e);
|
||||
DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D11_GRAPHICS, 0x8c47866b, 0x7583, 0x450d, 0xf0, 0xf0, 0x6b, 0xad, 0xa8, 0x95, 0xaf, 0x4b);
|
||||
DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS, 0x0c9ece4d, 0x2f6e, 0x4f01, 0x8c, 0x96, 0xe8, 0x9e, 0x33, 0x1b, 0x47, 0xb1);
|
||||
DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D12_CORE_COMPUTE, 0x248e2800, 0xa793, 0x4724, 0xab, 0xaa, 0x23, 0xa6, 0xde, 0x1b, 0xe0, 0x90);
|
||||
|
||||
/* interface IDXCoreAdapter */
|
||||
MIDL_INTERFACE("f0db4c7f-fe5a-42a2-bd62-f2a6cf6fc83e")
|
||||
IDXCoreAdapter : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual bool STDMETHODCALLTYPE IsValid() = 0;
|
||||
|
||||
virtual bool STDMETHODCALLTYPE IsAttributeSupported(
|
||||
REFGUID attributeGUID) = 0;
|
||||
|
||||
virtual bool STDMETHODCALLTYPE IsPropertySupported(
|
||||
DXCoreAdapterProperty property) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetProperty(
|
||||
DXCoreAdapterProperty property,
|
||||
size_t bufferSize,
|
||||
_Out_writes_bytes_(bufferSize) void *propertyData) = 0;
|
||||
|
||||
template <class T>
|
||||
HRESULT GetProperty(
|
||||
DXCoreAdapterProperty property,
|
||||
_Out_writes_bytes_(sizeof(T)) T *propertyData)
|
||||
{
|
||||
return GetProperty(property,
|
||||
sizeof(T),
|
||||
(void*)propertyData);
|
||||
}
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetPropertySize(
|
||||
DXCoreAdapterProperty property,
|
||||
_Out_ size_t *bufferSize) = 0;
|
||||
|
||||
virtual bool STDMETHODCALLTYPE IsQueryStateSupported(
|
||||
DXCoreAdapterState property) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE QueryState(
|
||||
DXCoreAdapterState state,
|
||||
size_t inputStateDetailsSize,
|
||||
_In_reads_bytes_opt_(inputStateDetailsSize) const void *inputStateDetails,
|
||||
size_t outputBufferSize,
|
||||
_Out_writes_bytes_(outputBufferSize) void *outputBuffer) = 0;
|
||||
|
||||
template <class T1, class T2>
|
||||
HRESULT QueryState(
|
||||
DXCoreAdapterState state,
|
||||
_In_reads_bytes_opt_(sizeof(T1)) const T1 *inputStateDetails,
|
||||
_Out_writes_bytes_(sizeof(T2)) T2 *outputBuffer)
|
||||
{
|
||||
return QueryState(state,
|
||||
sizeof(T1),
|
||||
(const void*)inputStateDetails,
|
||||
sizeof(T2),
|
||||
(void*)outputBuffer);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
HRESULT QueryState(
|
||||
DXCoreAdapterState state,
|
||||
_Out_writes_bytes_(sizeof(T)) T *outputBuffer)
|
||||
{
|
||||
return QueryState(state,
|
||||
0,
|
||||
nullptr,
|
||||
sizeof(T),
|
||||
(void*)outputBuffer);
|
||||
}
|
||||
|
||||
virtual bool STDMETHODCALLTYPE IsSetStateSupported(
|
||||
DXCoreAdapterState property) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetState(
|
||||
DXCoreAdapterState state,
|
||||
size_t inputStateDetailsSize,
|
||||
_In_reads_bytes_opt_(inputStateDetailsSize) const void *inputStateDetails,
|
||||
size_t inputDataSize,
|
||||
_In_reads_bytes_(inputDataSize) const void *inputData) = 0;
|
||||
|
||||
template <class T1, class T2>
|
||||
HRESULT SetState(
|
||||
DXCoreAdapterState state,
|
||||
const T1 *inputStateDetails,
|
||||
const T2 *inputData)
|
||||
{
|
||||
return SetState(state,
|
||||
sizeof(T1),
|
||||
(const void*)inputStateDetails,
|
||||
sizeof(T2),
|
||||
(const void*)inputData);
|
||||
}
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetFactory(
|
||||
REFIID riid,
|
||||
_COM_Outptr_ void** ppvFactory
|
||||
) = 0;
|
||||
|
||||
template <class T>
|
||||
HRESULT GetFactory(
|
||||
_COM_Outptr_ T** ppvFactory
|
||||
)
|
||||
{
|
||||
return GetFactory(IID_PPV_ARGS(ppvFactory));
|
||||
}
|
||||
};
|
||||
|
||||
/* interface IDXCoreAdapterList */
|
||||
MIDL_INTERFACE("526c7776-40e9-459b-b711-f32ad76dfc28")
|
||||
IDXCoreAdapterList : public IUnknown
|
||||
{
|
||||
public:
|
||||
virtual HRESULT STDMETHODCALLTYPE GetAdapter(
|
||||
uint32_t index,
|
||||
REFIID riid,
|
||||
_COM_Outptr_ void **ppvAdapter) = 0;
|
||||
|
||||
template<class T>
|
||||
HRESULT STDMETHODCALLTYPE GetAdapter(
|
||||
uint32_t index,
|
||||
_COM_Outptr_ T **ppvAdapter)
|
||||
{
|
||||
return GetAdapter(index,
|
||||
IID_PPV_ARGS(ppvAdapter));
|
||||
}
|
||||
|
||||
virtual uint32_t STDMETHODCALLTYPE GetAdapterCount() = 0;
|
||||
|
||||
virtual bool STDMETHODCALLTYPE IsStale() = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetFactory(
|
||||
REFIID riid,
|
||||
_COM_Outptr_ void** ppvFactory
|
||||
) = 0;
|
||||
|
||||
template <class T>
|
||||
HRESULT GetFactory(
|
||||
_COM_Outptr_ T** ppvFactory
|
||||
)
|
||||
{
|
||||
return GetFactory(IID_PPV_ARGS(ppvFactory));
|
||||
}
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE Sort(
|
||||
uint32_t numPreferences,
|
||||
_In_reads_(numPreferences) const DXCoreAdapterPreference* preferences) = 0;
|
||||
|
||||
virtual bool STDMETHODCALLTYPE IsAdapterPreferenceSupported(
|
||||
DXCoreAdapterPreference preference) = 0;
|
||||
};
|
||||
|
||||
/* interface IDXCoreAdapterFactory */
|
||||
MIDL_INTERFACE("78ee5945-c36e-4b13-a669-005dd11c0f06")
|
||||
IDXCoreAdapterFactory : public IUnknown
|
||||
{
|
||||
public:
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE CreateAdapterList(
|
||||
uint32_t numAttributes,
|
||||
_In_reads_(numAttributes) const GUID *filterAttributes,
|
||||
REFIID riid,
|
||||
_COM_Outptr_ void **ppvAdapterList) = 0;
|
||||
|
||||
template<class T>
|
||||
HRESULT STDMETHODCALLTYPE CreateAdapterList(
|
||||
uint32_t numAttributes,
|
||||
_In_reads_(numAttributes) const GUID *filterAttributes,
|
||||
_COM_Outptr_ T **ppvAdapterList)
|
||||
{
|
||||
return CreateAdapterList(numAttributes,
|
||||
filterAttributes,
|
||||
IID_PPV_ARGS(ppvAdapterList));
|
||||
}
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetAdapterByLuid(
|
||||
const LUID &adapterLUID,
|
||||
REFIID riid,
|
||||
_COM_Outptr_ void **ppvAdapter) = 0;
|
||||
|
||||
template<class T>
|
||||
HRESULT STDMETHODCALLTYPE GetAdapterByLuid(
|
||||
const LUID &adapterLUID,
|
||||
_COM_Outptr_ T **ppvAdapter)
|
||||
{
|
||||
return GetAdapterByLuid(adapterLUID,
|
||||
IID_PPV_ARGS(ppvAdapter));
|
||||
}
|
||||
|
||||
virtual bool STDMETHODCALLTYPE IsNotificationTypeSupported(
|
||||
DXCoreNotificationType notificationType) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE RegisterEventNotification(
|
||||
_In_ IUnknown *dxCoreObject,
|
||||
DXCoreNotificationType notificationType,
|
||||
_In_ PFN_DXCORE_NOTIFICATION_CALLBACK callbackFunction,
|
||||
_In_opt_ void *callbackContext,
|
||||
_Out_ uint32_t *eventCookie) = 0;
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE UnregisterEventNotification(
|
||||
uint32_t eventCookie) = 0;
|
||||
};
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // __dxcore_interface_h__
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
||||
@ -206,7 +206,7 @@ typedef struct DXGI_ADAPTER_DESC
|
||||
LUID AdapterLuid;
|
||||
} DXGI_ADAPTER_DESC;
|
||||
|
||||
#if !defined(HMONITOR_DECLARED) && !defined(HMONITOR) && (WINVER < 0x0500)
|
||||
#if !defined(HMONITOR_DECLARED) && !defined(HMONITOR) && (!defined(WINVER) || WINVER < 0x0500)
|
||||
#define HMONITOR_DECLARED
|
||||
#if 0
|
||||
typedef HANDLE HMONITOR;
|
@ -10,7 +10,7 @@
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
@ -10,7 +10,7 @@
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
@ -10,7 +10,7 @@
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
@ -10,7 +10,7 @@
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
@ -10,7 +10,7 @@
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
@ -1,5 +1,6 @@
|
||||
//
|
||||
// Copyright (C) Microsoft. All rights reserved.
|
||||
// Copyright (C) Microsoft Corporation.
|
||||
// Licensed under the MIT license
|
||||
//
|
||||
|
||||
#ifndef __dxgicommon_h__
|
@ -10,7 +10,7 @@
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
142
3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgiformat.h
vendored
Normal file
142
3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgiformat.h
vendored
Normal file
@ -0,0 +1,142 @@
|
||||
//
|
||||
// Copyright (C) Microsoft Corporation.
|
||||
// Licensed under the MIT license
|
||||
//
|
||||
|
||||
#ifndef __dxgiformat_h__
|
||||
#define __dxgiformat_h__
|
||||
|
||||
#define DXGI_FORMAT_DEFINED 1
|
||||
|
||||
typedef enum DXGI_FORMAT
|
||||
{
|
||||
DXGI_FORMAT_UNKNOWN = 0,
|
||||
DXGI_FORMAT_R32G32B32A32_TYPELESS = 1,
|
||||
DXGI_FORMAT_R32G32B32A32_FLOAT = 2,
|
||||
DXGI_FORMAT_R32G32B32A32_UINT = 3,
|
||||
DXGI_FORMAT_R32G32B32A32_SINT = 4,
|
||||
DXGI_FORMAT_R32G32B32_TYPELESS = 5,
|
||||
DXGI_FORMAT_R32G32B32_FLOAT = 6,
|
||||
DXGI_FORMAT_R32G32B32_UINT = 7,
|
||||
DXGI_FORMAT_R32G32B32_SINT = 8,
|
||||
DXGI_FORMAT_R16G16B16A16_TYPELESS = 9,
|
||||
DXGI_FORMAT_R16G16B16A16_FLOAT = 10,
|
||||
DXGI_FORMAT_R16G16B16A16_UNORM = 11,
|
||||
DXGI_FORMAT_R16G16B16A16_UINT = 12,
|
||||
DXGI_FORMAT_R16G16B16A16_SNORM = 13,
|
||||
DXGI_FORMAT_R16G16B16A16_SINT = 14,
|
||||
DXGI_FORMAT_R32G32_TYPELESS = 15,
|
||||
DXGI_FORMAT_R32G32_FLOAT = 16,
|
||||
DXGI_FORMAT_R32G32_UINT = 17,
|
||||
DXGI_FORMAT_R32G32_SINT = 18,
|
||||
DXGI_FORMAT_R32G8X24_TYPELESS = 19,
|
||||
DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20,
|
||||
DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21,
|
||||
DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22,
|
||||
DXGI_FORMAT_R10G10B10A2_TYPELESS = 23,
|
||||
DXGI_FORMAT_R10G10B10A2_UNORM = 24,
|
||||
DXGI_FORMAT_R10G10B10A2_UINT = 25,
|
||||
DXGI_FORMAT_R11G11B10_FLOAT = 26,
|
||||
DXGI_FORMAT_R8G8B8A8_TYPELESS = 27,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM = 28,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29,
|
||||
DXGI_FORMAT_R8G8B8A8_UINT = 30,
|
||||
DXGI_FORMAT_R8G8B8A8_SNORM = 31,
|
||||
DXGI_FORMAT_R8G8B8A8_SINT = 32,
|
||||
DXGI_FORMAT_R16G16_TYPELESS = 33,
|
||||
DXGI_FORMAT_R16G16_FLOAT = 34,
|
||||
DXGI_FORMAT_R16G16_UNORM = 35,
|
||||
DXGI_FORMAT_R16G16_UINT = 36,
|
||||
DXGI_FORMAT_R16G16_SNORM = 37,
|
||||
DXGI_FORMAT_R16G16_SINT = 38,
|
||||
DXGI_FORMAT_R32_TYPELESS = 39,
|
||||
DXGI_FORMAT_D32_FLOAT = 40,
|
||||
DXGI_FORMAT_R32_FLOAT = 41,
|
||||
DXGI_FORMAT_R32_UINT = 42,
|
||||
DXGI_FORMAT_R32_SINT = 43,
|
||||
DXGI_FORMAT_R24G8_TYPELESS = 44,
|
||||
DXGI_FORMAT_D24_UNORM_S8_UINT = 45,
|
||||
DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46,
|
||||
DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47,
|
||||
DXGI_FORMAT_R8G8_TYPELESS = 48,
|
||||
DXGI_FORMAT_R8G8_UNORM = 49,
|
||||
DXGI_FORMAT_R8G8_UINT = 50,
|
||||
DXGI_FORMAT_R8G8_SNORM = 51,
|
||||
DXGI_FORMAT_R8G8_SINT = 52,
|
||||
DXGI_FORMAT_R16_TYPELESS = 53,
|
||||
DXGI_FORMAT_R16_FLOAT = 54,
|
||||
DXGI_FORMAT_D16_UNORM = 55,
|
||||
DXGI_FORMAT_R16_UNORM = 56,
|
||||
DXGI_FORMAT_R16_UINT = 57,
|
||||
DXGI_FORMAT_R16_SNORM = 58,
|
||||
DXGI_FORMAT_R16_SINT = 59,
|
||||
DXGI_FORMAT_R8_TYPELESS = 60,
|
||||
DXGI_FORMAT_R8_UNORM = 61,
|
||||
DXGI_FORMAT_R8_UINT = 62,
|
||||
DXGI_FORMAT_R8_SNORM = 63,
|
||||
DXGI_FORMAT_R8_SINT = 64,
|
||||
DXGI_FORMAT_A8_UNORM = 65,
|
||||
DXGI_FORMAT_R1_UNORM = 66,
|
||||
DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67,
|
||||
DXGI_FORMAT_R8G8_B8G8_UNORM = 68,
|
||||
DXGI_FORMAT_G8R8_G8B8_UNORM = 69,
|
||||
DXGI_FORMAT_BC1_TYPELESS = 70,
|
||||
DXGI_FORMAT_BC1_UNORM = 71,
|
||||
DXGI_FORMAT_BC1_UNORM_SRGB = 72,
|
||||
DXGI_FORMAT_BC2_TYPELESS = 73,
|
||||
DXGI_FORMAT_BC2_UNORM = 74,
|
||||
DXGI_FORMAT_BC2_UNORM_SRGB = 75,
|
||||
DXGI_FORMAT_BC3_TYPELESS = 76,
|
||||
DXGI_FORMAT_BC3_UNORM = 77,
|
||||
DXGI_FORMAT_BC3_UNORM_SRGB = 78,
|
||||
DXGI_FORMAT_BC4_TYPELESS = 79,
|
||||
DXGI_FORMAT_BC4_UNORM = 80,
|
||||
DXGI_FORMAT_BC4_SNORM = 81,
|
||||
DXGI_FORMAT_BC5_TYPELESS = 82,
|
||||
DXGI_FORMAT_BC5_UNORM = 83,
|
||||
DXGI_FORMAT_BC5_SNORM = 84,
|
||||
DXGI_FORMAT_B5G6R5_UNORM = 85,
|
||||
DXGI_FORMAT_B5G5R5A1_UNORM = 86,
|
||||
DXGI_FORMAT_B8G8R8A8_UNORM = 87,
|
||||
DXGI_FORMAT_B8G8R8X8_UNORM = 88,
|
||||
DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89,
|
||||
DXGI_FORMAT_B8G8R8A8_TYPELESS = 90,
|
||||
DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91,
|
||||
DXGI_FORMAT_B8G8R8X8_TYPELESS = 92,
|
||||
DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93,
|
||||
DXGI_FORMAT_BC6H_TYPELESS = 94,
|
||||
DXGI_FORMAT_BC6H_UF16 = 95,
|
||||
DXGI_FORMAT_BC6H_SF16 = 96,
|
||||
DXGI_FORMAT_BC7_TYPELESS = 97,
|
||||
DXGI_FORMAT_BC7_UNORM = 98,
|
||||
DXGI_FORMAT_BC7_UNORM_SRGB = 99,
|
||||
DXGI_FORMAT_AYUV = 100,
|
||||
DXGI_FORMAT_Y410 = 101,
|
||||
DXGI_FORMAT_Y416 = 102,
|
||||
DXGI_FORMAT_NV12 = 103,
|
||||
DXGI_FORMAT_P010 = 104,
|
||||
DXGI_FORMAT_P016 = 105,
|
||||
DXGI_FORMAT_420_OPAQUE = 106,
|
||||
DXGI_FORMAT_YUY2 = 107,
|
||||
DXGI_FORMAT_Y210 = 108,
|
||||
DXGI_FORMAT_Y216 = 109,
|
||||
DXGI_FORMAT_NV11 = 110,
|
||||
DXGI_FORMAT_AI44 = 111,
|
||||
DXGI_FORMAT_IA44 = 112,
|
||||
DXGI_FORMAT_P8 = 113,
|
||||
DXGI_FORMAT_A8P8 = 114,
|
||||
DXGI_FORMAT_B4G4R4A4_UNORM = 115,
|
||||
|
||||
DXGI_FORMAT_P208 = 130,
|
||||
DXGI_FORMAT_V208 = 131,
|
||||
DXGI_FORMAT_V408 = 132,
|
||||
|
||||
|
||||
DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE = 189,
|
||||
DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE = 190,
|
||||
|
||||
|
||||
DXGI_FORMAT_FORCE_UINT = 0xffffffff
|
||||
} DXGI_FORMAT;
|
||||
|
||||
#endif // __dxgiformat_h__
|
@ -10,7 +10,7 @@
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 475
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
@ -21,4 +21,10 @@
|
||||
#define WINAPI_FAMILY_PARTITION(v) ((WINAPI_FAMILY & v) == v)
|
||||
#define WINAPI_FAMILY_ONE_PARTITION(vset, v) ((WINAPI_FAMILY & vset) == v)
|
||||
|
||||
#define WINAPI_FAMILY_GAMES 6
|
||||
|
||||
#ifndef WINAPI_PARTITION_GAMES
|
||||
# define WINAPI_PARTITION_GAMES (WINAPI_FAMILY == WINAPI_FAMILY_GAMES || WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
|
||||
#endif // WINAPI_PARTITION_GAMES
|
||||
|
||||
#endif
|
347
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/basetsd.h
vendored
Normal file
347
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/basetsd.h
vendored
Normal file
@ -0,0 +1,347 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#pragma once
|
||||
|
||||
// These #defines prevent the idl-generated headers from trying to include
|
||||
// Windows.h from the SDK rather than this one.
|
||||
#define RPC_NO_WINDOWS_H
|
||||
#define COM_NO_WINDOWS_H
|
||||
|
||||
// Allcaps type definitions
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <sal.h>
|
||||
|
||||
// Note: using fixed-width here to match Windows widths
|
||||
// Specifically this is different for 'long' vs 'LONG'
|
||||
typedef uint8_t UINT8;
|
||||
typedef int8_t INT8;
|
||||
typedef uint16_t UINT16;
|
||||
typedef int16_t INT16;
|
||||
typedef uint32_t UINT32, UINT, ULONG, DWORD, BOOL, WINBOOL;
|
||||
typedef int32_t INT32, INT, LONG;
|
||||
typedef uint64_t UINT64, ULONG_PTR;
|
||||
typedef int64_t INT64, LONG_PTR;
|
||||
typedef void VOID, *HANDLE, *RPC_IF_HANDLE, *LPVOID;
|
||||
typedef const void *LPCVOID;
|
||||
typedef size_t SIZE_T;
|
||||
typedef float FLOAT;
|
||||
typedef double DOUBLE;
|
||||
typedef unsigned char BYTE;
|
||||
typedef HANDLE HWND;
|
||||
typedef HANDLE HMODULE;
|
||||
typedef size_t SIZE;
|
||||
typedef int PALETTEENTRY;
|
||||
typedef int HDC;
|
||||
typedef uint16_t WORD;
|
||||
typedef void* PVOID;
|
||||
typedef char BOOLEAN;
|
||||
typedef uint64_t ULONGLONG;
|
||||
typedef int16_t SHORT, *PSHORT;
|
||||
typedef uint16_t USHORT, *PUSHORT;
|
||||
typedef int64_t LONGLONG, *PLONGLONG;
|
||||
typedef int64_t LONG_PTR, *PLONG_PTR;
|
||||
typedef int64_t LONG64, *PLONG64;
|
||||
typedef uint64_t ULONG64, *PULONG64;
|
||||
typedef wchar_t WCHAR, *PWSTR;
|
||||
typedef uint8_t UCHAR, *PUCHAR;
|
||||
typedef uint64_t ULONG_PTR, *PULONG_PTR;
|
||||
typedef uint64_t UINT_PTR, *PUINT_PTR;
|
||||
typedef int64_t INT_PTR, *PINT_PTR;
|
||||
|
||||
// Note: WCHAR is not the same between Windows and Linux, to enable
|
||||
// string manipulation APIs to work with resulting strings.
|
||||
// APIs to D3D/DXCore will work on Linux wchars, but beware with
|
||||
// interactions directly with the Windows kernel.
|
||||
typedef char CHAR, *PSTR, *LPSTR, TCHAR, *PTSTR;
|
||||
typedef const char *LPCSTR, *PCSTR, *LPCTSTR, *PCTSTR;
|
||||
typedef wchar_t WCHAR, *PWSTR, *LPWSTR, *PWCHAR;
|
||||
typedef const wchar_t *LPCWSTR, *PCWSTR;
|
||||
|
||||
#undef LONG_MAX
|
||||
#define LONG_MAX INT_MAX
|
||||
#undef ULONG_MAX
|
||||
#define ULONG_MAX UINT_MAX
|
||||
|
||||
// Misc defines
|
||||
#define MIDL_INTERFACE(x) interface
|
||||
#define __analysis_assume(x)
|
||||
#define TRUE 1u
|
||||
#define FALSE 0u
|
||||
#define DECLSPEC_UUID(x)
|
||||
#define DECLSPEC_NOVTABLE
|
||||
#define DECLSPEC_SELECTANY
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN_C extern "C"
|
||||
#else
|
||||
#define EXTERN_C extern
|
||||
#endif
|
||||
#define APIENTRY
|
||||
#define OUT
|
||||
#define IN
|
||||
#define CONST const
|
||||
#define MAX_PATH 260
|
||||
#define GENERIC_ALL 0x10000000L
|
||||
#define C_ASSERT(expr) static_assert((expr))
|
||||
#define _countof(a) (sizeof(a) / sizeof(*(a)))
|
||||
|
||||
typedef struct tagRECTL
|
||||
{
|
||||
LONG left;
|
||||
LONG top;
|
||||
LONG right;
|
||||
LONG bottom;
|
||||
} RECTL;
|
||||
|
||||
typedef struct tagPOINT
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
} POINT;
|
||||
|
||||
typedef struct _GUID {
|
||||
uint32_t Data1;
|
||||
uint16_t Data2;
|
||||
uint16_t Data3;
|
||||
uint8_t Data4[ 8 ];
|
||||
} GUID;
|
||||
|
||||
#ifdef INITGUID
|
||||
#ifdef __cplusplus
|
||||
#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID DECLSPEC_SELECTANY name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
|
||||
#else
|
||||
#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID DECLSPEC_SELECTANY name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
|
||||
#endif
|
||||
#else
|
||||
#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID name
|
||||
#endif
|
||||
|
||||
typedef GUID IID;
|
||||
typedef GUID UUID;
|
||||
typedef GUID CLSID;
|
||||
#ifdef __cplusplus
|
||||
#define REFGUID const GUID &
|
||||
#define REFIID const IID &
|
||||
#define REFCLSID const IID &
|
||||
|
||||
__inline int InlineIsEqualGUID(REFGUID rguid1, REFGUID rguid2)
|
||||
{
|
||||
return (
|
||||
((uint32_t *)&rguid1)[0] == ((uint32_t *)&rguid2)[0] &&
|
||||
((uint32_t *)&rguid1)[1] == ((uint32_t *)&rguid2)[1] &&
|
||||
((uint32_t *)&rguid1)[2] == ((uint32_t *)&rguid2)[2] &&
|
||||
((uint32_t *)&rguid1)[3] == ((uint32_t *)&rguid2)[3]);
|
||||
}
|
||||
|
||||
inline bool operator==(REFGUID guidOne, REFGUID guidOther)
|
||||
{
|
||||
return !!InlineIsEqualGUID(guidOne, guidOther);
|
||||
}
|
||||
|
||||
inline bool operator!=(REFGUID guidOne, REFGUID guidOther)
|
||||
{
|
||||
return !(guidOne == guidOther);
|
||||
}
|
||||
|
||||
#else
|
||||
#define REFGUID const GUID *
|
||||
#define REFIID const IID *
|
||||
#define REFCLSID const IID *
|
||||
#endif
|
||||
|
||||
// Calling conventions
|
||||
#define __cdecl
|
||||
#define __stdcall
|
||||
#define STDMETHODCALLTYPE
|
||||
#define STDAPICALLTYPE
|
||||
#define STDAPI EXTERN_C HRESULT STDAPICALLTYPE
|
||||
#define WINAPI
|
||||
|
||||
#define interface struct
|
||||
#if defined (__cplusplus) && !defined (CINTERFACE)
|
||||
#define STDMETHOD(method) virtual HRESULT STDMETHODCALLTYPE method
|
||||
#define STDMETHOD_(type, method) virtual type STDMETHODCALLTYPE method
|
||||
#define PURE = 0
|
||||
#define THIS_
|
||||
#define THIS void
|
||||
#define DECLARE_INTERFACE(iface) interface DECLSPEC_NOVTABLE iface
|
||||
#define DECLARE_INTERFACE_(iface, baseiface) interface DECLSPEC_NOVTABLE iface : public baseiface
|
||||
|
||||
interface IUnknown;
|
||||
extern "C++"
|
||||
{
|
||||
template<typename T> void** IID_PPV_ARGS_Helper(T** pp)
|
||||
{
|
||||
(void)static_cast<IUnknown*>(*pp);
|
||||
return reinterpret_cast<void**>(pp);
|
||||
}
|
||||
}
|
||||
#define IID_PPV_ARGS(ppType) __uuidof (**(ppType)), IID_PPV_ARGS_Helper (ppType)
|
||||
#else
|
||||
#define STDMETHOD(method) HRESULT (STDMETHODCALLTYPE *method)
|
||||
#define STDMETHOD_(type, method) type (STDMETHODCALLTYPE *method)
|
||||
#define PURE
|
||||
#define THIS_ INTERFACE *This,
|
||||
#define THIS INTERFACE *This
|
||||
#ifdef CONST_VTABLE
|
||||
#define DECLARE_INTERFACE(iface) typedef interface iface { const struct iface##Vtbl *lpVtbl; } iface; typedef const struct iface##Vtbl iface##Vtbl; const struct iface##Vtbl
|
||||
#else
|
||||
#define DECLARE_INTERFACE(iface) typedef interface iface { struct iface##Vtbl *lpVtbl; } iface; typedef struct iface##Vtbl iface##Vtbl; struct iface##Vtbl
|
||||
#endif
|
||||
#define DECLARE_INTERFACE_(iface, baseiface) DECLARE_INTERFACE (iface)
|
||||
#endif
|
||||
|
||||
#define IFACEMETHOD(method) /*override*/ STDMETHOD (method)
|
||||
#define IFACEMETHOD_(type, method) /*override*/ STDMETHOD_(type, method)
|
||||
#ifndef BEGIN_INTERFACE
|
||||
#define BEGIN_INTERFACE
|
||||
#define END_INTERFACE
|
||||
#endif
|
||||
|
||||
// Error codes
|
||||
typedef LONG HRESULT;
|
||||
#define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0)
|
||||
#define FAILED(hr) (((HRESULT)(hr)) < 0)
|
||||
#define S_OK ((HRESULT)0L)
|
||||
#define S_FALSE ((HRESULT)1L)
|
||||
#define E_NOTIMPL ((HRESULT)0x80004001L)
|
||||
#define E_OUTOFMEMORY ((HRESULT)0x8007000EL)
|
||||
#define E_INVALIDARG ((HRESULT)0x80070057L)
|
||||
#define E_NOINTERFACE ((HRESULT)0x80004002L)
|
||||
#define E_POINTER ((HRESULT)0x80004003L)
|
||||
#define E_HANDLE ((HRESULT)0x80070006L)
|
||||
#define E_ABORT ((HRESULT)0x80004004L)
|
||||
#define E_FAIL ((HRESULT)0x80004005L)
|
||||
#define E_ACCESSDENIED ((HRESULT)0x80070005L)
|
||||
#define E_UNEXPECTED ((HRESULT)0x8000FFFFL)
|
||||
#define DXGI_ERROR_INVALID_CALL ((HRESULT)0x887A0001L)
|
||||
#define DXGI_ERROR_NOT_FOUND ((HRESULT)0x887A0002L)
|
||||
#define DXGI_ERROR_MORE_DATA ((HRESULT)0x887A0003L)
|
||||
#define DXGI_ERROR_UNSUPPORTED ((HRESULT)0x887A0004L)
|
||||
#define DXGI_ERROR_DEVICE_REMOVED ((HRESULT)0x887A0005L)
|
||||
#define DXGI_ERROR_DEVICE_HUNG ((HRESULT)0x887A0006L)
|
||||
#define DXGI_ERROR_DEVICE_RESET ((HRESULT)0x887A0007L)
|
||||
#define DXGI_ERROR_DRIVER_INTERNAL_ERROR ((HRESULT)0x887A0020L)
|
||||
|
||||
typedef struct _LUID
|
||||
{
|
||||
ULONG LowPart;
|
||||
LONG HighPart;
|
||||
} LUID;
|
||||
|
||||
typedef struct _RECT
|
||||
{
|
||||
int left;
|
||||
int top;
|
||||
int right;
|
||||
int bottom;
|
||||
} RECT;
|
||||
|
||||
typedef union _LARGE_INTEGER {
|
||||
struct {
|
||||
uint32_t LowPart;
|
||||
uint32_t HighPart;
|
||||
} u;
|
||||
int64_t QuadPart;
|
||||
} LARGE_INTEGER;
|
||||
typedef LARGE_INTEGER *PLARGE_INTEGER;
|
||||
|
||||
typedef union _ULARGE_INTEGER {
|
||||
struct {
|
||||
uint32_t LowPart;
|
||||
uint32_t HighPart;
|
||||
} u;
|
||||
uint64_t QuadPart;
|
||||
} ULARGE_INTEGER;
|
||||
typedef ULARGE_INTEGER *PULARGE_INTEGER;
|
||||
|
||||
#define DECLARE_HANDLE(name) \
|
||||
struct name##__ { \
|
||||
int unused; \
|
||||
}; \
|
||||
typedef struct name##__ *name
|
||||
|
||||
typedef struct _SECURITY_ATTRIBUTES {
|
||||
DWORD nLength;
|
||||
LPVOID lpSecurityDescriptor;
|
||||
WINBOOL bInheritHandle;
|
||||
} SECURITY_ATTRIBUTES;
|
||||
|
||||
struct STATSTG;
|
||||
|
||||
#ifdef __cplusplus
|
||||
// ENUM_FLAG_OPERATORS
|
||||
// Define operator overloads to enable bit operations on enum values that are
|
||||
// used to define flags. Use DEFINE_ENUM_FLAG_OPERATORS(YOUR_TYPE) to enable these
|
||||
// operators on YOUR_TYPE.
|
||||
extern "C++" {
|
||||
template <size_t S>
|
||||
struct _ENUM_FLAG_INTEGER_FOR_SIZE;
|
||||
|
||||
template <>
|
||||
struct _ENUM_FLAG_INTEGER_FOR_SIZE<1>
|
||||
{
|
||||
typedef int8_t type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _ENUM_FLAG_INTEGER_FOR_SIZE<2>
|
||||
{
|
||||
typedef int16_t type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _ENUM_FLAG_INTEGER_FOR_SIZE<4>
|
||||
{
|
||||
typedef int32_t type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _ENUM_FLAG_INTEGER_FOR_SIZE<8>
|
||||
{
|
||||
typedef int64_t type;
|
||||
};
|
||||
|
||||
// used as an approximation of std::underlying_type<T>
|
||||
template <class T>
|
||||
struct _ENUM_FLAG_SIZED_INTEGER
|
||||
{
|
||||
typedef typename _ENUM_FLAG_INTEGER_FOR_SIZE<sizeof(T)>::type type;
|
||||
};
|
||||
|
||||
}
|
||||
#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \
|
||||
extern "C++" { \
|
||||
inline constexpr ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)a) | ((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)b)); } \
|
||||
inline ENUMTYPE &operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type &)a) |= ((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)b)); } \
|
||||
inline constexpr ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)a) & ((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)b)); } \
|
||||
inline ENUMTYPE &operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type &)a) &= ((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)b)); } \
|
||||
inline constexpr ENUMTYPE operator ~ (ENUMTYPE a) { return ENUMTYPE(~((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)a)); } \
|
||||
inline constexpr ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)a) ^ ((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)b)); } \
|
||||
inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type &)a) ^= ((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)b)); } \
|
||||
}
|
||||
#else
|
||||
#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) /* */
|
||||
#endif
|
||||
|
||||
// D3DX12 uses these
|
||||
#include <stdlib.h>
|
||||
#define HeapAlloc(heap, flags, size) malloc(size)
|
||||
#define HeapFree(heap, flags, ptr) free(ptr)
|
||||
|
||||
#if defined(lint)
|
||||
// Note: lint -e530 says don't complain about uninitialized variables for
|
||||
// this variable. Error 527 has to do with unreachable code.
|
||||
// -restore restores checking to the -save state
|
||||
#define UNREFERENCED_PARAMETER(P) \
|
||||
/*lint -save -e527 -e530 */ \
|
||||
{ \
|
||||
(P) = (P); \
|
||||
} \
|
||||
/*lint -restore */
|
||||
#else
|
||||
#define UNREFERENCED_PARAMETER(P) (P)
|
||||
#endif
|
5
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/oaidl.h
vendored
Normal file
5
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/oaidl.h
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
// Stub header to satisfy d3d12.h include
|
||||
#pragma once
|
1
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/objbase.h
vendored
Normal file
1
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/objbase.h
vendored
Normal file
@ -0,0 +1 @@
|
||||
#pragma once
|
5
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/ocidl.h
vendored
Normal file
5
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/ocidl.h
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
// Stub header to satisfy d3d12.h include
|
||||
#pragma once
|
5
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/rpc.h
vendored
Normal file
5
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/rpc.h
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
// Stub header to satisfy d3d12.h include
|
||||
#pragma once
|
82
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/rpcndr.h
vendored
Normal file
82
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/rpcndr.h
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
// Stub header to satisfy d3d12.h include
|
||||
#pragma once
|
||||
|
||||
#include "basetsd.h"
|
||||
|
||||
#define __RPCNDR_H_VERSION__
|
||||
|
||||
#ifdef CONST_VTABLE
|
||||
#define CONST_VTBL const
|
||||
#else
|
||||
#define CONST_VTBL
|
||||
#endif
|
||||
|
||||
#ifndef __cpp_inline_variables
|
||||
#define __cpp_inline_variables 0
|
||||
#endif
|
||||
|
||||
/* Macros for __uuidof template-based emulation */
|
||||
#if defined(__cplusplus)
|
||||
#if __cpp_constexpr >= 200704l && __cpp_inline_variables >= 201606L
|
||||
#define __wsl_stub_uuidof_use_constexpr 1
|
||||
#else
|
||||
#define __wsl_stub_uuidof_use_constexpr 0
|
||||
#endif
|
||||
#ifndef __GNUC__
|
||||
#error "Only support for compilers that support for `GNU C++ extension`"
|
||||
#endif
|
||||
extern "C++" {
|
||||
#if __wsl_stub_uuidof_use_constexpr
|
||||
__extension__ template<typename T> struct __wsl_stub_uuidof_s;
|
||||
__extension__ template<typename T> constexpr const GUID &__wsl_stub_uuidof();
|
||||
#else
|
||||
__extension__ template<typename T> const GUID &__wsl_stub_uuidof();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if __wsl_stub_uuidof_use_constexpr
|
||||
#define __CRT_UUID_DECL(type, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
||||
extern "C++" \
|
||||
{ \
|
||||
template <> \
|
||||
struct __wsl_stub_uuidof_s<type> \
|
||||
{ \
|
||||
static constexpr IID __uuid_inst = { \
|
||||
l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}}; \
|
||||
}; \
|
||||
template <> \
|
||||
constexpr const GUID &__wsl_stub_uuidof<type>() \
|
||||
{ \
|
||||
return __wsl_stub_uuidof_s<type>::__uuid_inst; \
|
||||
} \
|
||||
template <> \
|
||||
constexpr const GUID &__wsl_stub_uuidof<type *>() \
|
||||
{ \
|
||||
return __wsl_stub_uuidof_s<type>::__uuid_inst; \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define __CRT_UUID_DECL(type, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
||||
extern "C++" \
|
||||
{ \
|
||||
template <> \
|
||||
inline const GUID &__wsl_stub_uuidof<type>() \
|
||||
{ \
|
||||
static const IID __uuid_inst = { \
|
||||
l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}}; \
|
||||
return __uuid_inst; \
|
||||
} \
|
||||
template <> \
|
||||
inline const GUID &__wsl_stub_uuidof<type *>() \
|
||||
{ \
|
||||
return __wsl_stub_uuidof<type>(); \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
#define __uuidof(type) __wsl_stub_uuidof<__typeof(type)>()
|
||||
#else
|
||||
#define __CRT_UUID_DECL(type, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
|
||||
#endif
|
3
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/unknwn.h
vendored
Normal file
3
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/unknwn.h
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#include "unknwnbase.h"
|
124
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/unknwnbase.h
vendored
Normal file
124
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/unknwnbase.h
vendored
Normal file
@ -0,0 +1,124 @@
|
||||
/*-------------------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (c) Microsoft Corporation
|
||||
* Licensed under the MIT license
|
||||
*
|
||||
*-------------------------------------------------------------------------------------*/
|
||||
|
||||
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
|
||||
|
||||
/* File created by MIDL compiler version 8.01.0627 */
|
||||
|
||||
/* verify that the <rpcndr.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCNDR_H_VERSION__
|
||||
#define __REQUIRED_RPCNDR_H_VERSION__ 500
|
||||
#endif
|
||||
|
||||
/* verify that the <rpcsal.h> version is high enough to compile this file*/
|
||||
#ifndef __REQUIRED_RPCSAL_H_VERSION__
|
||||
#define __REQUIRED_RPCSAL_H_VERSION__ 100
|
||||
#endif
|
||||
|
||||
#include "rpc.h"
|
||||
#include "rpcndr.h"
|
||||
|
||||
#ifndef __RPCNDR_H_VERSION__
|
||||
#error this stub requires an updated version of <rpcndr.h>
|
||||
#endif /* __RPCNDR_H_VERSION__ */
|
||||
|
||||
#ifndef COM_NO_WINDOWS_H
|
||||
#include "windows.h"
|
||||
#include "ole2.h"
|
||||
#endif /*COM_NO_WINDOWS_H*/
|
||||
|
||||
#ifndef __unknwnbase_h__
|
||||
#define __unknwnbase_h__
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
/* Forward Declarations */
|
||||
|
||||
#ifndef __IUnknown_FWD_DEFINED__
|
||||
#define __IUnknown_FWD_DEFINED__
|
||||
typedef interface IUnknown IUnknown;
|
||||
|
||||
#endif /* __IUnknown_FWD_DEFINED__ */
|
||||
|
||||
#ifndef __IUnknown_INTERFACE_DEFINED__
|
||||
#define __IUnknown_INTERFACE_DEFINED__
|
||||
|
||||
/* interface IUnknown */
|
||||
/* [unique][uuid][object][local] */
|
||||
|
||||
typedef /* [unique] */ IUnknown *LPUNKNOWN;
|
||||
|
||||
EXTERN_C const IID IID_IUnknown;
|
||||
|
||||
#if defined(__cplusplus) && !defined(CINTERFACE)
|
||||
extern "C++"
|
||||
{
|
||||
MIDL_INTERFACE("00000000-0000-0000-c000-000000000046")
|
||||
IUnknown
|
||||
{
|
||||
BEGIN_INTERFACE
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE QueryInterface(
|
||||
REFIID riid,
|
||||
void **ppvObject) = 0;
|
||||
|
||||
virtual ULONG STDMETHODCALLTYPE AddRef() = 0;
|
||||
|
||||
virtual ULONG STDMETHODCALLTYPE Release() = 0;
|
||||
|
||||
template <class Q>
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
QueryInterface(_COM_Outptr_ Q * *pp)
|
||||
{
|
||||
return QueryInterface(__uuidof(Q), (void **)pp);
|
||||
}
|
||||
END_INTERFACE
|
||||
};
|
||||
}
|
||||
#ifdef __CRT_UUID_DECL
|
||||
__CRT_UUID_DECL(IUnknown, 0x00000000, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46)
|
||||
#endif
|
||||
#else
|
||||
typedef struct IUnknownVtbl {
|
||||
BEGIN_INTERFACE
|
||||
|
||||
/*** IUnknown methods ***/
|
||||
HRESULT (STDMETHODCALLTYPE *QueryInterface)(
|
||||
IUnknown *This,
|
||||
REFIID riid,
|
||||
void **ppvObject);
|
||||
|
||||
ULONG (STDMETHODCALLTYPE *AddRef)(
|
||||
IUnknown *This);
|
||||
|
||||
ULONG (STDMETHODCALLTYPE *Release)(
|
||||
IUnknown *This);
|
||||
|
||||
END_INTERFACE
|
||||
} IUnknownVtbl;
|
||||
|
||||
interface IUnknown {
|
||||
CONST_VTBL IUnknownVtbl* lpVtbl;
|
||||
};
|
||||
|
||||
#ifdef COBJMACROS
|
||||
/*** IUnknown methods ***/
|
||||
#define IUnknown_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
|
||||
#define IUnknown_AddRef(This) (This)->lpVtbl->AddRef(This)
|
||||
#define IUnknown_Release(This) (This)->lpVtbl->Release(This)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __IUnknown_INTERFACE_DEFINED__ */
|
||||
|
||||
DEFINE_GUID(IID_IUnknown, 0x00000000, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46);
|
||||
|
||||
#endif /* __unknwnbase_h__ */
|
6
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/winapifamily.h
vendored
Normal file
6
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/winapifamily.h
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
// Stub header to satisfy d3d12.h include. Unconditionally light up all APIs.
|
||||
#pragma once
|
||||
#define WINAPI_FAMILY_PARTITION(Partitions) 1
|
18
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/windows.h
vendored
Normal file
18
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/windows.h
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
#include "basetsd.h"
|
||||
|
||||
typedef struct RGNDATAHEADER {
|
||||
DWORD dwSize;
|
||||
DWORD iType;
|
||||
DWORD nCount;
|
||||
DWORD nRgnSize;
|
||||
RECT rcBound;
|
||||
} RGNDATAHEADER;
|
||||
|
||||
typedef struct RGNDATA {
|
||||
RGNDATAHEADER rdh;
|
||||
char Buffer[1];
|
||||
} RGNDATA;
|
||||
|
||||
#define MAKE_HRESULT(sev,fac,code) \
|
||||
((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) )
|
6
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/wrl/client.h
vendored
Normal file
6
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/wrl/client.h
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
// Stub to satisfy d3dx12.h include
|
||||
#pragma once
|
||||
#include <wsl/wrladapter.h>
|
6
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/wrl/implements.h
vendored
Normal file
6
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/wrl/implements.h
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
// Stub to satisfy DML TF runtime includes
|
||||
#pragma once
|
||||
#include <wsl/wrladapter.h>
|
6
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/winadapter.h
vendored
Normal file
6
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/winadapter.h
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <unknwn.h>
|
803
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/wrladapter.h
vendored
Normal file
803
3rdparty/bgfx/3rdparty/directx-headers/include/wsl/wrladapter.h
vendored
Normal file
@ -0,0 +1,803 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "winadapter.h"
|
||||
|
||||
// defined by winadapter.h and needed by some windows headers, but conflicts
|
||||
// with some libc++ implementation headers
|
||||
#ifdef __in
|
||||
#undef __in
|
||||
#endif
|
||||
#ifdef __out
|
||||
#undef __out
|
||||
#endif
|
||||
|
||||
#include <type_traits>
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
#include <new>
|
||||
#include <climits>
|
||||
#include <cassert>
|
||||
|
||||
namespace Microsoft
|
||||
{
|
||||
namespace WRL
|
||||
{
|
||||
namespace Details
|
||||
{
|
||||
struct BoolStruct { int Member; };
|
||||
typedef int BoolStruct::* BoolType;
|
||||
|
||||
template <typename T> // T should be the ComPtr<T> or a derived type of it, not just the interface
|
||||
class ComPtrRefBase
|
||||
{
|
||||
public:
|
||||
typedef typename T::InterfaceType InterfaceType;
|
||||
|
||||
operator IUnknown**() const throw()
|
||||
{
|
||||
static_assert(__is_base_of(IUnknown, InterfaceType), "Invalid cast: InterfaceType does not derive from IUnknown");
|
||||
return reinterpret_cast<IUnknown**>(ptr_->ReleaseAndGetAddressOf());
|
||||
}
|
||||
|
||||
protected:
|
||||
T* ptr_;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class ComPtrRef : public Details::ComPtrRefBase<T> // T should be the ComPtr<T> or a derived type of it, not just the interface
|
||||
{
|
||||
using Super = Details::ComPtrRefBase<T>;
|
||||
using InterfaceType = typename Super::InterfaceType;
|
||||
public:
|
||||
ComPtrRef(_In_opt_ T* ptr) throw()
|
||||
{
|
||||
this->ptr_ = ptr;
|
||||
}
|
||||
|
||||
// Conversion operators
|
||||
operator void**() const throw()
|
||||
{
|
||||
return reinterpret_cast<void**>(this->ptr_->ReleaseAndGetAddressOf());
|
||||
}
|
||||
|
||||
// This is our operator ComPtr<U> (or the latest derived class from ComPtr (e.g. WeakRef))
|
||||
operator T*() throw()
|
||||
{
|
||||
*this->ptr_ = nullptr;
|
||||
return this->ptr_;
|
||||
}
|
||||
|
||||
// We define operator InterfaceType**() here instead of on ComPtrRefBase<T>, since
|
||||
// if InterfaceType is IUnknown or IInspectable, having it on the base will collide.
|
||||
operator InterfaceType**() throw()
|
||||
{
|
||||
return this->ptr_->ReleaseAndGetAddressOf();
|
||||
}
|
||||
|
||||
// This is used for IID_PPV_ARGS in order to do __uuidof(**(ppType)).
|
||||
// It does not need to clear ptr_ at this point, it is done at IID_PPV_ARGS_Helper(ComPtrRef&) later in this file.
|
||||
InterfaceType* operator *() throw()
|
||||
{
|
||||
return this->ptr_->Get();
|
||||
}
|
||||
|
||||
// Explicit functions
|
||||
InterfaceType* const * GetAddressOf() const throw()
|
||||
{
|
||||
return this->ptr_->GetAddressOf();
|
||||
}
|
||||
|
||||
InterfaceType** ReleaseAndGetAddressOf() throw()
|
||||
{
|
||||
return this->ptr_->ReleaseAndGetAddressOf();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
class ComPtr
|
||||
{
|
||||
public:
|
||||
typedef T InterfaceType;
|
||||
|
||||
protected:
|
||||
InterfaceType *ptr_;
|
||||
template<class U> friend class ComPtr;
|
||||
|
||||
void InternalAddRef() const throw()
|
||||
{
|
||||
if (ptr_ != nullptr)
|
||||
{
|
||||
ptr_->AddRef();
|
||||
}
|
||||
}
|
||||
|
||||
unsigned long InternalRelease() throw()
|
||||
{
|
||||
unsigned long ref = 0;
|
||||
T* temp = ptr_;
|
||||
|
||||
if (temp != nullptr)
|
||||
{
|
||||
ptr_ = nullptr;
|
||||
ref = temp->Release();
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
public:
|
||||
ComPtr() throw() : ptr_(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
ComPtr(decltype(nullptr)) throw() : ptr_(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
template<class U>
|
||||
ComPtr(_In_opt_ U *other) throw() : ptr_(other)
|
||||
{
|
||||
InternalAddRef();
|
||||
}
|
||||
|
||||
ComPtr(const ComPtr& other) throw() : ptr_(other.ptr_)
|
||||
{
|
||||
InternalAddRef();
|
||||
}
|
||||
|
||||
// copy constructor that allows to instantiate class when U* is convertible to T*
|
||||
template<class U>
|
||||
ComPtr(const ComPtr<U> &other, typename std::enable_if<std::is_convertible<U*, T*>::value, void *>::type * = 0) throw() :
|
||||
ptr_(other.ptr_)
|
||||
{
|
||||
InternalAddRef();
|
||||
}
|
||||
|
||||
ComPtr(_Inout_ ComPtr &&other) throw() : ptr_(nullptr)
|
||||
{
|
||||
if (this != reinterpret_cast<ComPtr*>(&reinterpret_cast<unsigned char&>(other)))
|
||||
{
|
||||
Swap(other);
|
||||
}
|
||||
}
|
||||
|
||||
// Move constructor that allows instantiation of a class when U* is convertible to T*
|
||||
template<class U>
|
||||
ComPtr(_Inout_ ComPtr<U>&& other, typename std::enable_if<std::is_convertible<U*, T*>::value, void *>::type * = 0) throw() :
|
||||
ptr_(other.ptr_)
|
||||
{
|
||||
other.ptr_ = nullptr;
|
||||
}
|
||||
|
||||
~ComPtr() throw()
|
||||
{
|
||||
InternalRelease();
|
||||
}
|
||||
|
||||
ComPtr& operator=(decltype(nullptr)) throw()
|
||||
{
|
||||
InternalRelease();
|
||||
return *this;
|
||||
}
|
||||
|
||||
ComPtr& operator=(_In_opt_ T *other) throw()
|
||||
{
|
||||
if (ptr_ != other)
|
||||
{
|
||||
ComPtr(other).Swap(*this);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename U>
|
||||
ComPtr& operator=(_In_opt_ U *other) throw()
|
||||
{
|
||||
ComPtr(other).Swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
ComPtr& operator=(const ComPtr &other) throw()
|
||||
{
|
||||
if (ptr_ != other.ptr_)
|
||||
{
|
||||
ComPtr(other).Swap(*this);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<class U>
|
||||
ComPtr& operator=(const ComPtr<U>& other) throw()
|
||||
{
|
||||
ComPtr(other).Swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
ComPtr& operator=(_Inout_ ComPtr &&other) throw()
|
||||
{
|
||||
ComPtr(static_cast<ComPtr&&>(other)).Swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<class U>
|
||||
ComPtr& operator=(_Inout_ ComPtr<U>&& other) throw()
|
||||
{
|
||||
ComPtr(static_cast<ComPtr<U>&&>(other)).Swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Swap(_Inout_ ComPtr&& r) throw()
|
||||
{
|
||||
T* tmp = ptr_;
|
||||
ptr_ = r.ptr_;
|
||||
r.ptr_ = tmp;
|
||||
}
|
||||
|
||||
void Swap(_Inout_ ComPtr& r) throw()
|
||||
{
|
||||
T* tmp = ptr_;
|
||||
ptr_ = r.ptr_;
|
||||
r.ptr_ = tmp;
|
||||
}
|
||||
|
||||
operator Details::BoolType() const throw()
|
||||
{
|
||||
return Get() != nullptr ? &Details::BoolStruct::Member : nullptr;
|
||||
}
|
||||
|
||||
T* Get() const throw()
|
||||
{
|
||||
return ptr_;
|
||||
}
|
||||
|
||||
InterfaceType* operator->() const throw()
|
||||
{
|
||||
return ptr_;
|
||||
}
|
||||
|
||||
Details::ComPtrRef<ComPtr<T>> operator&() throw()
|
||||
{
|
||||
return Details::ComPtrRef<ComPtr<T>>(this);
|
||||
}
|
||||
|
||||
const Details::ComPtrRef<const ComPtr<T>> operator&() const throw()
|
||||
{
|
||||
return Details::ComPtrRef<const ComPtr<T>>(this);
|
||||
}
|
||||
|
||||
T* const* GetAddressOf() const throw()
|
||||
{
|
||||
return &ptr_;
|
||||
}
|
||||
|
||||
T** GetAddressOf() throw()
|
||||
{
|
||||
return &ptr_;
|
||||
}
|
||||
|
||||
T** ReleaseAndGetAddressOf() throw()
|
||||
{
|
||||
InternalRelease();
|
||||
return &ptr_;
|
||||
}
|
||||
|
||||
T* Detach() throw()
|
||||
{
|
||||
T* ptr = ptr_;
|
||||
ptr_ = nullptr;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void Attach(_In_opt_ InterfaceType* other) throw()
|
||||
{
|
||||
if (ptr_ != nullptr)
|
||||
{
|
||||
auto ref = ptr_->Release();
|
||||
// DBG_UNREFERENCED_LOCAL_VARIABLE(ref);
|
||||
// Attaching to the same object only works if duplicate references are being coalesced. Otherwise
|
||||
// re-attaching will cause the pointer to be released and may cause a crash on a subsequent dereference.
|
||||
assert(ref != 0 || ptr_ != other);
|
||||
}
|
||||
|
||||
ptr_ = other;
|
||||
}
|
||||
|
||||
unsigned long Reset()
|
||||
{
|
||||
return InternalRelease();
|
||||
}
|
||||
|
||||
// Previously, unsafe behavior could be triggered when 'this' is ComPtr<IInspectable> or ComPtr<IUnknown> and CopyTo is used to copy to another type U.
|
||||
// The user will use operator& to convert the destination into a ComPtrRef, which can then implicit cast to IInspectable** and IUnknown**.
|
||||
// If this overload of CopyTo is not present, it will implicitly cast to IInspectable or IUnknown and match CopyTo(InterfaceType**) instead.
|
||||
// A valid polymoprhic downcast requires run-time type checking via QueryInterface, so CopyTo(InterfaceType**) will break type safety.
|
||||
// This overload matches ComPtrRef before the implicit cast takes place, preventing the unsafe downcast.
|
||||
template <typename U>
|
||||
HRESULT CopyTo(Details::ComPtrRef<ComPtr<U>> ptr, typename std::enable_if<
|
||||
(std::is_same<T, IUnknown>::value)
|
||||
&& !std::is_same<U*, T*>::value, void *>::type * = 0) const throw()
|
||||
{
|
||||
return ptr_->QueryInterface(__uuidof(U), ptr);
|
||||
}
|
||||
|
||||
HRESULT CopyTo(_Outptr_result_maybenull_ InterfaceType** ptr) const throw()
|
||||
{
|
||||
InternalAddRef();
|
||||
*ptr = ptr_;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CopyTo(REFIID riid, _Outptr_result_nullonfailure_ void** ptr) const throw()
|
||||
{
|
||||
return ptr_->QueryInterface(riid, ptr);
|
||||
}
|
||||
|
||||
template<typename U>
|
||||
HRESULT CopyTo(_Outptr_result_nullonfailure_ U** ptr) const throw()
|
||||
{
|
||||
return ptr_->QueryInterface(__uuidof(U), reinterpret_cast<void**>(ptr));
|
||||
}
|
||||
|
||||
// query for U interface
|
||||
template<typename U>
|
||||
HRESULT As(_Inout_ Details::ComPtrRef<ComPtr<U>> p) const throw()
|
||||
{
|
||||
return ptr_->QueryInterface(__uuidof(U), p);
|
||||
}
|
||||
|
||||
// query for U interface
|
||||
template<typename U>
|
||||
HRESULT As(_Out_ ComPtr<U>* p) const throw()
|
||||
{
|
||||
return ptr_->QueryInterface(__uuidof(U), reinterpret_cast<void**>(p->ReleaseAndGetAddressOf()));
|
||||
}
|
||||
|
||||
// query for riid interface and return as IUnknown
|
||||
HRESULT AsIID(REFIID riid, _Out_ ComPtr<IUnknown>* p) const throw()
|
||||
{
|
||||
return ptr_->QueryInterface(riid, reinterpret_cast<void**>(p->ReleaseAndGetAddressOf()));
|
||||
}
|
||||
|
||||
}; // ComPtr
|
||||
|
||||
|
||||
namespace Details
|
||||
{
|
||||
// Empty struct used as default template parameter
|
||||
class Nil
|
||||
{
|
||||
};
|
||||
|
||||
// Empty struct used for validating template parameter types in Implements
|
||||
struct ImplementsBase
|
||||
{
|
||||
};
|
||||
|
||||
class RuntimeClassBase
|
||||
{
|
||||
protected:
|
||||
template<typename T>
|
||||
static HRESULT AsIID(_In_ T* implements, REFIID riid, _Outptr_result_nullonfailure_ void **ppvObject) noexcept
|
||||
{
|
||||
*ppvObject = nullptr;
|
||||
bool isRefDelegated = false;
|
||||
// Prefer InlineIsEqualGUID over other forms since it's better perf on 4-byte aligned data, which is almost always the case.
|
||||
if (InlineIsEqualGUID(riid, __uuidof(IUnknown)))
|
||||
{
|
||||
*ppvObject = implements->CastToUnknown();
|
||||
static_cast<IUnknown*>(*ppvObject)->AddRef();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT hr = implements->CanCastTo(riid, ppvObject, &isRefDelegated);
|
||||
if (SUCCEEDED(hr) && !isRefDelegated)
|
||||
{
|
||||
static_cast<IUnknown*>(*ppvObject)->AddRef();
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 6102) // '*ppvObject' is used but may not be initialized
|
||||
#endif
|
||||
_Analysis_assume_(SUCCEEDED(hr) || (*ppvObject == nullptr));
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
return hr;
|
||||
}
|
||||
|
||||
public:
|
||||
HRESULT RuntimeClassInitialize() noexcept
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
};
|
||||
|
||||
// Interface traits provides casting and filling iids methods helpers
|
||||
template<typename I0>
|
||||
struct InterfaceTraits
|
||||
{
|
||||
typedef I0 Base;
|
||||
|
||||
template<typename T>
|
||||
static Base* CastToBase(_In_ T* ptr) noexcept
|
||||
{
|
||||
return static_cast<Base*>(ptr);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static IUnknown* CastToUnknown(_In_ T* ptr) noexcept
|
||||
{
|
||||
return static_cast<IUnknown*>(static_cast<Base*>(ptr));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
_Success_(return == true)
|
||||
static bool CanCastTo(_In_ T* ptr, REFIID riid, _Outptr_ void **ppv) noexcept
|
||||
{
|
||||
// Prefer InlineIsEqualGUID over other forms since it's better perf on 4-byte aligned data, which is almost always the case.
|
||||
if (InlineIsEqualGUID(riid, __uuidof(Base)))
|
||||
{
|
||||
*ppv = static_cast<Base*>(ptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// Specialization for Nil parameter
|
||||
template<>
|
||||
struct InterfaceTraits<Nil>
|
||||
{
|
||||
typedef Nil Base;
|
||||
|
||||
template <typename T>
|
||||
_Success_(return == true)
|
||||
static bool CanCastTo(_In_ T*, REFIID, _Outptr_ void **) noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// ChainInterfaces - template allows specifying a derived COM interface along with its class hierarchy to allow QI for the base interfaces
|
||||
template <typename I0, typename I1, typename I2 = Nil, typename I3 = Nil,
|
||||
typename I4 = Nil, typename I5 = Nil, typename I6 = Nil,
|
||||
typename I7 = Nil, typename I8 = Nil, typename I9 = Nil>
|
||||
struct ChainInterfaces : I0
|
||||
{
|
||||
protected:
|
||||
HRESULT CanCastTo(REFIID riid, _Outptr_ void **ppv) throw()
|
||||
{
|
||||
typename InterfaceTraits<I0>::Base* ptr = InterfaceTraits<I0>::CastToBase(this);
|
||||
|
||||
return (InterfaceTraits<I0>::CanCastTo(this, riid, ppv) ||
|
||||
InterfaceTraits<I1>::CanCastTo(ptr, riid, ppv) ||
|
||||
InterfaceTraits<I2>::CanCastTo(ptr, riid, ppv) ||
|
||||
InterfaceTraits<I3>::CanCastTo(ptr, riid, ppv) ||
|
||||
InterfaceTraits<I4>::CanCastTo(ptr, riid, ppv) ||
|
||||
InterfaceTraits<I5>::CanCastTo(ptr, riid, ppv) ||
|
||||
InterfaceTraits<I6>::CanCastTo(ptr, riid, ppv) ||
|
||||
InterfaceTraits<I7>::CanCastTo(ptr, riid, ppv) ||
|
||||
InterfaceTraits<I8>::CanCastTo(ptr, riid, ppv) ||
|
||||
InterfaceTraits<I9>::CanCastTo(ptr, riid, ppv)) ? S_OK : E_NOINTERFACE;
|
||||
}
|
||||
|
||||
IUnknown* CastToUnknown() throw()
|
||||
{
|
||||
return InterfaceTraits<I0>::CastToUnknown(this);
|
||||
}
|
||||
};
|
||||
|
||||
// Helper template used by Implements. This template traverses a list of interfaces and adds them as base class and information
|
||||
// to enable QI.
|
||||
template <typename ...TInterfaces>
|
||||
struct ImplementsHelper;
|
||||
|
||||
template <typename T>
|
||||
struct ImplementsMarker
|
||||
{};
|
||||
|
||||
template <typename I0, bool isImplements>
|
||||
struct MarkImplements;
|
||||
|
||||
template <typename I0>
|
||||
struct MarkImplements<I0, false>
|
||||
{
|
||||
typedef I0 Type;
|
||||
};
|
||||
|
||||
template <typename I0>
|
||||
struct MarkImplements<I0, true>
|
||||
{
|
||||
typedef ImplementsMarker<I0> Type;
|
||||
};
|
||||
|
||||
// AdjustImplements pre-processes the type list for more efficient builds.
|
||||
template <typename ...Bases>
|
||||
struct AdjustImplements;
|
||||
|
||||
template <typename I0, typename ...Bases>
|
||||
struct AdjustImplements<I0, Bases...>
|
||||
{
|
||||
typedef ImplementsHelper<typename MarkImplements<I0, std::is_base_of<ImplementsBase, I0>::value>::Type, Bases...> Type;
|
||||
};
|
||||
|
||||
// Use AdjustImplements to remove instances of "Nil" from the type list.
|
||||
template <typename ...Bases>
|
||||
struct AdjustImplements<Nil, Bases...>
|
||||
{
|
||||
typedef typename AdjustImplements<Bases...>::Type Type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct AdjustImplements<>
|
||||
{
|
||||
typedef ImplementsHelper<> Type;
|
||||
};
|
||||
|
||||
// Specialization handles unadorned interfaces
|
||||
template <typename I0, typename ...TInterfaces>
|
||||
struct ImplementsHelper<I0, TInterfaces...> :
|
||||
I0,
|
||||
AdjustImplements<TInterfaces...>::Type
|
||||
{
|
||||
template <typename ...> friend struct ImplementsHelper;
|
||||
friend class RuntimeClassBase;
|
||||
|
||||
protected:
|
||||
|
||||
HRESULT CanCastTo(REFIID riid, _Outptr_ void **ppv, bool *pRefDelegated = nullptr) noexcept
|
||||
{
|
||||
// Prefer InlineIsEqualGUID over other forms since it's better perf on 4-byte aligned data, which is almost always the case.
|
||||
if (InlineIsEqualGUID(riid, __uuidof(I0)))
|
||||
{
|
||||
*ppv = reinterpret_cast<I0*>(reinterpret_cast<void*>(this));
|
||||
return S_OK;
|
||||
}
|
||||
return AdjustImplements<TInterfaces...>::Type::CanCastTo(riid, ppv, pRefDelegated);
|
||||
}
|
||||
|
||||
IUnknown* CastToUnknown() noexcept
|
||||
{
|
||||
return reinterpret_cast<I0*>(reinterpret_cast<void*>(this));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Selector is used to "tag" base interfaces to be used in casting, since a runtime class may indirectly derive from
|
||||
// the same interface or Implements<> template multiple times
|
||||
template <typename base, typename disciminator>
|
||||
struct Selector : public base
|
||||
{
|
||||
};
|
||||
|
||||
// Specialization handles types that derive from ImplementsHelper (e.g. nested Implements).
|
||||
template <typename I0, typename ...TInterfaces>
|
||||
struct ImplementsHelper<ImplementsMarker<I0>, TInterfaces...> :
|
||||
Selector<I0, ImplementsHelper<ImplementsMarker<I0>, TInterfaces...>>,
|
||||
Selector<typename AdjustImplements<TInterfaces...>::Type, ImplementsHelper<ImplementsMarker<I0>, TInterfaces...>>
|
||||
{
|
||||
template <typename ...> friend struct ImplementsHelper;
|
||||
friend class RuntimeClassBase;
|
||||
|
||||
protected:
|
||||
typedef Selector<I0, ImplementsHelper<ImplementsMarker<I0>, TInterfaces...>> CurrentType;
|
||||
typedef Selector<typename AdjustImplements<TInterfaces...>::Type, ImplementsHelper<ImplementsMarker<I0>, TInterfaces...>> BaseType;
|
||||
|
||||
HRESULT CanCastTo(REFIID riid, _Outptr_ void **ppv, bool *pRefDelegated = nullptr) noexcept
|
||||
{
|
||||
HRESULT hr = CurrentType::CanCastTo(riid, ppv);
|
||||
if (hr == E_NOINTERFACE)
|
||||
{
|
||||
hr = BaseType::CanCastTo(riid, ppv, pRefDelegated);
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
IUnknown* CastToUnknown() noexcept
|
||||
{
|
||||
// First in list wins.
|
||||
return CurrentType::CastToUnknown();
|
||||
}
|
||||
};
|
||||
|
||||
// terminal case specialization.
|
||||
template <>
|
||||
struct ImplementsHelper<>
|
||||
{
|
||||
template <typename ...> friend struct ImplementsHelper;
|
||||
friend class RuntimeClassBase;
|
||||
|
||||
protected:
|
||||
HRESULT CanCastTo(_In_ REFIID /*riid*/, _Outptr_ void ** /*ppv*/, bool * /*pRefDelegated*/ = nullptr) noexcept
|
||||
{
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
// IUnknown* CastToUnknown() noexcept; // not defined for terminal case.
|
||||
};
|
||||
|
||||
// Specialization handles chaining interfaces
|
||||
template <typename C0, typename C1, typename C2, typename C3, typename C4, typename C5, typename C6, typename C7, typename C8, typename C9, typename ...TInterfaces>
|
||||
struct ImplementsHelper<ChainInterfaces<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9>, TInterfaces...> :
|
||||
ChainInterfaces<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9>,
|
||||
AdjustImplements<TInterfaces...>::Type
|
||||
{
|
||||
template <typename ...> friend struct ImplementsHelper;
|
||||
friend class RuntimeClassBase;
|
||||
|
||||
protected:
|
||||
typedef typename AdjustImplements<TInterfaces...>::Type BaseType;
|
||||
|
||||
HRESULT CanCastTo(REFIID riid, _Outptr_ void **ppv, bool *pRefDelegated = nullptr) noexcept
|
||||
{
|
||||
HRESULT hr = ChainInterfaces<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9>::CanCastTo(riid, ppv);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
hr = BaseType::CanCastTo(riid, ppv, pRefDelegated);
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
IUnknown* CastToUnknown() noexcept
|
||||
{
|
||||
return ChainInterfaces<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9>::CastToUnknown();
|
||||
}
|
||||
};
|
||||
|
||||
// Implements - template implementing QI using the information provided through its template parameters
|
||||
// Each template parameter has to be one of the following:
|
||||
// * COM Interface
|
||||
// * A class that implements one or more COM interfaces
|
||||
// * ChainInterfaces template
|
||||
template <typename I0, typename ...TInterfaces>
|
||||
struct Implements :
|
||||
AdjustImplements<I0, TInterfaces...>::Type,
|
||||
ImplementsBase
|
||||
{
|
||||
public:
|
||||
typedef I0 FirstInterface;
|
||||
protected:
|
||||
typedef typename AdjustImplements<I0, TInterfaces...>::Type BaseType;
|
||||
template <typename ...> friend struct ImplementsHelper;
|
||||
friend class RuntimeClassBase;
|
||||
|
||||
HRESULT CanCastTo(REFIID riid, _Outptr_ void **ppv) noexcept
|
||||
{
|
||||
return BaseType::CanCastTo(riid, ppv);
|
||||
}
|
||||
|
||||
IUnknown* CastToUnknown() noexcept
|
||||
{
|
||||
return BaseType::CastToUnknown();
|
||||
}
|
||||
};
|
||||
|
||||
// Used on RuntimeClass to protect it from being constructed with new
|
||||
class DontUseNewUseMake
|
||||
{
|
||||
private:
|
||||
void* operator new(size_t) noexcept
|
||||
{
|
||||
assert(false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
public:
|
||||
void* operator new(size_t, _In_ void* placement) noexcept
|
||||
{
|
||||
return placement;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename ...TInterfaces>
|
||||
class RuntimeClassImpl :
|
||||
public AdjustImplements<TInterfaces...>::Type,
|
||||
public RuntimeClassBase,
|
||||
public DontUseNewUseMake
|
||||
{
|
||||
public:
|
||||
STDMETHOD(QueryInterface)(REFIID riid, _Outptr_result_nullonfailure_ void **ppvObject)
|
||||
{
|
||||
return Super::AsIID(this, riid, ppvObject);
|
||||
}
|
||||
|
||||
STDMETHOD_(ULONG, AddRef)()
|
||||
{
|
||||
return InternalAddRef();
|
||||
}
|
||||
|
||||
STDMETHOD_(ULONG, Release)()
|
||||
{
|
||||
ULONG ref = InternalRelease();
|
||||
if (ref == 0)
|
||||
{
|
||||
this->~RuntimeClassImpl();
|
||||
delete[] reinterpret_cast<char*>(this);
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
protected:
|
||||
using Super = RuntimeClassBase;
|
||||
static const LONG c_lProtectDestruction = -(LONG_MAX / 2);
|
||||
|
||||
RuntimeClassImpl() noexcept = default;
|
||||
|
||||
virtual ~RuntimeClassImpl() noexcept
|
||||
{
|
||||
// Set refcount_ to -(LONG_MAX/2) to protect destruction and
|
||||
// also catch mismatched Release in debug builds
|
||||
refcount_ = static_cast<ULONG>(c_lProtectDestruction);
|
||||
}
|
||||
|
||||
ULONG InternalAddRef() noexcept
|
||||
{
|
||||
return ++refcount_;
|
||||
}
|
||||
|
||||
ULONG InternalRelease() noexcept
|
||||
{
|
||||
return --refcount_;
|
||||
}
|
||||
|
||||
unsigned long GetRefCount() const noexcept
|
||||
{
|
||||
return refcount_;
|
||||
}
|
||||
|
||||
std::atomic<ULONG> refcount_{1};
|
||||
};
|
||||
}
|
||||
|
||||
template <typename ...TInterfaces>
|
||||
class Base : public Details::RuntimeClassImpl<TInterfaces...>
|
||||
{
|
||||
Base(const Base&) = delete;
|
||||
Base& operator=(const Base&) = delete;
|
||||
|
||||
protected:
|
||||
HRESULT CustomQueryInterface(REFIID /*riid*/, _Outptr_result_nullonfailure_ void** /*ppvObject*/, _Out_ bool *handled)
|
||||
{
|
||||
*handled = false;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
public:
|
||||
Base() throw() = default;
|
||||
typedef Base RuntimeClassT;
|
||||
};
|
||||
|
||||
// Creates a Nano-COM object wrapped in a smart pointer.
|
||||
template <typename T, typename ...TArgs>
|
||||
ComPtr<T> Make(TArgs&&... args)
|
||||
{
|
||||
std::unique_ptr<char[]> buffer(new(std::nothrow) char[sizeof(T)]);
|
||||
ComPtr<T> object;
|
||||
|
||||
if (buffer)
|
||||
{
|
||||
T* ptr = new (buffer.get())T(std::forward<TArgs>(args)...);
|
||||
object.Attach(ptr);
|
||||
buffer.release();
|
||||
}
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
using Details::ChainInterfaces;
|
||||
}
|
||||
}
|
||||
|
||||
// Overloaded global function to provide to IID_PPV_ARGS that support Details::ComPtrRef
|
||||
template<typename T>
|
||||
void** IID_PPV_ARGS_Helper(Microsoft::WRL::Details::ComPtrRef<T> pp) throw()
|
||||
{
|
||||
return pp;
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
MICROSOFT SOFTWARE LICENSE TERMS
|
||||
MICROSOFT DIRECTX SOFTWARE DEVELOPMENT KIT (SDK)
|
||||
These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. The terms also apply to any Microsoft
|
||||
• updates,
|
||||
• supplements,
|
||||
• Internet-based services, and
|
||||
• support services
|
||||
for this software, unless other terms accompany those items. If so, those terms apply.
|
||||
BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.
|
||||
If you comply with these license terms, you have the rights below.
|
||||
1. INSTALLATION AND USE RIGHTS.
|
||||
a. Installation and Use. You may install and use any number of copies of the software on your devices.
|
||||
b. Included Microsoft Programs. The software contains other Microsoft programs. The license terms with those programs apply to your use of them.
|
||||
2. ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.
|
||||
a. Media Elements and Templates. You may copy and use images, clip art, animations, sounds, music, shapes, video clips and templates provided with the software and identified for such use in documents and projects that you create. You may distribute those documents and projects non-commercially. If you wish to use these media elements or templates for any other purpose, go to www.microsoft.com/permission to learn whether that use is allowed.
|
||||
b. Distributable Code. The software contains code that you are permitted to distribute in programs you develop if you comply with the terms below.
|
||||
i. Right to Use and Distribute. The code and text files listed below are “Distributable Code.”
|
||||
• DIRECTX REDIST.TXT Files. You may copy and distribute the object code form of code listed in DIRECTX REDIST.TXT files.
|
||||
• Sample Code. You may modify, copy, and distribute the source and object code form of code marked as “sample”, as well as those marked as follows:
|
||||
\Utilities\bin\x86\dxerr
|
||||
\Utilities\bin\x64\dxerr
|
||||
\Utilities\bin\x86\dxtex
|
||||
\Utilities\bin\x64\dxtex
|
||||
\Utilities\bin\x86\DxViewer
|
||||
\Utilities\bin\x64\DxViewer
|
||||
\Utilities\bin\x86\GDFTrace
|
||||
\Utilities\bin\x64\GDFTrace
|
||||
\Utilities\bin\x86\MeshConvert
|
||||
\Utilities\bin\x64\MeshConvert
|
||||
\Utilities\Source\Sas
|
||||
\Utilities\Source\Effects11
|
||||
• Third Party Distribution. You may permit distributors of your programs to copy and distribute the Distributable Code as part of those programs.
|
||||
ii. Distribution Requirements. For any Distributable Code you distribute, you must
|
||||
• add significant primary functionality to it in your programs;
|
||||
• require distributors and external end users to agree to terms that protect it at least as much as this agreement;
|
||||
• display your valid copyright notice on your programs; and
|
||||
• indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’ fees, related to the distribution or use of your programs.
|
||||
iii. Distribution Restrictions. You may not
|
||||
• alter any copyright, trademark or patent notice in the Distributable Code;
|
||||
• use Microsoft’s trademarks in your programs’ names or in a way that suggests your programs come from or are endorsed by Microsoft;
|
||||
• distribute Distributable Code to run on a platform other than the Windows, Xbox and Windows Mobile platforms;
|
||||
• include Distributable Code in malicious, deceptive or unlawful programs; or
|
||||
• modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded License is one that requires, as a condition of use, modification or distribution, that
|
||||
• the code be disclosed or distributed in source code form; or
|
||||
• others have the right to modify it.
|
||||
3. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not
|
||||
• disclose the results of any benchmark tests of the software to any third party without Microsoft’s prior written approval;
|
||||
• work around any technical limitations in the software;
|
||||
• reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation;
|
||||
• make more copies of the software than specified in this agreement or allowed by applicable law, despite this limitation;
|
||||
• publish the software for others to copy;
|
||||
• rent, lease or lend the software; or
|
||||
• use the software for commercial software hosting services.
|
||||
4. BACKUP COPY. You may make one backup copy of the software. You may use it only to reinstall the software.
|
||||
5. DOCUMENTATION. Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes.
|
||||
6. EXPORT RESTRICTIONS. The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see www.microsoft.com/exporting.
|
||||
7. SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it.
|
||||
8. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.
|
||||
9. APPLICABLE LAW.
|
||||
a. United States. If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.
|
||||
b. Outside the United States. If you acquired the software in any other country, the laws of that country apply.
|
||||
10. LEGAL EFFECT. This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so.
|
||||
11. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.” YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR CONDITIONS. YOU MAY HAVE ADDITIONAL CONSUMER RIGHTS UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
12. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
|
||||
This limitation applies to
|
||||
• anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and
|
||||
• claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law.
|
||||
It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.
|
||||
Please note: As this software is distributed in Quebec, Canada, some of the clauses in this agreement are provided below in French.
|
||||
Remarque : Ce logiciel étant distribué au Québec, Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en français.
|
||||
EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualité marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont exclues.
|
||||
LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autres dommages, y compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices.
|
||||
Cette limitation concerne :
|
||||
• tout ce qui est relié au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers ; et
|
||||
• les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité stricte, de négligence ou d’une autre faute dans la limite autorisée par la loi en vigueur.
|
||||
Elle s’applique également, même si Microsoft connaissait ou devrait connaître l’éventualité d’un tel dommage. Si votre pays n’autorise pas l’exclusion ou la limitation de responsabilité pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l’exclusion ci-dessus ne s’appliquera pas à votre égard.
|
||||
EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si celles-ci ne le permettent pas.
|
2539
3rdparty/bgfx/3rdparty/dxsdk/include/d3d12_1.h
vendored
2539
3rdparty/bgfx/3rdparty/dxsdk/include/d3d12_1.h
vendored
File diff suppressed because it is too large
Load Diff
3225
3rdparty/bgfx/3rdparty/dxsdk/include/d3d12sdklayers.h
vendored
3225
3rdparty/bgfx/3rdparty/dxsdk/include/d3d12sdklayers.h
vendored
File diff suppressed because it is too large
Load Diff
3352
3rdparty/bgfx/3rdparty/dxsdk/include/d3d12video.h
vendored
3352
3rdparty/bgfx/3rdparty/dxsdk/include/d3d12video.h
vendored
File diff suppressed because it is too large
Load Diff
1522
3rdparty/bgfx/3rdparty/dxsdk/include/d3dx12.h
vendored
1522
3rdparty/bgfx/3rdparty/dxsdk/include/d3dx12.h
vendored
File diff suppressed because it is too large
Load Diff
137
3rdparty/bgfx/3rdparty/dxsdk/include/dxgiformat.h
vendored
137
3rdparty/bgfx/3rdparty/dxsdk/include/dxgiformat.h
vendored
@ -1,137 +0,0 @@
|
||||
//
|
||||
// Copyright (C) Microsoft. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef __dxgiformat_h__
|
||||
#define __dxgiformat_h__
|
||||
|
||||
#define DXGI_FORMAT_DEFINED 1
|
||||
|
||||
typedef enum DXGI_FORMAT
|
||||
{
|
||||
DXGI_FORMAT_UNKNOWN = 0,
|
||||
DXGI_FORMAT_R32G32B32A32_TYPELESS = 1,
|
||||
DXGI_FORMAT_R32G32B32A32_FLOAT = 2,
|
||||
DXGI_FORMAT_R32G32B32A32_UINT = 3,
|
||||
DXGI_FORMAT_R32G32B32A32_SINT = 4,
|
||||
DXGI_FORMAT_R32G32B32_TYPELESS = 5,
|
||||
DXGI_FORMAT_R32G32B32_FLOAT = 6,
|
||||
DXGI_FORMAT_R32G32B32_UINT = 7,
|
||||
DXGI_FORMAT_R32G32B32_SINT = 8,
|
||||
DXGI_FORMAT_R16G16B16A16_TYPELESS = 9,
|
||||
DXGI_FORMAT_R16G16B16A16_FLOAT = 10,
|
||||
DXGI_FORMAT_R16G16B16A16_UNORM = 11,
|
||||
DXGI_FORMAT_R16G16B16A16_UINT = 12,
|
||||
DXGI_FORMAT_R16G16B16A16_SNORM = 13,
|
||||
DXGI_FORMAT_R16G16B16A16_SINT = 14,
|
||||
DXGI_FORMAT_R32G32_TYPELESS = 15,
|
||||
DXGI_FORMAT_R32G32_FLOAT = 16,
|
||||
DXGI_FORMAT_R32G32_UINT = 17,
|
||||
DXGI_FORMAT_R32G32_SINT = 18,
|
||||
DXGI_FORMAT_R32G8X24_TYPELESS = 19,
|
||||
DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20,
|
||||
DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21,
|
||||
DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22,
|
||||
DXGI_FORMAT_R10G10B10A2_TYPELESS = 23,
|
||||
DXGI_FORMAT_R10G10B10A2_UNORM = 24,
|
||||
DXGI_FORMAT_R10G10B10A2_UINT = 25,
|
||||
DXGI_FORMAT_R11G11B10_FLOAT = 26,
|
||||
DXGI_FORMAT_R8G8B8A8_TYPELESS = 27,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM = 28,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29,
|
||||
DXGI_FORMAT_R8G8B8A8_UINT = 30,
|
||||
DXGI_FORMAT_R8G8B8A8_SNORM = 31,
|
||||
DXGI_FORMAT_R8G8B8A8_SINT = 32,
|
||||
DXGI_FORMAT_R16G16_TYPELESS = 33,
|
||||
DXGI_FORMAT_R16G16_FLOAT = 34,
|
||||
DXGI_FORMAT_R16G16_UNORM = 35,
|
||||
DXGI_FORMAT_R16G16_UINT = 36,
|
||||
DXGI_FORMAT_R16G16_SNORM = 37,
|
||||
DXGI_FORMAT_R16G16_SINT = 38,
|
||||
DXGI_FORMAT_R32_TYPELESS = 39,
|
||||
DXGI_FORMAT_D32_FLOAT = 40,
|
||||
DXGI_FORMAT_R32_FLOAT = 41,
|
||||
DXGI_FORMAT_R32_UINT = 42,
|
||||
DXGI_FORMAT_R32_SINT = 43,
|
||||
DXGI_FORMAT_R24G8_TYPELESS = 44,
|
||||
DXGI_FORMAT_D24_UNORM_S8_UINT = 45,
|
||||
DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46,
|
||||
DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47,
|
||||
DXGI_FORMAT_R8G8_TYPELESS = 48,
|
||||
DXGI_FORMAT_R8G8_UNORM = 49,
|
||||
DXGI_FORMAT_R8G8_UINT = 50,
|
||||
DXGI_FORMAT_R8G8_SNORM = 51,
|
||||
DXGI_FORMAT_R8G8_SINT = 52,
|
||||
DXGI_FORMAT_R16_TYPELESS = 53,
|
||||
DXGI_FORMAT_R16_FLOAT = 54,
|
||||
DXGI_FORMAT_D16_UNORM = 55,
|
||||
DXGI_FORMAT_R16_UNORM = 56,
|
||||
DXGI_FORMAT_R16_UINT = 57,
|
||||
DXGI_FORMAT_R16_SNORM = 58,
|
||||
DXGI_FORMAT_R16_SINT = 59,
|
||||
DXGI_FORMAT_R8_TYPELESS = 60,
|
||||
DXGI_FORMAT_R8_UNORM = 61,
|
||||
DXGI_FORMAT_R8_UINT = 62,
|
||||
DXGI_FORMAT_R8_SNORM = 63,
|
||||
DXGI_FORMAT_R8_SINT = 64,
|
||||
DXGI_FORMAT_A8_UNORM = 65,
|
||||
DXGI_FORMAT_R1_UNORM = 66,
|
||||
DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67,
|
||||
DXGI_FORMAT_R8G8_B8G8_UNORM = 68,
|
||||
DXGI_FORMAT_G8R8_G8B8_UNORM = 69,
|
||||
DXGI_FORMAT_BC1_TYPELESS = 70,
|
||||
DXGI_FORMAT_BC1_UNORM = 71,
|
||||
DXGI_FORMAT_BC1_UNORM_SRGB = 72,
|
||||
DXGI_FORMAT_BC2_TYPELESS = 73,
|
||||
DXGI_FORMAT_BC2_UNORM = 74,
|
||||
DXGI_FORMAT_BC2_UNORM_SRGB = 75,
|
||||
DXGI_FORMAT_BC3_TYPELESS = 76,
|
||||
DXGI_FORMAT_BC3_UNORM = 77,
|
||||
DXGI_FORMAT_BC3_UNORM_SRGB = 78,
|
||||
DXGI_FORMAT_BC4_TYPELESS = 79,
|
||||
DXGI_FORMAT_BC4_UNORM = 80,
|
||||
DXGI_FORMAT_BC4_SNORM = 81,
|
||||
DXGI_FORMAT_BC5_TYPELESS = 82,
|
||||
DXGI_FORMAT_BC5_UNORM = 83,
|
||||
DXGI_FORMAT_BC5_SNORM = 84,
|
||||
DXGI_FORMAT_B5G6R5_UNORM = 85,
|
||||
DXGI_FORMAT_B5G5R5A1_UNORM = 86,
|
||||
DXGI_FORMAT_B8G8R8A8_UNORM = 87,
|
||||
DXGI_FORMAT_B8G8R8X8_UNORM = 88,
|
||||
DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89,
|
||||
DXGI_FORMAT_B8G8R8A8_TYPELESS = 90,
|
||||
DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91,
|
||||
DXGI_FORMAT_B8G8R8X8_TYPELESS = 92,
|
||||
DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93,
|
||||
DXGI_FORMAT_BC6H_TYPELESS = 94,
|
||||
DXGI_FORMAT_BC6H_UF16 = 95,
|
||||
DXGI_FORMAT_BC6H_SF16 = 96,
|
||||
DXGI_FORMAT_BC7_TYPELESS = 97,
|
||||
DXGI_FORMAT_BC7_UNORM = 98,
|
||||
DXGI_FORMAT_BC7_UNORM_SRGB = 99,
|
||||
DXGI_FORMAT_AYUV = 100,
|
||||
DXGI_FORMAT_Y410 = 101,
|
||||
DXGI_FORMAT_Y416 = 102,
|
||||
DXGI_FORMAT_NV12 = 103,
|
||||
DXGI_FORMAT_P010 = 104,
|
||||
DXGI_FORMAT_P016 = 105,
|
||||
DXGI_FORMAT_420_OPAQUE = 106,
|
||||
DXGI_FORMAT_YUY2 = 107,
|
||||
DXGI_FORMAT_Y210 = 108,
|
||||
DXGI_FORMAT_Y216 = 109,
|
||||
DXGI_FORMAT_NV11 = 110,
|
||||
DXGI_FORMAT_AI44 = 111,
|
||||
DXGI_FORMAT_IA44 = 112,
|
||||
DXGI_FORMAT_P8 = 113,
|
||||
DXGI_FORMAT_A8P8 = 114,
|
||||
DXGI_FORMAT_B4G4R4A4_UNORM = 115,
|
||||
|
||||
DXGI_FORMAT_P208 = 130,
|
||||
DXGI_FORMAT_V208 = 131,
|
||||
DXGI_FORMAT_V408 = 132,
|
||||
|
||||
|
||||
DXGI_FORMAT_FORCE_UINT = 0xffffffff
|
||||
} DXGI_FORMAT;
|
||||
|
||||
#endif // __dxgiformat_h__
|
@ -1,4 +0,0 @@
|
||||
*.dsp -crlf
|
||||
*.dsw -crlf
|
||||
*.sln -crlf
|
||||
*.vcproj -crlf
|
78
3rdparty/bgfx/3rdparty/glsl-optimizer/.gitignore
vendored
78
3rdparty/bgfx/3rdparty/glsl-optimizer/.gitignore
vendored
@ -1,78 +0,0 @@
|
||||
node_modules
|
||||
*.a
|
||||
*.dll
|
||||
*.exe
|
||||
*.ilk
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.la
|
||||
*.lo
|
||||
*.log
|
||||
*.o
|
||||
*.obj
|
||||
*.os
|
||||
*.pc
|
||||
*.pdb
|
||||
*.pyc
|
||||
*.pyo
|
||||
*.so
|
||||
*.so.*
|
||||
*.sw[a-z]
|
||||
*.tar
|
||||
*.tar.bz2
|
||||
*.tar.gz
|
||||
*.trs
|
||||
*.zip
|
||||
*~
|
||||
depend
|
||||
depend.bak
|
||||
bin/ltmain.sh
|
||||
lib
|
||||
lib64
|
||||
configure
|
||||
configure.lineno
|
||||
autom4te.cache
|
||||
aclocal.m4
|
||||
config.log
|
||||
config.status
|
||||
cscope*
|
||||
.scon*
|
||||
config.py
|
||||
build
|
||||
libtool
|
||||
manifest.txt
|
||||
.dir-locals.el
|
||||
.deps/
|
||||
.dirstamp
|
||||
.libs/
|
||||
Makefile
|
||||
Makefile.in
|
||||
|
||||
ipch
|
||||
|
||||
*.pbxuser
|
||||
*.perspectivev3
|
||||
*.mode1v3
|
||||
.svn
|
||||
*.ncb
|
||||
*.user
|
||||
*.suo
|
||||
*.dSYM
|
||||
xcuserdata
|
||||
*.xcworkspace
|
||||
|
||||
cmake_install.cmake
|
||||
Makefile
|
||||
CMakeFiles/
|
||||
CMakeCache.txt
|
||||
.project
|
||||
.cproject
|
||||
glsl_main
|
||||
glsl_test
|
||||
glslopt
|
||||
glsl_compiler
|
||||
.settings/
|
||||
.pydevproject
|
||||
|
||||
build
|
||||
metalTemp.metal
|
@ -1,2 +0,0 @@
|
||||
projects
|
||||
tests
|
@ -1,51 +0,0 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
include_directories(include)
|
||||
include_directories(src/mesa)
|
||||
include_directories(src/mapi)
|
||||
include_directories(src/glsl)
|
||||
include_directories(src)
|
||||
|
||||
option (DEBUG "Enable debugging" FALSE)
|
||||
|
||||
if(${DEBUG} MATCHES "on")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os -DNDEBUG")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -DNDEBUG")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -s")
|
||||
endif()
|
||||
|
||||
file(GLOB glcpp-library_sources src/glsl/glcpp/*.c src/util/*.c)
|
||||
#file(GLOB glcpp-library_sources_remove src/glsl/glcpp/glcpp.c)
|
||||
#list(REMOVE_ITEM glcpp-library_sources ${glcpp-library_sources_remove})
|
||||
add_library(glcpp-library ${glcpp-library_sources})
|
||||
|
||||
file(GLOB mesa_sources src/mesa/program/*.c src/mesa/main/*.c)
|
||||
add_library(mesa ${mesa_sources})
|
||||
|
||||
file(GLOB glsl_sources src/glsl/*.cpp src/glsl/*.c)
|
||||
file(GLOB glsl_sources_remove src/glsl/main.cpp src/glsl/builtin_stubs.cpp)
|
||||
list(REMOVE_ITEM glsl_sources ${glsl_sources_remove})
|
||||
add_library(glsl_optimizer ${glsl_sources})
|
||||
target_link_libraries(glsl_optimizer glcpp-library mesa)
|
||||
|
||||
add_executable(glsl_compiler src/glsl/main.cpp)
|
||||
target_link_libraries(glsl_compiler glsl_optimizer)
|
||||
|
||||
file(GLOB glsl_test_sources tests/*.cpp)
|
||||
add_executable(glsl_test ${glsl_test_sources})
|
||||
target_link_libraries(glsl_test glsl_optimizer)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
# OSX-specific build requirements
|
||||
find_library(OpenGL_LIBRARY OpenGL )
|
||||
target_link_libraries(glsl_test ${OpenGL_LIBRARY})
|
||||
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
|
||||
file(GLOB glslopt_sources contrib/glslopt/*.cpp)
|
||||
add_executable(glslopt ${glslopt_sources})
|
||||
target_link_libraries(glslopt glsl_optimizer)
|
||||
|
||||
#add_executable(glcpp src/glsl/glcpp/glcpp.c)
|
||||
#target_link_libraries(glcpp glsl_optimizer)
|
238
3rdparty/bgfx/3rdparty/glsl-optimizer/Changelog.md
vendored
238
3rdparty/bgfx/3rdparty/glsl-optimizer/Changelog.md
vendored
@ -1,238 +0,0 @@
|
||||
GLSL optimizer Change Log
|
||||
=========================
|
||||
|
||||
|
||||
2016 10
|
||||
-------
|
||||
|
||||
* Metal/GLES: Fixed bad optimization (all code removed) when framebuffer fetch extension is used, but
|
||||
fragment shader does not actually read the incoming color value.
|
||||
* Fixed translation of texelSize().
|
||||
* Fixed translation of texelFetch().
|
||||
|
||||
|
||||
2016 09
|
||||
-------
|
||||
|
||||
* Metal: Fixed constant precision propagation in some cases.
|
||||
* Metal: Fixed shadowmap sampling when reference Z value is outside of 0..1 range (now clamps to match GLES specs).
|
||||
|
||||
|
||||
2016 06
|
||||
-------
|
||||
|
||||
Fixed:
|
||||
|
||||
* Fixed Metal translation in some cases having wrong precision on constants or constant arrays.
|
||||
|
||||
|
||||
2016 05
|
||||
-------
|
||||
|
||||
Fixed:
|
||||
|
||||
* Fixed Metal translation in some cases having wrong precision on struct members.
|
||||
* Fixed Metal translation in some cases emitting struct declarations vs. constant initializers in wrong order.
|
||||
|
||||
|
||||
2016 03
|
||||
-------
|
||||
|
||||
Fixed:
|
||||
|
||||
* Fixed translation performance regression in loop analysis (regressed in 2015 06 fixes).
|
||||
|
||||
|
||||
2015 08
|
||||
-------
|
||||
|
||||
Changes:
|
||||
|
||||
* 2D shadow and 2D array uniforms got their own glslopt_basic_type entries.
|
||||
|
||||
Fixes:
|
||||
|
||||
* Fixed translation of 2D texture arrays (GLSL with EXT_texture_array, GLES3 and Metal).
|
||||
|
||||
|
||||
2015 06
|
||||
-------
|
||||
|
||||
Fixes:
|
||||
|
||||
* Fixed some cases of different precision matrix assignments being miscompiled on Metal.
|
||||
* Fixed yet more issues with translation of weird loops.
|
||||
* Fixed translation of matrix+scalar, matrix-scalar, matrix/scalar operations on Metal.
|
||||
|
||||
|
||||
2015 05
|
||||
-------
|
||||
|
||||
Fixes:
|
||||
|
||||
* Fixes some cases of highp/mediump sampler sampling resulting in resulting temporaries wrongly being lowp.
|
||||
|
||||
|
||||
2015 04
|
||||
-------
|
||||
|
||||
Goodies:
|
||||
|
||||
* GLES2: support EXT_draw_instanced / gl_InstanceIDEXT.
|
||||
* Support gl_VertexID in GLSL < 1.30 when EXT_gpu_shader4 is used.
|
||||
|
||||
Fixes:
|
||||
|
||||
* Metal: fixed some bugs with translation of weird loops.
|
||||
|
||||
|
||||
2015 02
|
||||
-------
|
||||
|
||||
Tweaks:
|
||||
|
||||
* Texture LOD sampling functions on GLES2.0 now produce a wrapper call, that does approximation
|
||||
(mip bias) on devices that don't support GL_EXT_shader_texture_lod.
|
||||
* Undefined precision integers on GLES now default to highp.
|
||||
|
||||
|
||||
2015 01
|
||||
-------
|
||||
|
||||
Fixes:
|
||||
|
||||
* Float literals are printed with 7 significant digits now.
|
||||
* Metal: GLSL mod() is properly translated into Metal's fmod().
|
||||
* Metal: Fixed some cases of reciprocal (1/x) printing missing half precision cast.
|
||||
* GLES3: textureOffset with a mipmap bias is printed correctly now.
|
||||
* Fixed a bug with loop inductor detection if the inductor was used before the loop for some things.
|
||||
* Fixed printing of int/float bitcast operations.
|
||||
* Improved precision determination of some constructs.
|
||||
|
||||
|
||||
2014 10
|
||||
-------
|
||||
|
||||
Goodies:
|
||||
|
||||
* Support for translating GLSL shaders into Apple Metal shading language.
|
||||
Exactly same process; GLSL in (preferably ES3 variant), optimization passes, Metal out.
|
||||
All uniforms currently will be put into one constant buffer.
|
||||
Pass kGlslTargetMetal target to get Metal.
|
||||
* Shader reflection API. See glslopt_shader_get_* functions. Binding indices
|
||||
are only automatically assigned on Metal now; on GL/ES targets the reflection API is only
|
||||
useful to get list of inputs/uniforms, their names and types.
|
||||
* Improved dead code elimation: some cases of swizzled/masked assignments where same variable was on both sides
|
||||
were not eliminated if that variable was totally unused later.
|
||||
* Merged with upstream Mesa, comes with new optimizations (min/max pruning, tree rebalancing, vector_insert lowering).
|
||||
|
||||
Fixes:
|
||||
|
||||
* sampler3D declarations were missing precision qualifier on GLES3.0.
|
||||
|
||||
|
||||
2014 09
|
||||
-------
|
||||
|
||||
Goodies:
|
||||
|
||||
* Supports GL_EXT_draw_buffers in ES2.0, for MRT.
|
||||
|
||||
|
||||
2014 08
|
||||
-------
|
||||
|
||||
Goodies:
|
||||
|
||||
* Supports GL_EXT_shader_framebuffer_fetch now, in both ES2.0 & 3.0.
|
||||
|
||||
Fixes:
|
||||
|
||||
* Fixed printing of infinities & NaNs.
|
||||
* Fixed vectorization pass in some cases going wrong on texture lookups.
|
||||
|
||||
|
||||
2014 06
|
||||
-------
|
||||
|
||||
Goodies:
|
||||
|
||||
* Optimization: split vectors with only some used components into scalars.
|
||||
|
||||
Fixes:
|
||||
|
||||
* Fixed more issues with for-loop printing.
|
||||
* Fixed printing of unsigned integer swizzled & constants.
|
||||
|
||||
2014 03
|
||||
-------
|
||||
|
||||
Fixes:
|
||||
|
||||
* Fixed missing precision qualifier in some ES shaders (mostly due to expansion of ternary ?: check).
|
||||
|
||||
2014 02
|
||||
-------
|
||||
|
||||
Fixes:
|
||||
|
||||
* Fixed vectorize pass introduced last month going wrong with dot products.
|
||||
|
||||
2014 01
|
||||
-------
|
||||
|
||||
Goodies:
|
||||
|
||||
* Better optimization: vectorize assignments to individual vector channels.
|
||||
* More OpenGL ES 2.0 conformant printing of complex for-loops (loop inductions printed
|
||||
as += or ++; loop initializers inside loop body).
|
||||
|
||||
Fixes:
|
||||
|
||||
* Fixed array assignments sometimes appearing in pre-GLSL1.20 versions, especially with
|
||||
complex loops that couldn't be unrolled.
|
||||
* Fixed output of textureOffset and texelFetch.
|
||||
* Fixed error messages on MRT outputs on GL & GLES3 (now supports 4 MRTs).
|
||||
|
||||
2013 12
|
||||
-------
|
||||
|
||||
Goodies:
|
||||
|
||||
* Optimized performance; was spending half of the time in stupid string code.
|
||||
* Added glslopt_shader_get_stats to get *very* approximate shader complexity stats.
|
||||
* Nicer printing of complicated for-loops.
|
||||
|
||||
Fixes:
|
||||
|
||||
* Fixed printing of struct initializers.
|
||||
|
||||
|
||||
2013 11
|
||||
-------
|
||||
|
||||
Goodies:
|
||||
|
||||
* Better optimizations: CSE; `A+(-B) => A-B`; `!A || !B => !(A && B)`.
|
||||
* Merged with upstream Mesa.
|
||||
|
||||
Fixes:
|
||||
|
||||
* Fixed location qualifiers, ES3.0 version printing, samplerCubeShadow sampling operations.
|
||||
|
||||
|
||||
2013 10
|
||||
-------
|
||||
|
||||
Goodies:
|
||||
|
||||
* Initial OpenGL ES 3.0 support
|
||||
* API to query shader input names; glslopt_shader_get_input_count and glslopt_shader_get_input_name
|
||||
|
||||
Changes:
|
||||
|
||||
* Xcode project files updated to Xcode 5
|
||||
|
||||
Fixes:
|
||||
|
||||
* VS2013 fixes
|
102
3rdparty/bgfx/3rdparty/glsl-optimizer/README.md
vendored
102
3rdparty/bgfx/3rdparty/glsl-optimizer/README.md
vendored
@ -1,102 +0,0 @@
|
||||
GLSL optimizer
|
||||
==============
|
||||
|
||||
A C++ library that takes GLSL shaders, does some GPU-independent optimizations on them
|
||||
and outputs GLSL or Metal source back. Optimizations are function inlining, dead code removal, copy propagation,
|
||||
constant folding, constant propagation, arithmetic optimizations and so on.
|
||||
|
||||
Apparently quite a few mobile platforms are pretty bad at optimizing shaders; and
|
||||
unfortunately they *also* lack offline shader compilers. So using a GLSL optimizer offline
|
||||
before can make the shader run much faster on a platform like that. See performance numbers
|
||||
in [this blog post](http://aras-p.info/blog/2010/09/29/glsl-optimizer/).
|
||||
|
||||
Even for drivers that have decent shader optimization, GLSL optimizer could be useful to just strip away
|
||||
dead code, make shaders smaller and do uniform/input reflection offline.
|
||||
|
||||
Almost all actual code is [Mesa 3D's GLSL](http://cgit.freedesktop.org/mesa/mesa/log/)
|
||||
compiler; all this library does is spits out optimized GLSL or Metal back, and adds GLES type precision
|
||||
handling to the optimizer.
|
||||
|
||||
This GLSL optimizer is made for [Unity's](http://unity3d.com/) purposes and is built-in
|
||||
starting with Unity 3.0.
|
||||
|
||||
GLSL Optimizer is licensed according to the terms of the MIT license.
|
||||
|
||||
See [change log here](Changelog.md).
|
||||
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Visual Studio 2010 (Windows, x86/x64) and Xcode 5+ (Mac, i386) project files for a static
|
||||
library are provided in `projects/vs2010/glsl_optimizer.sln` and `projects/xcode5/glsl_optimizer_lib`
|
||||
respectively.
|
||||
|
||||
> Note: only the VS and Xcode project files are maintained and should work at any time.
|
||||
> There's also a cmake and gyp build system for Linux et al., and some stuff in contrib folder -
|
||||
> all that may or might not work.
|
||||
|
||||
For Linux you can use cmake. Just type "cmake . && make" in the root directory.
|
||||
This will build the optimizer library and some executable binaries.
|
||||
|
||||
Interface for the library is `src/glsl/glsl_optimizer.h`. General usage is:
|
||||
|
||||
ctx = glslopt_initialize(targetVersion);
|
||||
for (lots of shaders) {
|
||||
shader = glslopt_optimize (ctx, shaderType, shaderSource, options);
|
||||
if (glslopt_get_status (shader)) {
|
||||
newSource = glslopt_get_output (shader);
|
||||
} else {
|
||||
errorLog = glslopt_get_log (shader);
|
||||
}
|
||||
glslopt_shader_delete (shader);
|
||||
}
|
||||
glslopt_cleanup (ctx);
|
||||
|
||||
|
||||
Tests
|
||||
-----
|
||||
|
||||
There's a testing suite for catching regressions, see `tests` folder. In VS, build
|
||||
and run `glsl_optimizer_tests` project; in Xcode use `projects/xcode5/glsl_optimizer_tests`
|
||||
project. The test executable requires path to the `tests` folder as an argument.
|
||||
|
||||
Each test comes as three text files; input, expected IR dump and expected optimized
|
||||
GLSL dump. GLES3 tests are also converted into Metal.
|
||||
|
||||
If you're making changes to the project and want pull requests accepted easier, I'd
|
||||
appreciate if there would be no test suite regressions. If you are implementing a
|
||||
feature, it would be cool to add tests to cover it as well!
|
||||
|
||||
|
||||
Notes
|
||||
-----
|
||||
|
||||
* GLSL versions 1.10 and 1.20 are supported. 1.10 is the default, use #version 120 to specify
|
||||
1.20. Higher GLSL versions might work, but aren't tested now.
|
||||
* GLSL ES versions 1.00 and 3.00 are supported.
|
||||
|
||||
Status and Future
|
||||
-----------------
|
||||
|
||||
**Note**: As of mid-2016, the project is unlikely to have any significant developments. At Unity we are largely moving to a different
|
||||
shader compilation pipeline, with glsl-optimizer mostly not used. So from my side there won't be significant work done on it :(
|
||||
|
||||
|
||||
Dev Notes
|
||||
---------
|
||||
|
||||
Pulling Mesa upstream:
|
||||
|
||||
git fetch upstream
|
||||
git merge upstream/master
|
||||
sh removeDeletedByUs.sh
|
||||
# inspect files, git rm unneeded ones, fix conflicts etc.
|
||||
# git commit
|
||||
|
||||
Rebuilding flex/bison parsers:
|
||||
|
||||
* When .y/.l files are changed, the parsers are *not* rebuilt automatically,
|
||||
* Run ./generateParsers.sh to do that. You'll need bison & flex (on Mac, do "Install Command Line Tools" from Xcode)
|
||||
* I use bison 2.3 and flex 2.5.35 (in OS X 10.8/10.9)
|
||||
|
14
3rdparty/bgfx/3rdparty/glsl-optimizer/autogen.sh
vendored
14
3rdparty/bgfx/3rdparty/glsl-optimizer/autogen.sh
vendored
@ -1,14 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
srcdir=`dirname "$0"`
|
||||
test -z "$srcdir" && srcdir=.
|
||||
|
||||
ORIGDIR=`pwd`
|
||||
cd "$srcdir"
|
||||
|
||||
autoreconf -v --install || exit 1
|
||||
cd $ORIGDIR || exit $?
|
||||
|
||||
if test -z "$NOCONFIGURE"; then
|
||||
"$srcdir"/configure "$@"
|
||||
fi
|
@ -1,28 +0,0 @@
|
||||
{
|
||||
'includes': [
|
||||
'target_defaults.gypi',
|
||||
],
|
||||
'targets': [
|
||||
{
|
||||
"include_dirs" : [
|
||||
"<!(node -e \"require('nan')\")"
|
||||
],
|
||||
'target_name': 'glslOptimizer',
|
||||
'dependencies': [
|
||||
'src/glsl_optimizer_lib.gyp:*',
|
||||
],
|
||||
'sources': [
|
||||
'src/node/binding.cpp',
|
||||
'src/node/shader.h',
|
||||
'src/node/shader.cpp',
|
||||
'src/node/compiler.h',
|
||||
'src/node/compiler.cpp'
|
||||
],
|
||||
'conditions': [
|
||||
['OS=="win"', {
|
||||
'msvs_disabled_warnings': [4506],
|
||||
}],
|
||||
],
|
||||
}
|
||||
]
|
||||
}
|
@ -1,159 +0,0 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "glsl_optimizer.h"
|
||||
|
||||
static glslopt_ctx* gContext = 0;
|
||||
|
||||
static int printhelp(const char* msg)
|
||||
{
|
||||
if (msg) printf("%s\n\n\n", msg);
|
||||
printf("Usage: glslopt <-f|-v> <input shader> [<output shader>]\n");
|
||||
printf("\t-f : fragment shader (default)\n");
|
||||
printf("\t-v : vertex shader\n");
|
||||
printf("\t-1 : target OpenGL (default)\n");
|
||||
printf("\t-2 : target OpenGL ES 2.0\n");
|
||||
printf("\t-3 : target OpenGL ES 3.0\n");
|
||||
printf("\n\tIf no output specified, output is to [input].out.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
static bool init(glslopt_target target)
|
||||
{
|
||||
gContext = glslopt_initialize(target);
|
||||
if( !gContext )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void term()
|
||||
{
|
||||
glslopt_cleanup(gContext);
|
||||
}
|
||||
|
||||
static char* loadFile(const char* filename)
|
||||
{
|
||||
FILE* file = fopen(filename, "rt");
|
||||
if( !file )
|
||||
{
|
||||
printf("Failed to open %s for reading\n", filename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
fseek(file, 0, SEEK_END);
|
||||
const int size = ftell(file);
|
||||
fseek(file, 0, SEEK_SET);
|
||||
|
||||
char* result = new char[size+1];
|
||||
const int count = (int)fread(result, 1, size, file);
|
||||
result[count] = 0;
|
||||
|
||||
fclose(file);
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool saveFile(const char* filename, const char* data)
|
||||
{
|
||||
int size = (int)strlen(data);
|
||||
|
||||
FILE* file = fopen(filename, "wt");
|
||||
if( !file )
|
||||
{
|
||||
printf( "Failed to open %s for writing\n", filename);
|
||||
return false;
|
||||
}
|
||||
|
||||
if( 1 != fwrite(data,size,1,file) )
|
||||
{
|
||||
printf( "Failed to write to %s\n", filename);
|
||||
fclose(file);
|
||||
return false;
|
||||
}
|
||||
|
||||
fclose(file);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool compileShader(const char* dstfilename, const char* srcfilename, bool vertexShader)
|
||||
{
|
||||
const char* originalShader = loadFile(srcfilename);
|
||||
if( !originalShader )
|
||||
return false;
|
||||
|
||||
const glslopt_shader_type type = vertexShader ? kGlslOptShaderVertex : kGlslOptShaderFragment;
|
||||
|
||||
glslopt_shader* shader = glslopt_optimize(gContext, type, originalShader, 0);
|
||||
if( !glslopt_get_status(shader) )
|
||||
{
|
||||
printf( "Failed to compile %s:\n\n%s\n", srcfilename, glslopt_get_log(shader));
|
||||
return false;
|
||||
}
|
||||
|
||||
const char* optimizedShader = glslopt_get_output(shader);
|
||||
|
||||
if( !saveFile(dstfilename, optimizedShader) )
|
||||
return false;
|
||||
|
||||
delete[] originalShader;
|
||||
return true;
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
if( argc < 3 )
|
||||
return printhelp(NULL);
|
||||
|
||||
bool vertexShader = false, freename = false;
|
||||
glslopt_target languageTarget = kGlslTargetOpenGL;
|
||||
const char* source = 0;
|
||||
char* dest = 0;
|
||||
|
||||
for( int i=1; i < argc; i++ )
|
||||
{
|
||||
if( argv[i][0] == '-' )
|
||||
{
|
||||
if( 0 == strcmp("-v", argv[i]) )
|
||||
vertexShader = true;
|
||||
else if( 0 == strcmp("-f", argv[i]) )
|
||||
vertexShader = false;
|
||||
else if( 0 == strcmp("-1", argv[i]) )
|
||||
languageTarget = kGlslTargetOpenGL;
|
||||
else if( 0 == strcmp("-2", argv[i]) )
|
||||
languageTarget = kGlslTargetOpenGLES20;
|
||||
else if( 0 == strcmp("-3", argv[i]) )
|
||||
languageTarget = kGlslTargetOpenGLES30;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( source == 0 )
|
||||
source = argv[i];
|
||||
else if( dest == 0 )
|
||||
dest = argv[i];
|
||||
}
|
||||
}
|
||||
|
||||
if( !source )
|
||||
return printhelp("Must give a source");
|
||||
|
||||
if( !init(languageTarget) )
|
||||
{
|
||||
printf("Failed to initialize glslopt!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( !dest ) {
|
||||
dest = (char *) calloc(strlen(source)+5, sizeof(char));
|
||||
snprintf(dest, strlen(source)+5, "%s.out", source);
|
||||
freename = true;
|
||||
}
|
||||
|
||||
int result = 0;
|
||||
if( !compileShader(dest, source, vertexShader) )
|
||||
result = 1;
|
||||
|
||||
if( freename ) free(dest);
|
||||
|
||||
term();
|
||||
return result;
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
# Linux build for the sample app
|
||||
|
||||
OBJS = Main.o
|
||||
|
||||
.PHONY: clean all
|
||||
|
||||
LDFLAGS += -Wl,-O1 -Wl,-gc-sections
|
||||
CPPFLAGS += -I ../../src/glsl -L ../../src/glsl
|
||||
CXXFLAGS += -Wall -Os -s
|
||||
|
||||
all: $(OBJS)
|
||||
g++ -o glslopt Main.o $(CPPFLAGS) -lglslopt $(CXXFLAGS) $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
rm -f glslopt $(OBJS)
|
||||
|
@ -1,13 +0,0 @@
|
||||
This is a small sample program to get you quickly up and running, it transforms an input textfile
|
||||
to an output textfile. The input source textfile should be a fully preprocessed GLSL shader and
|
||||
the output should be a simple shader in textform.
|
||||
|
||||
The project file is generated by BadgerConfig.
|
||||
|
||||
VS2005
|
||||
BadgerConfig
|
||||
|
||||
|
||||
|
||||
|
||||
Jim Tilander, Santa Monica 2010
|
@ -1,105 +0,0 @@
|
||||
#
|
||||
# Console files...
|
||||
#
|
||||
Main.cpp
|
||||
Readme
|
||||
|
||||
#
|
||||
# Original test program ..
|
||||
#
|
||||
#../../src/glsl/glsl_optimizer_main.cpp
|
||||
|
||||
|
||||
#
|
||||
# Mesa GLSL2 + GLSL Optimizer
|
||||
#
|
||||
|
||||
../../src/mesa/program/hash_table.c
|
||||
../../src/mesa/program/hash_table.h
|
||||
../../src/mesa/program/symbol_table.c
|
||||
../../src/mesa/program/symbol_table.h
|
||||
../../src/talloc/talloc.c
|
||||
../../src/talloc/talloc.h
|
||||
../../src/glsl/ast.h
|
||||
../../src/glsl/ast_expr.cpp
|
||||
../../src/glsl/ast_function.cpp
|
||||
../../src/glsl/ast_to_hir.cpp
|
||||
../../src/glsl/ast_type.cpp
|
||||
../../src/glsl/builtin_function.cpp
|
||||
../../src/glsl/builtin_types.h
|
||||
../../src/glsl/builtin_variables.h
|
||||
../../src/glsl/glsl_lexer.cpp
|
||||
../../src/glsl/glsl_lexer.lpp
|
||||
../../src/glsl/glsl_optimizer.cpp
|
||||
../../src/glsl/glsl_optimizer.h
|
||||
../../src/glsl/glsl_parser.cpp
|
||||
../../src/glsl/glsl_parser.h
|
||||
../../src/glsl/glsl_parser.ypp
|
||||
../../src/glsl/glsl_parser_extras.cpp
|
||||
../../src/glsl/glsl_parser_extras.h
|
||||
../../src/glsl/glsl_symbol_table.h
|
||||
../../src/glsl/glsl_types.cpp
|
||||
../../src/glsl/glsl_types.h
|
||||
../../src/glsl/hir_field_selection.cpp
|
||||
../../src/glsl/ir.cpp
|
||||
../../src/glsl/ir.h
|
||||
../../src/glsl/ir_algebraic.cpp
|
||||
../../src/glsl/ir_basic_block.cpp
|
||||
../../src/glsl/ir_basic_block.h
|
||||
../../src/glsl/ir_clone.cpp
|
||||
../../src/glsl/ir_constant_expression.cpp
|
||||
../../src/glsl/ir_constant_folding.cpp
|
||||
../../src/glsl/ir_constant_propagation.cpp
|
||||
../../src/glsl/ir_constant_variable.cpp
|
||||
../../src/glsl/ir_copy_propagation.cpp
|
||||
../../src/glsl/ir_dead_code.cpp
|
||||
../../src/glsl/ir_dead_code_local.cpp
|
||||
../../src/glsl/ir_dead_functions.cpp
|
||||
../../src/glsl/ir_div_to_mul_rcp.cpp
|
||||
../../src/glsl/ir_expression_flattening.cpp
|
||||
../../src/glsl/ir_expression_flattening.h
|
||||
../../src/glsl/ir_function.cpp
|
||||
../../src/glsl/ir_function_can_inline.cpp
|
||||
../../src/glsl/ir_function_inlining.cpp
|
||||
../../src/glsl/ir_function_inlining.h
|
||||
../../src/glsl/ir_hierarchical_visitor.cpp
|
||||
../../src/glsl/ir_hierarchical_visitor.h
|
||||
../../src/glsl/ir_hv_accept.cpp
|
||||
../../src/glsl/ir_if_return.cpp
|
||||
../../src/glsl/ir_if_simplification.cpp
|
||||
../../src/glsl/ir_if_to_cond_assign.cpp
|
||||
../../src/glsl/ir_import_prototypes.cpp
|
||||
../../src/glsl/ir_mat_op_to_vec.cpp
|
||||
../../src/glsl/ir_mod_to_fract.cpp
|
||||
../../src/glsl/ir_noop_swizzle.cpp
|
||||
../../src/glsl/ir_optimization.h
|
||||
../../src/glsl/ir_print_glsl_visitor.cpp
|
||||
../../src/glsl/ir_print_glsl_visitor.h
|
||||
../../src/glsl/ir_print_visitor.cpp
|
||||
../../src/glsl/ir_print_visitor.h
|
||||
../../src/glsl/ir_reader.cpp
|
||||
../../src/glsl/ir_reader.h
|
||||
../../src/glsl/ir_rvalue_visitor.cpp
|
||||
../../src/glsl/ir_rvalue_visitor.h
|
||||
../../src/glsl/ir_structure_splitting.cpp
|
||||
../../src/glsl/ir_sub_to_add_neg.cpp
|
||||
../../src/glsl/ir_swizzle_swizzle.cpp
|
||||
../../src/glsl/ir_tree_grafting.cpp
|
||||
../../src/glsl/ir_unused_structs.cpp
|
||||
../../src/glsl/ir_unused_structs.h
|
||||
../../src/glsl/ir_validate.cpp
|
||||
../../src/glsl/ir_variable.cpp
|
||||
../../src/glsl/ir_variable_refcount.cpp
|
||||
../../src/glsl/ir_variable_refcount.h
|
||||
../../src/glsl/ir_vec_index_to_cond_assign.cpp
|
||||
../../src/glsl/ir_vec_index_to_swizzle.cpp
|
||||
../../src/glsl/ir_visitor.h
|
||||
../../src/glsl/link_functions.cpp
|
||||
../../src/glsl/linker.cpp
|
||||
../../src/glsl/linker.h
|
||||
../../src/glsl/list.h
|
||||
#../../src/glsl/main.cpp
|
||||
../../src/glsl/program.h
|
||||
../../src/glsl/s_expression.cpp
|
||||
../../src/glsl/s_expression.h
|
||||
../../src/glsl/msvc/msvccompat.h
|
@ -1,10 +0,0 @@
|
||||
[General]
|
||||
Type = ConsoleApplication
|
||||
SourceFiles = SourceFiles
|
||||
Platform = Tool
|
||||
|
||||
[Project]
|
||||
IncludePaths=../../src/talloc;../../include;../../src/mesa;../../src/mapi;../../src/glsl/msvc;../../src/glsl
|
||||
Defines=snprintf=_snprintf;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE
|
||||
DisabledVcWarnings=4291;4996;4800;4099;4244;4018;4245
|
||||
Libraries=opengl32.lib
|
@ -1,26 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glslopt", "glslopt.vcproj", "{790F4C89-6715-EB39-C392-3FC1D1DB9618}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Final|Win32 = Final|Win32
|
||||
Profile|Win32 = Profile|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{790F4C89-6715-EB39-C392-3FC1D1DB9618}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{790F4C89-6715-EB39-C392-3FC1D1DB9618}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{790F4C89-6715-EB39-C392-3FC1D1DB9618}.Final|Win32.ActiveCfg = Final|Win32
|
||||
{790F4C89-6715-EB39-C392-3FC1D1DB9618}.Final|Win32.Build.0 = Final|Win32
|
||||
{790F4C89-6715-EB39-C392-3FC1D1DB9618}.Profile|Win32.ActiveCfg = Profile|Win32
|
||||
{790F4C89-6715-EB39-C392-3FC1D1DB9618}.Profile|Win32.Build.0 = Profile|Win32
|
||||
{790F4C89-6715-EB39-C392-3FC1D1DB9618}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{790F4C89-6715-EB39-C392-3FC1D1DB9618}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
@ -1,897 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="glslopt"
|
||||
ProjectGUID="{790F4C89-6715-EB39-C392-3FC1D1DB9618}"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(ProjectDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="0"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalOptions=""
|
||||
AdditionalIncludeDirectories=";../../src/talloc;../../include;../../src/mesa;../../src/mapi;../../src/glsl/msvc;../../src/glsl;../../../../../Shared;../../../../../Tools/Shared;../../../freetype-2.1.10/include;../../../Lua/include;../../../FreeImage;../../../../Include;../../.."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;snprintf=_snprintf;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;AURORA_TOOL;AURORA_DEBUGG"
|
||||
StringPooling="false"
|
||||
MinimalRebuild="false"
|
||||
ExceptionHandling="2"
|
||||
BasicRuntimeChecks="3"
|
||||
SmallerTypeCheck="true"
|
||||
RuntimeLibrary="3"
|
||||
StructMemberAlignment="3"
|
||||
BufferSecurityCheck="true"
|
||||
EnableFunctionLevelLinking="true"
|
||||
EnableEnhancedInstructionSet="0"
|
||||
FloatingPointExceptions="false"
|
||||
DisableLanguageExtensions="false"
|
||||
DefaultCharIsUnsigned="true"
|
||||
TreatWChar_tAsBuiltInType="true"
|
||||
ForceConformanceInForLoopScope="true"
|
||||
RuntimeTypeInfo="true"
|
||||
OpenMP="false"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderThrough="PreCompiled.h"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
CallingConvention="0"
|
||||
CompileAs="0"
|
||||
DisableSpecificWarnings="4512;4127;4996;4291;4291;4996;4800;4099;4244;4018;4245"
|
||||
UseFullPaths="false"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkLibraryDependencies="true"
|
||||
UseLibraryDependencyInputs="true"
|
||||
AdditionalDependencies="opengl32.lib "
|
||||
ShowProgress="0"
|
||||
OutputFile="$(OutDir)\$(ProjectName).exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="../../../freetype-2.1.10/lib;../../../Lua/lib;../../../FreeImage;../../../../Lib "
|
||||
GenerateManifest="true"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="true"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(TargetDir)$(TargetName).map"
|
||||
MapExports="false"
|
||||
SubSystem="1"
|
||||
StackReserveSize="8388608"
|
||||
StackCommitSize="8388608"
|
||||
LargeAddressAware="2"
|
||||
TargetMachine="1"
|
||||
AllowIsolation="true"
|
||||
Profile="false"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description=""
|
||||
CommandLine=""
|
||||
ExcludedFromBuild="false"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(ProjectDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
UseOfMFC="0"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
AdditionalOptions=""
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="false"
|
||||
WholeProgramOptimization="false"
|
||||
AdditionalIncludeDirectories=";../../src/talloc;../../include;../../src/mesa;../../src/mapi;../../src/glsl/msvc;../../src/glsl;../../../../../Shared;../../../../../Tools/Shared;../../../freetype-2.1.10/include;../../../Lua/include;../../../FreeImage;../../../../Include;../../.."
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;snprintf=_snprintf;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;AURORA_TOOL;AURORA_RELEASE"
|
||||
StringPooling="false"
|
||||
MinimalRebuild="false"
|
||||
ExceptionHandling="2"
|
||||
BasicRuntimeChecks="0"
|
||||
SmallerTypeCheck="false"
|
||||
RuntimeLibrary="2"
|
||||
StructMemberAlignment="3"
|
||||
BufferSecurityCheck="false"
|
||||
EnableFunctionLevelLinking="true"
|
||||
EnableEnhancedInstructionSet="2"
|
||||
FloatingPointExceptions="false"
|
||||
DisableLanguageExtensions="false"
|
||||
DefaultCharIsUnsigned="true"
|
||||
TreatWChar_tAsBuiltInType="true"
|
||||
ForceConformanceInForLoopScope="true"
|
||||
RuntimeTypeInfo="true"
|
||||
OpenMP="false"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderThrough="PreCompiled.h"
|
||||
AssemblerOutput="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
CallingConvention="0"
|
||||
CompileAs="0"
|
||||
DisableSpecificWarnings="4512;4127;4996;4291;4291;4996;4800;4099;4244;4018;4245"
|
||||
UseFullPaths="false"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkLibraryDependencies="true"
|
||||
UseLibraryDependencyInputs="true"
|
||||
AdditionalDependencies="opengl32.lib "
|
||||
ShowProgress="0"
|
||||
OutputFile="$(OutDir)\$(ProjectName).exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="../../../freetype-2.1.10/lib;../../../Lua/lib;../../../FreeImage;../../../../Lib "
|
||||
GenerateManifest="true"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="true"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(TargetDir)$(TargetName).map"
|
||||
MapExports="false"
|
||||
SubSystem="1"
|
||||
StackReserveSize="8388608"
|
||||
StackCommitSize="8388608"
|
||||
LargeAddressAware="2"
|
||||
TargetMachine="1"
|
||||
AllowIsolation="true"
|
||||
Profile="false"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description=""
|
||||
CommandLine=""
|
||||
ExcludedFromBuild="false"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Profile|Win32"
|
||||
OutputDirectory="$(ProjectDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
UseOfMFC="0"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
AdditionalOptions=""
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="false"
|
||||
WholeProgramOptimization="false"
|
||||
AdditionalIncludeDirectories=";../../src/talloc;../../include;../../src/mesa;../../src/mapi;../../src/glsl/msvc;../../src/glsl;../../../../../Shared;../../../../../Tools/Shared;../../../freetype-2.1.10/include;../../../Lua/include;../../../FreeImage;../../../../Include;../../.."
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;snprintf=_snprintf;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;AURORA_TOOL;AURORA_PROFILE"
|
||||
StringPooling="false"
|
||||
MinimalRebuild="false"
|
||||
ExceptionHandling="2"
|
||||
BasicRuntimeChecks="0"
|
||||
SmallerTypeCheck="false"
|
||||
RuntimeLibrary="2"
|
||||
StructMemberAlignment="3"
|
||||
BufferSecurityCheck="false"
|
||||
EnableFunctionLevelLinking="false"
|
||||
EnableEnhancedInstructionSet="2"
|
||||
FloatingPointExceptions="false"
|
||||
DisableLanguageExtensions="false"
|
||||
DefaultCharIsUnsigned="true"
|
||||
TreatWChar_tAsBuiltInType="true"
|
||||
ForceConformanceInForLoopScope="true"
|
||||
RuntimeTypeInfo="true"
|
||||
OpenMP="false"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderThrough="PreCompiled.h"
|
||||
AssemblerOutput="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
CallingConvention="0"
|
||||
CompileAs="0"
|
||||
DisableSpecificWarnings="4512;4127;4996;4291;4291;4996;4800;4099;4244;4018;4245"
|
||||
UseFullPaths="false"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkLibraryDependencies="true"
|
||||
UseLibraryDependencyInputs="false"
|
||||
AdditionalDependencies="opengl32.lib "
|
||||
ShowProgress="0"
|
||||
OutputFile="$(OutDir)\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="../../../freetype-2.1.10/lib;../../../Lua/lib;../../../FreeImage;../../../../Lib "
|
||||
GenerateManifest="true"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="true"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(TargetDir)$(TargetName).map"
|
||||
MapExports="false"
|
||||
SubSystem="1"
|
||||
StackReserveSize="8388608"
|
||||
StackCommitSize="8388608"
|
||||
LargeAddressAware="2"
|
||||
TargetMachine="1"
|
||||
AllowIsolation="true"
|
||||
Profile="false"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description=""
|
||||
CommandLine=""
|
||||
ExcludedFromBuild="false"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Final|Win32"
|
||||
OutputDirectory="$(ProjectDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
UseOfMFC="0"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
AdditionalOptions=""
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="2"
|
||||
OmitFramePointers="false"
|
||||
WholeProgramOptimization="true"
|
||||
AdditionalIncludeDirectories=";../../src/talloc;../../include;../../src/mesa;../../src/mapi;../../src/glsl/msvc;../../src/glsl;../../../../../Shared;../../../../../Tools/Shared;../../../freetype-2.1.10/include;../../../Lua/include;../../../FreeImage;../../../../Include;../../.."
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;snprintf=_snprintf;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;AURORA_TOOL;AURORA_FINAL;AURORA_RETAIL"
|
||||
StringPooling="false"
|
||||
MinimalRebuild="false"
|
||||
ExceptionHandling="2"
|
||||
BasicRuntimeChecks="0"
|
||||
SmallerTypeCheck="false"
|
||||
RuntimeLibrary="2"
|
||||
StructMemberAlignment="3"
|
||||
BufferSecurityCheck="false"
|
||||
EnableFunctionLevelLinking="false"
|
||||
EnableEnhancedInstructionSet="2"
|
||||
FloatingPointExceptions="false"
|
||||
DisableLanguageExtensions="false"
|
||||
DefaultCharIsUnsigned="true"
|
||||
TreatWChar_tAsBuiltInType="true"
|
||||
ForceConformanceInForLoopScope="true"
|
||||
RuntimeTypeInfo="true"
|
||||
OpenMP="false"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderThrough="PreCompiled.h"
|
||||
AssemblerOutput="0"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
CallingConvention="0"
|
||||
CompileAs="0"
|
||||
DisableSpecificWarnings="4512;4127;4996;4291;4291;4996;4800;4099;4244;4018;4245"
|
||||
UseFullPaths="false"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkLibraryDependencies="true"
|
||||
UseLibraryDependencyInputs="false"
|
||||
AdditionalDependencies="opengl32.lib "
|
||||
ShowProgress="0"
|
||||
OutputFile="$(OutDir)\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="../../../freetype-2.1.10/lib;../../../Lua/lib;../../../FreeImage;../../../../Lib "
|
||||
GenerateManifest="true"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="true"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(TargetDir)$(TargetName).map"
|
||||
MapExports="false"
|
||||
SubSystem="1"
|
||||
StackReserveSize="8388608"
|
||||
StackCommitSize="8388608"
|
||||
LargeAddressAware="2"
|
||||
TargetMachine="1"
|
||||
AllowIsolation="true"
|
||||
Profile="false"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description=""
|
||||
CommandLine=""
|
||||
ExcludedFromBuild="false"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="Main.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Readme"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="src"
|
||||
>
|
||||
<Filter
|
||||
Name="mesa"
|
||||
>
|
||||
<Filter
|
||||
Name="program"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\src\mesa\program\hash_table.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\mesa\program\hash_table.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\mesa\program\symbol_table.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\mesa\program\symbol_table.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="talloc"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\src\talloc\talloc.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\talloc\talloc.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="glsl"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ast.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ast_expr.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ast_function.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ast_to_hir.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ast_type.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\builtin_function.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\builtin_types.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\builtin_variables.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\glsl_lexer.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\glsl_lexer.lpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\glsl_optimizer.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\glsl_optimizer.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\glsl_parser.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\glsl_parser.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\glsl_parser.ypp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\glsl_parser_extras.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\glsl_parser_extras.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\glsl_symbol_table.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\glsl_types.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\glsl_types.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\hir_field_selection.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_algebraic.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_basic_block.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_basic_block.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_clone.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_constant_expression.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_constant_folding.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_constant_propagation.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_constant_variable.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_copy_propagation.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_dead_code.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_dead_code_local.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_dead_functions.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_div_to_mul_rcp.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_expression_flattening.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_expression_flattening.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_function.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_function_can_inline.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_function_inlining.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_function_inlining.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_hierarchical_visitor.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_hierarchical_visitor.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_hv_accept.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_if_return.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_if_simplification.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_if_to_cond_assign.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_import_prototypes.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_mat_op_to_vec.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_mod_to_fract.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_noop_swizzle.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_optimization.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_print_glsl_visitor.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_print_glsl_visitor.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_print_visitor.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_print_visitor.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_reader.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_reader.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_rvalue_visitor.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_rvalue_visitor.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_structure_splitting.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_sub_to_add_neg.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_swizzle_swizzle.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_tree_grafting.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_unused_structs.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_unused_structs.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_validate.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_variable.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_variable_refcount.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_variable_refcount.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_vec_index_to_cond_assign.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_vec_index_to_swizzle.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\ir_visitor.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\link_functions.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\linker.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\linker.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\list.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\program.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\s_expression.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\s_expression.h"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="msvc"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\src\glsl\msvc\msvccompat.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user