mirror of
https://github.com/holub/mame
synced 2025-10-04 08:28:39 +03:00
commit
a026a582f1
1
.gitignore
vendored
1
.gitignore
vendored
@ -26,6 +26,7 @@
|
||||
!/makefile
|
||||
!/mame.doxygen
|
||||
!/*.md
|
||||
!/LICENSE
|
||||
/.idea
|
||||
regtests/chdman/temp
|
||||
regtests/jedutil/output
|
||||
|
55
3rdparty/README.md
vendored
Normal file
55
3rdparty/README.md
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
# **3rdparty** #
|
||||
|
||||
benchmark - [Apache License, Version 2.0](http://opensource.org/licenses/Apache-2.0) (used only for testing, not part of distribution)
|
||||
|
||||
bgfx - [The BSD 2-Clause License](http://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
bx - [The BSD 2-Clause License](http://opensource.org/licenses/BSD-2-Clause)
|
||||
|
||||
compat - Wine headers missing in MinGW [The GNU Lesser General Public License, version 2.1 (LGPL-2.1)](http://opensource.org/licenses/LGPL-2.1)
|
||||
|
||||
**note that this one contain headers only and that real library/dll is dynamically loaded so use in commercial project is allowed, will be removed when becomes part of MinGW distribution**
|
||||
|
||||
dxsdk - [DirectX SDK EULA](https://github.com/mamedev/mame/blob/master/3rdparty/dxsdk/Documentation/License%20Agreements/DirectX%20SDK%20EULA.txt)
|
||||
|
||||
expat - [The MIT License (MIT)](http://opensource.org/licenses/MIT)
|
||||
|
||||
genie - [The BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause)
|
||||
|
||||
googletest - [The BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause)
|
||||
|
||||
http-parser - [The MIT License (MIT)](http://opensource.org/licenses/MIT)
|
||||
|
||||
libflac - [The BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause)
|
||||
|
||||
libjpeg - [Custom BSD-like](https://github.com/numenta/nupic/blob/master/external/licenses/LICENSE.libjpeg-6b.txt)
|
||||
|
||||
libuv - [Node License (BSD-like)](https://github.com/mamedev/mame/blob/master/3rdparty/libuv/LICENSE)
|
||||
|
||||
lsqlite3 - [The MIT License (MIT)](http://opensource.org/licenses/MIT)
|
||||
|
||||
lua - [The MIT License (MIT)](http://opensource.org/licenses/MIT)
|
||||
|
||||
lua-zlib - [The MIT License (MIT)](http://opensource.org/licenses/MIT)
|
||||
|
||||
luabridge - [The MIT License (MIT)](http://opensource.org/licenses/MIT)
|
||||
|
||||
luafilesystem - [The MIT License (MIT)](http://opensource.org/licenses/MIT)
|
||||
|
||||
lzma - [The GNU Lesser General Public License](http://opensource.org/licenses/LGPL-2.1)
|
||||
|
||||
portaudio - [The MIT License (MIT)](http://opensource.org/licenses/MIT) explanation at [their site](http://www.portaudio.com/license.html)
|
||||
|
||||
portmidi - [The MIT License (MIT)](http://opensource.org/licenses/MIT)
|
||||
|
||||
rapidjson - [The BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause)
|
||||
|
||||
sdl2 - [zlib license](http://opensource.org/licenses/Zlib)
|
||||
|
||||
softfloat - [U.C. Berkeley open-source license](https://github.com/mamedev/mame/blob/master/3rdparty/softfloat/README.txt) MIT compatible
|
||||
|
||||
sqlite3 - Public Domain
|
||||
|
||||
winpcap - [The BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause)
|
||||
|
||||
zlib - [zlib license](http://opensource.org/licenses/Zlib)
|
138
3rdparty/benchmark/CMakeLists.txt
vendored
138
3rdparty/benchmark/CMakeLists.txt
vendored
@ -1,6 +1,14 @@
|
||||
cmake_minimum_required (VERSION 2.8.11)
|
||||
project (benchmark)
|
||||
|
||||
foreach(p
|
||||
CMP0054 # CMake 3.1
|
||||
)
|
||||
if(POLICY ${p})
|
||||
cmake_policy(SET ${p} NEW)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
option(BENCHMARK_ENABLE_TESTING "Enable testing of the benchmark library." ON)
|
||||
option(BENCHMARK_ENABLE_LTO "Enable link time optimisation of the benchmark library." OFF)
|
||||
# Make sure we can import out CMake functions
|
||||
@ -23,73 +31,83 @@ include(CheckCXXCompilerFlag)
|
||||
include(AddCXXCompilerFlag)
|
||||
include(CXXFeatureCheck)
|
||||
|
||||
# Try and enable C++11. Don't use C++14 because it doesn't work in some
|
||||
# configurations.
|
||||
add_cxx_compiler_flag(-std=c++11)
|
||||
if (NOT HAVE_CXX_FLAG_STD_CXX11)
|
||||
add_cxx_compiler_flag(-std=c++0x)
|
||||
endif()
|
||||
|
||||
# Turn compiler warnings up to 11
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
# Turn compiler warnings up to 11
|
||||
add_cxx_compiler_flag(-W4)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
else()
|
||||
add_cxx_compiler_flag(-Wall)
|
||||
endif()
|
||||
add_cxx_compiler_flag(-Wextra)
|
||||
add_cxx_compiler_flag(-Wshadow)
|
||||
add_cxx_compiler_flag(-Werror RELEASE)
|
||||
add_cxx_compiler_flag(-pedantic)
|
||||
add_cxx_compiler_flag(-pedantic-errors)
|
||||
add_cxx_compiler_flag(-Wshorten-64-to-32)
|
||||
add_cxx_compiler_flag(-Wfloat-equal)
|
||||
add_cxx_compiler_flag(-Wzero-as-null-pointer-constant)
|
||||
add_cxx_compiler_flag(-fstrict-aliasing)
|
||||
if (HAVE_CXX_FLAG_FSTRICT_ALIASING)
|
||||
add_cxx_compiler_flag(-Wstrict-aliasing)
|
||||
endif()
|
||||
add_cxx_compiler_flag(-Wthread-safety)
|
||||
if (HAVE_WTHREAD_SAFETY)
|
||||
add_definitions(-DHAVE_WTHREAD_SAFETY)
|
||||
cxx_feature_check(THREAD_SAFETY_ATTRIBUTES)
|
||||
endif()
|
||||
|
||||
# Link time optimisation
|
||||
if (BENCHMARK_ENABLE_LTO)
|
||||
add_cxx_compiler_flag(-flto)
|
||||
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
|
||||
find_program(GCC_AR gcc-ar)
|
||||
if (GCC_AR)
|
||||
set(CMAKE_AR ${GCC_AR})
|
||||
endif()
|
||||
find_program(GCC_RANLIB gcc-ranlib)
|
||||
if (GCC_RANLIB)
|
||||
set(CMAKE_RANLIB ${GCC_RANLIB})
|
||||
# Link time optimisation
|
||||
if (BENCHMARK_ENABLE_LTO)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "/GL")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/LTCG")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "/LTCG")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/LTCG")
|
||||
endif()
|
||||
else()
|
||||
# Try and enable C++11. Don't use C++14 because it doesn't work in some
|
||||
# configurations.
|
||||
add_cxx_compiler_flag(-std=c++11)
|
||||
if (NOT HAVE_CXX_FLAG_STD_CXX11)
|
||||
add_cxx_compiler_flag(-std=c++0x)
|
||||
endif()
|
||||
|
||||
# Turn compiler warnings up to 11
|
||||
add_cxx_compiler_flag(-Wall)
|
||||
|
||||
add_cxx_compiler_flag(-Wextra)
|
||||
add_cxx_compiler_flag(-Wshadow)
|
||||
add_cxx_compiler_flag(-Werror RELEASE)
|
||||
add_cxx_compiler_flag(-pedantic)
|
||||
add_cxx_compiler_flag(-pedantic-errors)
|
||||
add_cxx_compiler_flag(-Wshorten-64-to-32)
|
||||
add_cxx_compiler_flag(-Wfloat-equal)
|
||||
add_cxx_compiler_flag(-Wzero-as-null-pointer-constant)
|
||||
add_cxx_compiler_flag(-fstrict-aliasing)
|
||||
if (HAVE_CXX_FLAG_FSTRICT_ALIASING)
|
||||
add_cxx_compiler_flag(-Wstrict-aliasing)
|
||||
endif()
|
||||
add_cxx_compiler_flag(-Wthread-safety)
|
||||
if (HAVE_WTHREAD_SAFETY)
|
||||
add_definitions(-DHAVE_WTHREAD_SAFETY)
|
||||
cxx_feature_check(THREAD_SAFETY_ATTRIBUTES)
|
||||
endif()
|
||||
|
||||
# Link time optimisation
|
||||
if (BENCHMARK_ENABLE_LTO)
|
||||
add_cxx_compiler_flag(-flto)
|
||||
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
|
||||
find_program(GCC_AR gcc-ar)
|
||||
if (GCC_AR)
|
||||
set(CMAKE_AR ${GCC_AR})
|
||||
endif()
|
||||
find_program(GCC_RANLIB gcc-ranlib)
|
||||
if (GCC_RANLIB)
|
||||
set(CMAKE_RANLIB ${GCC_RANLIB})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Coverage build type
|
||||
set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
|
||||
"Flags used by the C++ compiler during coverage builds."
|
||||
FORCE)
|
||||
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
|
||||
"${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING
|
||||
"Flags used for linking binaries during coverage builds."
|
||||
FORCE)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
|
||||
"${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING
|
||||
"Flags used by the shared libraries linker during coverage builds."
|
||||
FORCE)
|
||||
mark_as_advanced(
|
||||
CMAKE_CXX_FLAGS_COVERAGE
|
||||
CMAKE_EXE_LINKER_FLAGS_COVERAGE
|
||||
CMAKE_SHARED_LINKER_FLAGS_COVERAGE)
|
||||
set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
|
||||
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Coverage."
|
||||
FORCE)
|
||||
add_cxx_compiler_flag(--coverage COVERAGE)
|
||||
# Coverage build type
|
||||
set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
|
||||
"Flags used by the C++ compiler during coverage builds."
|
||||
FORCE)
|
||||
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
|
||||
"${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING
|
||||
"Flags used for linking binaries during coverage builds."
|
||||
FORCE)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
|
||||
"${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING
|
||||
"Flags used by the shared libraries linker during coverage builds."
|
||||
FORCE)
|
||||
mark_as_advanced(
|
||||
CMAKE_CXX_FLAGS_COVERAGE
|
||||
CMAKE_EXE_LINKER_FLAGS_COVERAGE
|
||||
CMAKE_SHARED_LINKER_FLAGS_COVERAGE)
|
||||
set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
|
||||
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Coverage."
|
||||
FORCE)
|
||||
add_cxx_compiler_flag(--coverage COVERAGE)
|
||||
endif()
|
||||
|
||||
# C++ feature checks
|
||||
cxx_feature_check(STD_REGEX)
|
||||
|
16
3rdparty/benchmark/README.md
vendored
16
3rdparty/benchmark/README.md
vendored
@ -243,7 +243,7 @@ The `context` attribute contains information about the run in general, including
|
||||
information about the CPU and the date.
|
||||
The `benchmarks` attribute contains a list of ever benchmark run. Example json
|
||||
output looks like:
|
||||
```
|
||||
``` json
|
||||
{
|
||||
"context": {
|
||||
"date": "2015/03/17-18:40:25",
|
||||
@ -290,6 +290,20 @@ name,iterations,real_time,cpu_time,bytes_per_second,items_per_second,label
|
||||
"BM_SetInsert/1024/10",106365,17238.4,8421.53,4.74973e+06,1.18743e+06,
|
||||
```
|
||||
|
||||
Debug vs Release
|
||||
----------------
|
||||
By default, benchmark builds as a debug library. You will see a warning in the output when this is the case. To build it as a release library instead, use:
|
||||
|
||||
```
|
||||
cmake -DCMAKE_BUILD_TYPE=Release
|
||||
```
|
||||
|
||||
To enable link-time optimisation, use
|
||||
|
||||
```
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_ENABLE_LTO=true
|
||||
```
|
||||
|
||||
Linking against the library
|
||||
---------------------------
|
||||
When using gcc, it is necessary to link against pthread to avoid runtime exceptions. This is due to how gcc implements std::thread. See [issue #67](https://github.com/google/benchmark/issues/67) for more details.
|
||||
|
84
3rdparty/benchmark/appveyor.yml
vendored
84
3rdparty/benchmark/appveyor.yml
vendored
@ -12,9 +12,16 @@ platform:
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- compiler: msvc-12-seh
|
||||
- compiler: msvc-14-seh
|
||||
- compiler: gcc-4.9.2-posix
|
||||
# - compiler: gcc-4.8.4-posix
|
||||
# - compiler: msvc-12-seh
|
||||
|
||||
artifacts:
|
||||
- path: '_build/CMakeFiles/*.log'
|
||||
name: logs
|
||||
- path: '_build/Testing/**/*.xml'
|
||||
name: test_results
|
||||
|
||||
install:
|
||||
# derive some extra information
|
||||
@ -35,18 +42,83 @@ before_build:
|
||||
- if "%compiler_name%"=="gcc" (set "build=mingw32-make -j4")
|
||||
- if "%compiler_name%"=="gcc" (set "test=mingw32-make CTEST_OUTPUT_ON_FAILURE=1 test")
|
||||
# msvc specific commands
|
||||
# TODO :)
|
||||
- if "%compiler_name%"=="msvc" if "%compiler_version%"=="12" if "%platform%"=="x86" (set "generator=Visual Studio 12 2013")
|
||||
- if "%compiler_name%"=="msvc" if "%compiler_version%"=="12" if "%platform%"=="x64" (set "generator=Visual Studio 12 2013 Win64")
|
||||
- if "%compiler_name%"=="msvc" if "%compiler_version%"=="14" if "%platform%"=="x86" (set "generator=Visual Studio 14 2015")
|
||||
- if "%compiler_name%"=="msvc" if "%compiler_version%"=="14" if "%platform%"=="x64" (set "generator=Visual Studio 14 2015 Win64")
|
||||
- if "%compiler_name%"=="msvc" (set "build=cmake --build . --config %variant%")
|
||||
- if "%compiler_name%"=="msvc" (set "test=ctest -c Release -D CTEST_OUTPUT_ON_FAILURE:STRING=1")
|
||||
# add the compiler path if needed
|
||||
- if not "%compiler_path%"=="" (set "PATH=%PATH%;%compiler_path%")
|
||||
# git bash conflicts with MinGW makefiles
|
||||
- if "%generator%"=="MinGW Makefiles" (set "PATH=%PATH:C:\Program Files (x86)\Git\bin=%")
|
||||
- if "%generator%"=="MinGW Makefiles" (set "PATH=%PATH:C:\Program Files\Git\usr\bin;=%")
|
||||
|
||||
build_script:
|
||||
- cmake -G "%generator%" "-DCMAKE_BUILD_TYPE=%variant%" "-DBUILD_SHARED_LIBS=%shared%"
|
||||
- cmd /c "%build%"
|
||||
- ps: |
|
||||
md _build -Force
|
||||
cd _build
|
||||
& cmake -G "$env:generator" "-DCMAKE_BUILD_TYPE=$env:variant" "-DBUILD_SHARED_LIBS=$env:shared" ..
|
||||
if ($LastExitCode -ne 0) {
|
||||
throw "Exec: $ErrorMessage"
|
||||
}
|
||||
iex "& $env:build"
|
||||
if ($LastExitCode -ne 0) {
|
||||
throw "Exec: $ErrorMessage"
|
||||
}
|
||||
|
||||
test_script:
|
||||
- cmd /c "%test%"
|
||||
- ps: |
|
||||
iex "& $env:test"
|
||||
if ($LastExitCode -ne 0) {
|
||||
throw "Exec: $ErrorMessage"
|
||||
}
|
||||
|
||||
function Add-CTest-Result($testResult)
|
||||
{
|
||||
$tests = ([xml](get-content $testResult)).Site.Testing
|
||||
$testsCount = 0
|
||||
$anyFailures = $FALSE
|
||||
|
||||
foreach ($test in $tests.test) {
|
||||
$testsCount++
|
||||
$testName = $test.Name
|
||||
$testpath = $test.Path
|
||||
$timeNode = $test.SelectSingleNode('Results/NamedMeasurement[@name="Execution Time"]/Value')
|
||||
if ($test.status -eq "failure") {
|
||||
$time = ([double]$timeNode.InnerText * 1000)
|
||||
Add-AppveyorTest $testName -Outcome Failed -FileName $testpath -Duration $time -ErrorMessage $($test.results.measurement.value)
|
||||
Add-AppveyorMessage `"$testName failed`" -Category Error
|
||||
$anyFailures = $TRUE
|
||||
}
|
||||
elseif ($test.status -eq "skipped") {
|
||||
Add-AppveyorTest $testName -Outcome Ignored -Filename $testpath
|
||||
}
|
||||
else {
|
||||
$time = ([double]$timeNode.InnerText * 1000)
|
||||
Add-AppveyorTest $testName -Outcome Passed -FileName $testpath -Duration $time -StdOut $($test.results.measurement.value)
|
||||
}
|
||||
}
|
||||
return $testsCount, $anyFailures
|
||||
}
|
||||
|
||||
$testsCount = 0
|
||||
$anyFailures = $FALSE
|
||||
|
||||
# Run tests and upload results to AppVeyor one by one
|
||||
Get-ChildItem ".\Testing\*.xml" -Recurse | foreach {
|
||||
$testfile = $_.fullname
|
||||
$count, $testsResult = Add-CTest-Result $testfile
|
||||
Write-Host "Found $testfile with $count tests"
|
||||
$testsCount = $testsCount + $count
|
||||
$anyFailures = $anyFailures -or $testsResult
|
||||
}
|
||||
|
||||
Write-Host "There are $testsCount tests found"
|
||||
|
||||
if ($anyFailures -eq $TRUE){
|
||||
Write-Host "Failing build as there are broken tests"
|
||||
$host.SetShouldExit(1)
|
||||
}
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
@ -221,7 +221,7 @@ inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) {
|
||||
// benchmark to use.
|
||||
class State {
|
||||
public:
|
||||
State(size_t max_iters, bool has_x, int x, bool has_y, int y, int thread_i);
|
||||
State(size_t max_iters, bool has_x, int x, bool has_y, int y, int thread_i, int n_threads);
|
||||
|
||||
// Returns true iff the benchmark should continue through another iteration.
|
||||
// NOTE: A benchmark may not return from the test until KeepRunning() has
|
||||
@ -358,7 +358,10 @@ private:
|
||||
size_t items_processed_;
|
||||
|
||||
public:
|
||||
// Index of the executing thread. Values from [0, threads).
|
||||
const int thread_index;
|
||||
// Number of threads concurrently executing the benchmark.
|
||||
const int threads;
|
||||
const size_t max_iterations;
|
||||
|
||||
private:
|
||||
@ -486,13 +489,13 @@ public:
|
||||
Fixture() : internal::Benchmark("") {}
|
||||
|
||||
virtual void Run(State& st) {
|
||||
this->SetUp();
|
||||
this->SetUp(st);
|
||||
this->BenchmarkCase(st);
|
||||
this->TearDown();
|
||||
this->TearDown(st);
|
||||
}
|
||||
|
||||
virtual void SetUp() {}
|
||||
virtual void TearDown() {}
|
||||
virtual void SetUp(const State&) {}
|
||||
virtual void TearDown(const State&) {}
|
||||
|
||||
protected:
|
||||
virtual void BenchmarkCase(State&) = 0;
|
||||
|
6
3rdparty/benchmark/src/benchmark.cc
vendored
6
3rdparty/benchmark/src/benchmark.cc
vendored
@ -599,7 +599,7 @@ namespace {
|
||||
void RunInThread(const benchmark::internal::Benchmark::Instance* b,
|
||||
size_t iters, int thread_id,
|
||||
ThreadStats* total) EXCLUDES(GetBenchmarkLock()) {
|
||||
State st(iters, b->has_arg1, b->arg1, b->has_arg2, b->arg2, thread_id);
|
||||
State st(iters, b->has_arg1, b->arg1, b->has_arg2, b->arg2, thread_id, b->threads);
|
||||
b->benchmark->Run(st);
|
||||
CHECK(st.iterations() == st.max_iterations) <<
|
||||
"Benchmark returned before State::KeepRunning() returned false!";
|
||||
@ -736,15 +736,17 @@ void RunBenchmark(const benchmark::internal::Benchmark::Instance& b,
|
||||
} // namespace
|
||||
|
||||
State::State(size_t max_iters, bool has_x, int x, bool has_y, int y,
|
||||
int thread_i)
|
||||
int thread_i, int n_threads)
|
||||
: started_(false), total_iterations_(0),
|
||||
has_range_x_(has_x), range_x_(x),
|
||||
has_range_y_(has_y), range_y_(y),
|
||||
bytes_processed_(0), items_processed_(0),
|
||||
thread_index(thread_i),
|
||||
threads(n_threads),
|
||||
max_iterations(max_iters)
|
||||
{
|
||||
CHECK(max_iterations != 0) << "At least one iteration must be run";
|
||||
CHECK_LT(thread_index, threads) << "thread_index must be less than threads";
|
||||
}
|
||||
|
||||
void State::PauseTiming() {
|
||||
|
2
3rdparty/benchmark/src/console_reporter.cc
vendored
2
3rdparty/benchmark/src/console_reporter.cc
vendored
@ -37,7 +37,7 @@ bool ConsoleReporter::ReportContext(const Context& context) {
|
||||
|
||||
if (context.cpu_scaling_enabled) {
|
||||
std::cerr << "***WARNING*** CPU scaling is enabled, the benchmark "
|
||||
"real time measurements may be noisy and will incure extra "
|
||||
"real time measurements may be noisy and will incur extra "
|
||||
"overhead.\n";
|
||||
}
|
||||
|
||||
|
2
3rdparty/benchmark/src/csv_reporter.cc
vendored
2
3rdparty/benchmark/src/csv_reporter.cc
vendored
@ -34,7 +34,7 @@ bool CSVReporter::ReportContext(const Context& context) {
|
||||
|
||||
if (context.cpu_scaling_enabled) {
|
||||
std::cerr << "***WARNING*** CPU scaling is enabled, the benchmark "
|
||||
"real time measurements may be noisy and will incure extra "
|
||||
"real time measurements may be noisy and will incur extra "
|
||||
"overhead.\n";
|
||||
}
|
||||
|
||||
|
8
3rdparty/benchmark/src/cycleclock.h
vendored
8
3rdparty/benchmark/src/cycleclock.h
vendored
@ -99,6 +99,14 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
|
||||
_asm rdtsc
|
||||
#elif defined(COMPILER_MSVC)
|
||||
return __rdtsc();
|
||||
#elif defined(__aarch64__)
|
||||
// System timer of ARMv8 runs at a different frequency than the CPU's.
|
||||
// The frequency is fixed, typically in the range 1-50MHz. It can be
|
||||
// read at CNTFRQ special register. We assume the OS has set up
|
||||
// the virtual timer properly.
|
||||
int64_t virtual_timer_value;
|
||||
asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value));
|
||||
return virtual_timer_value;
|
||||
#elif defined(__ARM_ARCH)
|
||||
#if (__ARM_ARCH >= 6) // V6 is the earliest arch that has a standard cyclecount
|
||||
uint32_t pmccntr;
|
||||
|
16
3rdparty/benchmark/src/sysinfo.cc
vendored
16
3rdparty/benchmark/src/sysinfo.cc
vendored
@ -174,12 +174,16 @@ void InitializeSystemInfo() {
|
||||
if (freqstr[1] != '\0' && *err == '\0' && bogo_clock > 0)
|
||||
saw_bogo = true;
|
||||
}
|
||||
} else if (strncasecmp(line, "processor", sizeof("processor") - 1) == 0) {
|
||||
} else if (strncmp(line, "processor", sizeof("processor") - 1) == 0) {
|
||||
// The above comparison is case-sensitive because ARM kernels often
|
||||
// include a "Processor" line that tells you about the CPU, distinct
|
||||
// from the usual "processor" lines that give you CPU ids. No current
|
||||
// Linux architecture is using "Processor" for CPU ids.
|
||||
num_cpus++; // count up every time we see an "processor :" entry
|
||||
const char* freqstr = strchr(line, ':');
|
||||
if (freqstr) {
|
||||
const long cpu_id = strtol(freqstr + 1, &err, 10);
|
||||
if (freqstr[1] != '\0' && *err == '\0' && max_cpu_id < cpu_id)
|
||||
const char* id_str = strchr(line, ':');
|
||||
if (id_str) {
|
||||
const long cpu_id = strtol(id_str + 1, &err, 10);
|
||||
if (id_str[1] != '\0' && *err == '\0' && max_cpu_id < cpu_id)
|
||||
max_cpu_id = cpu_id;
|
||||
}
|
||||
}
|
||||
@ -201,7 +205,7 @@ void InitializeSystemInfo() {
|
||||
} else {
|
||||
if ((max_cpu_id + 1) != num_cpus) {
|
||||
fprintf(stderr,
|
||||
"CPU ID assignments in /proc/cpuinfo seems messed up."
|
||||
"CPU ID assignments in /proc/cpuinfo seem messed up."
|
||||
" This is usually caused by a bad BIOS.\n");
|
||||
}
|
||||
cpuinfo_num_cpus = num_cpus;
|
||||
|
3
3rdparty/benchmark/test/CMakeLists.txt
vendored
3
3rdparty/benchmark/test/CMakeLists.txt
vendored
@ -39,6 +39,9 @@ add_test(basic_benchmark basic_test --benchmark_min_time=0.01)
|
||||
compile_benchmark_test(fixture_test)
|
||||
add_test(fixture_test fixture_test --benchmark_min_time=0.01)
|
||||
|
||||
compile_benchmark_test(map_test)
|
||||
add_test(map_test map_test --benchmark_min_time=0.01)
|
||||
|
||||
compile_benchmark_test(cxx03_test)
|
||||
set_target_properties(cxx03_test
|
||||
PROPERTIES COMPILE_FLAGS "${CXX03_FLAGS}")
|
||||
|
24
3rdparty/benchmark/test/benchmark_test.cc
vendored
24
3rdparty/benchmark/test/benchmark_test.cc
vendored
@ -150,5 +150,29 @@ static void BM_LongTest(benchmark::State& state) {
|
||||
}
|
||||
BENCHMARK(BM_LongTest)->Range(1<<16,1<<28);
|
||||
|
||||
static void BM_ParallelMemset(benchmark::State& state) {
|
||||
int size = state.range_x() / sizeof(int);
|
||||
int thread_size = size / state.threads;
|
||||
int from = thread_size * state.thread_index;
|
||||
int to = from + thread_size;
|
||||
|
||||
if (state.thread_index == 0) {
|
||||
test_vector = new std::vector<int>(size);
|
||||
}
|
||||
|
||||
while (state.KeepRunning()) {
|
||||
for (int i = from; i < to; i++) {
|
||||
// No need to lock test_vector_mu as ranges
|
||||
// do not overlap between threads.
|
||||
benchmark::DoNotOptimize(test_vector->at(i) = 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (state.thread_index == 0) {
|
||||
delete test_vector;
|
||||
}
|
||||
}
|
||||
BENCHMARK(BM_ParallelMemset)->Arg(10 << 20)->ThreadRange(1, 4);
|
||||
|
||||
BENCHMARK_MAIN()
|
||||
|
||||
|
46
3rdparty/benchmark/test/fixture_test.cc
vendored
46
3rdparty/benchmark/test/fixture_test.cc
vendored
@ -2,41 +2,51 @@
|
||||
#include "benchmark/benchmark.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <memory>
|
||||
|
||||
class MyFixture : public ::benchmark::Fixture
|
||||
{
|
||||
public:
|
||||
void SetUp() {
|
||||
data = new int(42);
|
||||
class MyFixture : public ::benchmark::Fixture {
|
||||
public:
|
||||
void SetUp(const ::benchmark::State& state) {
|
||||
if (state.thread_index == 0) {
|
||||
assert(data.get() == nullptr);
|
||||
data.reset(new int(42));
|
||||
}
|
||||
}
|
||||
|
||||
void TearDown() {
|
||||
assert(data != nullptr);
|
||||
delete data;
|
||||
data = nullptr;
|
||||
void TearDown(const ::benchmark::State& state) {
|
||||
if (state.thread_index == 0) {
|
||||
assert(data.get() != nullptr);
|
||||
data.reset();
|
||||
}
|
||||
}
|
||||
|
||||
~MyFixture() {
|
||||
assert(data == nullptr);
|
||||
}
|
||||
~MyFixture() {
|
||||
assert(data == nullptr);
|
||||
}
|
||||
|
||||
int* data;
|
||||
std::unique_ptr<int> data;
|
||||
};
|
||||
|
||||
|
||||
BENCHMARK_F(MyFixture, Foo)(benchmark::State& st) {
|
||||
assert(data != nullptr);
|
||||
assert(*data == 42);
|
||||
while (st.KeepRunning()) {
|
||||
}
|
||||
assert(data.get() != nullptr);
|
||||
assert(*data == 42);
|
||||
while (st.KeepRunning()) {
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK_DEFINE_F(MyFixture, Bar)(benchmark::State& st) {
|
||||
if (st.thread_index == 0) {
|
||||
assert(data.get() != nullptr);
|
||||
assert(*data == 42);
|
||||
}
|
||||
while (st.KeepRunning()) {
|
||||
assert(data.get() != nullptr);
|
||||
assert(*data == 42);
|
||||
}
|
||||
st.SetItemsProcessed(st.range_x());
|
||||
}
|
||||
BENCHMARK_REGISTER_F(MyFixture, Bar)->Arg(42);
|
||||
|
||||
BENCHMARK_REGISTER_F(MyFixture, Bar)->Arg(42)->ThreadPerCpu();
|
||||
|
||||
BENCHMARK_MAIN()
|
||||
|
58
3rdparty/benchmark/test/map_test.cc
vendored
Normal file
58
3rdparty/benchmark/test/map_test.cc
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
#include "benchmark/benchmark.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <map>
|
||||
|
||||
namespace {
|
||||
|
||||
std::map<int, int> ConstructRandomMap(int size) {
|
||||
std::map<int, int> m;
|
||||
for (int i = 0; i < size; ++i) {
|
||||
m.insert(std::make_pair(rand() % size, rand() % size));
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// Basic version.
|
||||
static void BM_MapLookup(benchmark::State& state) {
|
||||
const int size = state.range_x();
|
||||
while (state.KeepRunning()) {
|
||||
state.PauseTiming();
|
||||
std::map<int, int> m = ConstructRandomMap(size);
|
||||
state.ResumeTiming();
|
||||
for (int i = 0; i < size; ++i) {
|
||||
benchmark::DoNotOptimize(m.find(rand() % size));
|
||||
}
|
||||
}
|
||||
state.SetItemsProcessed(state.iterations() * size);
|
||||
}
|
||||
BENCHMARK(BM_MapLookup)->Range(1 << 3, 1 << 12);
|
||||
|
||||
// Using fixtures.
|
||||
class MapFixture : public ::benchmark::Fixture {
|
||||
public:
|
||||
void SetUp(const ::benchmark::State& st) {
|
||||
m = ConstructRandomMap(st.range_x());
|
||||
}
|
||||
|
||||
void TearDown(const ::benchmark::State&) {
|
||||
m.clear();
|
||||
}
|
||||
|
||||
std::map<int, int> m;
|
||||
};
|
||||
|
||||
BENCHMARK_DEFINE_F(MapFixture, Lookup)(benchmark::State& state) {
|
||||
const int size = state.range_x();
|
||||
while (state.KeepRunning()) {
|
||||
for (int i = 0; i < size; ++i) {
|
||||
benchmark::DoNotOptimize(m.find(rand() % size));
|
||||
}
|
||||
}
|
||||
state.SetItemsProcessed(state.iterations() * size);
|
||||
}
|
||||
BENCHMARK_REGISTER_F(MapFixture, Lookup)->Range(1<<3, 1<<12);
|
||||
|
||||
BENCHMARK_MAIN()
|
@ -1,6 +1,14 @@
|
||||
GLSL optimizer Change Log
|
||||
=========================
|
||||
|
||||
2016 03
|
||||
-------
|
||||
|
||||
Fixed:
|
||||
|
||||
* Fixed translation performance regression in loop analysis (regressed in 2015 06 fixes).
|
||||
|
||||
|
||||
2015 08
|
||||
-------
|
||||
|
||||
@ -35,6 +43,7 @@ Fixes:
|
||||
-------
|
||||
|
||||
Goodies:
|
||||
|
||||
* GLES2: support EXT_draw_instanced / gl_InstanceIDEXT.
|
||||
* Support gl_VertexID in GLSL < 1.30 when EXT_gpu_shader4 is used.
|
||||
|
||||
|
@ -440,8 +440,12 @@ static bool propagate_precision(exec_list* list, bool assign_high_to_undefined)
|
||||
static void do_optimization_passes(exec_list* ir, bool linked, _mesa_glsl_parse_state* state, void* mem_ctx)
|
||||
{
|
||||
bool progress;
|
||||
// FIXME: Shouldn't need to bound the number of passes
|
||||
int passes = 0,
|
||||
kMaximumPasses = 1000;
|
||||
do {
|
||||
progress = false;
|
||||
++passes;
|
||||
bool progress2;
|
||||
debug_print_ir ("Initial", ir, state, mem_ctx);
|
||||
if (linked) {
|
||||
@ -497,7 +501,7 @@ static void do_optimization_passes(exec_list* ir, bool linked, _mesa_glsl_parse_
|
||||
}
|
||||
delete ls;
|
||||
}
|
||||
} while (progress);
|
||||
} while (progress && passes < kMaximumPasses);
|
||||
|
||||
if (!state->metal_target)
|
||||
{
|
||||
|
@ -1020,17 +1020,7 @@ void ir_print_metal_visitor::visit(ir_expression *ir)
|
||||
const bool halfCast = (arg_prec == glsl_precision_medium || arg_prec == glsl_precision_low);
|
||||
buffer.asprintf_append (halfCast ? "((half)1.0/(" : "(1.0/(");
|
||||
} else {
|
||||
switch(ir->operation) {
|
||||
case ir_unop_dFdy:
|
||||
case ir_unop_dFdy_coarse:
|
||||
case ir_unop_dFdy_fine:
|
||||
buffer.asprintf_append ("%s(-", operator_glsl_strs[ir->operation]);
|
||||
break;
|
||||
|
||||
default:
|
||||
buffer.asprintf_append ("%s(", operator_glsl_strs[ir->operation]);
|
||||
break;
|
||||
}
|
||||
buffer.asprintf_append ("%s(", operator_glsl_strs[ir->operation]);
|
||||
}
|
||||
if (ir->operands[0])
|
||||
ir->operands[0]->accept(this);
|
||||
|
@ -163,8 +163,10 @@ exec_node_get_prev(struct exec_node *n)
|
||||
static inline void
|
||||
exec_node_remove(struct exec_node *n)
|
||||
{
|
||||
n->next->prev = n->prev;
|
||||
n->prev->next = n->next;
|
||||
if (n->next)
|
||||
n->next->prev = n->prev;
|
||||
if (n->prev)
|
||||
n->prev->next = n->next;
|
||||
n->next = NULL;
|
||||
n->prev = NULL;
|
||||
}
|
||||
|
@ -25,11 +25,10 @@
|
||||
#include "loop_analysis.h"
|
||||
#include "ir_hierarchical_visitor.h"
|
||||
#include "ir_variable_refcount.h"
|
||||
#include "util/hash_table.h"
|
||||
|
||||
static bool is_loop_terminator(ir_if *ir);
|
||||
|
||||
static bool used_outside_loops(exec_node *head, ir_variable *var, bool first_assignment);
|
||||
|
||||
static bool all_expression_operands_are_loop_constant(ir_rvalue *,
|
||||
hash_table *);
|
||||
|
||||
@ -84,6 +83,8 @@ loop_state::loop_state()
|
||||
hash_table_pointer_compare);
|
||||
this->ht_non_inductors = hash_table_ctor(0, hash_table_pointer_hash,
|
||||
hash_table_pointer_compare);
|
||||
this->ht_variables = hash_table_ctor(0, hash_table_pointer_hash,
|
||||
hash_table_pointer_compare);
|
||||
this->mem_ctx = ralloc_context(NULL);
|
||||
this->loop_found = false;
|
||||
}
|
||||
@ -94,6 +95,7 @@ loop_state::~loop_state()
|
||||
hash_table_dtor(this->ht);
|
||||
hash_table_dtor(this->ht_inductors);
|
||||
hash_table_dtor(this->ht_non_inductors);
|
||||
hash_table_dtor(this->ht_variables);
|
||||
ralloc_free(this->mem_ctx);
|
||||
}
|
||||
|
||||
@ -122,10 +124,36 @@ loop_state::get_for_inductor(const ir_variable *ir)
|
||||
return (loop_variable_state *) hash_table_find(this->ht_inductors, ir);
|
||||
}
|
||||
|
||||
static void *unreferenced_variable = (void *)1;
|
||||
static void *assigned_variable = (void *)2;
|
||||
|
||||
void
|
||||
loop_state::insert_non_inductor(ir_variable *var)
|
||||
loop_state::insert_variable(ir_variable *var)
|
||||
{
|
||||
// key doesn't matter, just needs to be non-NULL
|
||||
// data starts as 1. If an assignment is seen, it's replaced with 2.
|
||||
// this way we can mark a variable as a non-inductor if it's referenced
|
||||
// other than the first assignment
|
||||
hash_table_insert(this->ht_variables, unreferenced_variable, var);
|
||||
}
|
||||
|
||||
void
|
||||
loop_state::reference_variable(ir_variable *var, bool assignment)
|
||||
{
|
||||
void *ref = hash_table_find(this->ht_variables, var);
|
||||
|
||||
// variable declaration was not seen or already discarded, just ignore
|
||||
if (ref == NULL)
|
||||
return;
|
||||
|
||||
if (ref == unreferenced_variable && assignment)
|
||||
{
|
||||
hash_table_replace(this->ht_variables, assigned_variable, var);
|
||||
return;
|
||||
}
|
||||
|
||||
// variable is referenced and not just in an initial assignment,
|
||||
// so it cannot be an inductor
|
||||
hash_table_remove(this->ht_variables, var);
|
||||
hash_table_insert(this->ht_non_inductors, this, var);
|
||||
}
|
||||
|
||||
@ -266,10 +294,14 @@ public:
|
||||
virtual ir_visitor_status visit_enter(ir_if *);
|
||||
virtual ir_visitor_status visit_leave(ir_if *);
|
||||
|
||||
void visit_general(ir_instruction *);
|
||||
|
||||
loop_state *loops;
|
||||
|
||||
int if_statement_depth;
|
||||
|
||||
bool first_pass;
|
||||
|
||||
ir_assignment *current_assignment;
|
||||
|
||||
exec_list state;
|
||||
@ -277,10 +309,17 @@ public:
|
||||
|
||||
} /* anonymous namespace */
|
||||
|
||||
void loop_enter_callback(class ir_instruction *ir, void *data)
|
||||
{
|
||||
((loop_analysis *)data)->visit_general(ir);
|
||||
}
|
||||
|
||||
loop_analysis::loop_analysis(loop_state *loops)
|
||||
: loops(loops), if_statement_depth(0), current_assignment(NULL)
|
||||
: loops(loops), if_statement_depth(0), current_assignment(NULL), first_pass(false)
|
||||
{
|
||||
/* empty */
|
||||
data_enter = this;
|
||||
callback_enter = &loop_enter_callback;
|
||||
}
|
||||
|
||||
|
||||
@ -308,16 +347,11 @@ loop_analysis::visit(ir_variable *var)
|
||||
if (!this->state.is_empty())
|
||||
return visit_continue;
|
||||
|
||||
// Check if this variable is used outside a loop anywhere. If it is, it can't be a
|
||||
// variable that's private to the loop, so can't be an inductor.
|
||||
// This doesn't reject all possible non-inductors, notably anything declared in an
|
||||
// outer loop that isn't an inductor in an inner loop, but it can eliminate some
|
||||
// problem cases
|
||||
if (used_outside_loops(var->next, var, false))
|
||||
{
|
||||
// add to list of "non inductors"
|
||||
loops->insert_non_inductor(var);
|
||||
}
|
||||
// In the first pass over the instructions we look at variables declared and
|
||||
// examine their references to determine if they can be an inductor or not
|
||||
// for the second pass
|
||||
if (this->first_pass)
|
||||
loops->insert_variable(var);
|
||||
|
||||
return visit_continue;
|
||||
}
|
||||
@ -339,10 +373,15 @@ loop_analysis::visit_enter(ir_call *)
|
||||
ir_visitor_status
|
||||
loop_analysis::visit(ir_dereference_variable *ir)
|
||||
{
|
||||
/* If we're not somewhere inside a loop, there's nothing to do.
|
||||
/* If we're not somewhere inside a loop, just check for
|
||||
* non-inductors
|
||||
*/
|
||||
if (this->state.is_empty())
|
||||
if (this->state.is_empty() || this->first_pass)
|
||||
{
|
||||
if (this->state.is_empty() && this->first_pass)
|
||||
loops->reference_variable(ir->variable_referenced(), this->in_assignee);
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
bool nested = false;
|
||||
|
||||
@ -382,8 +421,11 @@ loop_analysis::visit_leave(ir_loop *ir)
|
||||
* We could perform some conservative analysis (prove there's no statically
|
||||
* possible assignment, etc.) but it isn't worth it for now; function
|
||||
* inlining will allow us to unroll loops anyway.
|
||||
*
|
||||
* We also skip doing any work in the first pass, where we are just identifying
|
||||
* variables that cannot be inductors.
|
||||
*/
|
||||
if (ls->contains_calls)
|
||||
if (ls->contains_calls || this->first_pass)
|
||||
return visit_continue;
|
||||
|
||||
foreach_in_list(ir_instruction, node, &ir->body_instructions) {
|
||||
@ -591,7 +633,7 @@ loop_analysis::visit_enter(ir_assignment *ir)
|
||||
/* If we're not somewhere inside a loop, there's nothing to do.
|
||||
*/
|
||||
if (this->state.is_empty())
|
||||
return visit_continue_with_parent;
|
||||
return visit_continue;
|
||||
|
||||
this->current_assignment = ir;
|
||||
|
||||
@ -601,10 +643,8 @@ loop_analysis::visit_enter(ir_assignment *ir)
|
||||
ir_visitor_status
|
||||
loop_analysis::visit_leave(ir_assignment *ir)
|
||||
{
|
||||
/* Since the visit_enter exits with visit_continue_with_parent for this
|
||||
* case, the loop state stack should never be empty here.
|
||||
*/
|
||||
assert(!this->state.is_empty());
|
||||
if (this->state.is_empty())
|
||||
return visit_continue;
|
||||
|
||||
assert(this->current_assignment == ir);
|
||||
this->current_assignment = NULL;
|
||||
@ -612,6 +652,24 @@ loop_analysis::visit_leave(ir_assignment *ir)
|
||||
return visit_continue;
|
||||
}
|
||||
|
||||
void
|
||||
loop_analysis::visit_general(ir_instruction *ir)
|
||||
{
|
||||
/* If we're inside a loop, we can't start marking things as non-inductors
|
||||
* Likewise in the second pass we've done all this work, so return early
|
||||
*/
|
||||
if (!this->state.is_empty() || !this->first_pass)
|
||||
return;
|
||||
|
||||
ir_variable_refcount_visitor refs;
|
||||
ir->accept (&refs);
|
||||
|
||||
struct hash_entry *referenced_var;
|
||||
hash_table_foreach (refs.ht, referenced_var) {
|
||||
ir_variable *var = (ir_variable *)referenced_var->key;
|
||||
loops->reference_variable(var, false);
|
||||
}
|
||||
}
|
||||
|
||||
class examine_rhs : public ir_hierarchical_visitor {
|
||||
public:
|
||||
@ -733,72 +791,23 @@ is_loop_terminator(ir_if *ir)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
used_outside_loops(exec_node *head, ir_variable *var, bool first_assignment)
|
||||
{
|
||||
ir_variable_refcount_visitor refs;
|
||||
for (exec_node* node = head;
|
||||
!node->is_tail_sentinel();
|
||||
node = node->next)
|
||||
{
|
||||
ir_instruction *ir = (ir_instruction *) node;
|
||||
if (ir->ir_type == ir_type_variable)
|
||||
continue;
|
||||
|
||||
// ignore the first assignment
|
||||
if (!first_assignment && ir->ir_type == ir_type_assignment)
|
||||
{
|
||||
ir_assignment *assign = ir->as_assignment();
|
||||
ir_variable *assignee = assign->lhs->whole_variable_referenced();
|
||||
|
||||
if(assignee == var)
|
||||
{
|
||||
first_assignment = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// we don't want to recurse into loops
|
||||
if (ir->ir_type == ir_type_loop)
|
||||
continue;
|
||||
|
||||
// recurse only for if statements, the other case we would need to recurse is
|
||||
// loops, but we are looking for uses outside of loops.
|
||||
if (ir->ir_type == ir_type_if)
|
||||
{
|
||||
ir_if *irif = ir->as_if();
|
||||
if (used_outside_loops(irif->then_instructions.head, var, first_assignment))
|
||||
return true;
|
||||
if (used_outside_loops(irif->else_instructions.head, var, first_assignment))
|
||||
return true;
|
||||
|
||||
// if we didn't find in each branch with our recursion, skip
|
||||
// otherwise the accept (&refs) below will recurse into loops
|
||||
// and may give a false positive.
|
||||
continue;
|
||||
}
|
||||
|
||||
// we know that we're not inside a loop as we haven't recursed inside,
|
||||
// and we started outside of a loop, so any references to this variable
|
||||
// mean it is used outside of any loops
|
||||
ir->accept (&refs);
|
||||
if (refs.find_variable_entry(var))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
loop_state *
|
||||
analyze_loop_variables(exec_list *instructions)
|
||||
{
|
||||
loop_state *loops = new loop_state;
|
||||
loop_analysis v(loops);
|
||||
|
||||
/* Do two passes over the instructions. The first pass builds a view
|
||||
* of the variables declared and whether or not they're used outside
|
||||
* of loops (if so, they cannot be inductors).
|
||||
*
|
||||
* In the second pass we apply this information to do the loop analysis
|
||||
* itself.
|
||||
*/
|
||||
v.first_pass = true;
|
||||
v.run(instructions);
|
||||
v.first_pass = false;
|
||||
v.run(instructions);
|
||||
|
||||
return v.loops;
|
||||
}
|
||||
|
@ -251,6 +251,8 @@ public:
|
||||
loop_variable_state* get_for_inductor (const ir_variable*);
|
||||
bool insert_inductor(loop_variable* loopvar, loop_variable_state* state, ir_loop* loop);
|
||||
void insert_non_inductor(ir_variable *var);
|
||||
void insert_variable(ir_variable *var);
|
||||
void reference_variable(ir_variable *var, bool assignment);
|
||||
|
||||
bool loop_found;
|
||||
|
||||
@ -267,6 +269,7 @@ private:
|
||||
*/
|
||||
hash_table *ht_inductors;
|
||||
hash_table *ht_non_inductors;
|
||||
hash_table *ht_variables;
|
||||
|
||||
|
||||
void *mem_ctx;
|
||||
|
@ -84,6 +84,8 @@ hash_table_ctor(unsigned num_buckets, hash_func_t hash,
|
||||
void
|
||||
hash_table_dtor(struct hash_table *ht)
|
||||
{
|
||||
if (!ht)
|
||||
return;
|
||||
hash_table_clear(ht);
|
||||
free(ht);
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
};
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
};
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 gl_FragCoord [[position]];
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
half2 xlv_TEXCOORD0;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float2 varUV;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
constant float2 _xlat_mtl_const1[12] = {float2(-0.326212, -0.40581), float2(-0.840144, -0.07358), float2(-0.695914, 0.457137), float2(-0.203345, 0.620716), float2(0.96234, -0.194983), float2(0.473434, -0.480026), float2(0.519456, 0.767022), float2(0.185461, -0.893124), float2(0.507431, 0.064425), float2(0.89642, 0.412458), float2(-0.32194, -0.932615), float2(-0.791559, -0.59771)};
|
||||
struct xlatMtlShaderInput {
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float2 gl_PointCoord [[point_coord]];
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
};
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
half4 xlv_TEXCOORD0;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
};
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 xlv_TEXCOORD0;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float2 xlv_uv;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float2 xlv_uv;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
inline float4x4 _xlcast_float4x4(half4x4 v) { return float4x4(float4(v[0]), float4(v[1]), float4(v[2]), float4(v[3])); }
|
||||
inline float3x3 _xlcast_float3x3(half3x3 v) { return float3x3(float3(v[0]), float3(v[1]), float3(v[2])); }
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
inline float4x4 _xlinit_float4x4(float v) { return float4x4(float4(v), float4(v), float4(v), float4(v)); }
|
||||
inline float3x3 _xlinit_float3x3(float v) { return float3x3(float3(v), float3(v), float3(v)); }
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
};
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
};
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
half4 xlv_COLOR0;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
};
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
half3 normal;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
};
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
half3 inNormal;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
};
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 varUV;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 xlv_TEXCOORD0;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 xlv_TEXCOORD0;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 uv;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
half3 uv1;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 uvHi;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less);
|
||||
struct xlatMtlShaderInput {
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float3 uv;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less);
|
||||
struct xlatMtlShaderInput {
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
half3 uv;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less);
|
||||
struct xlatMtlShaderInput {
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float2 xlv_TEXCOORD0;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float2 xlv_TEXCOORD0;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 _uv0;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float2 xlv_TEXCOORD0;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float2 xlv_TEXCOORD0;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 xlv_TEXCOORD0;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float2 xlv_TEXCOORD0;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float2 xlv_TEXCOORD0;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 xlv_TEXCOORD0;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float2 xlv_TEXCOORD0;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
half2 xlv_TEXCOORD0;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
constant float3 _xlat_mtl_const1[8] = {float3(0.0130572, 0.587232, -0.119337), float3(0.323078, 0.0220727, -0.418873), float3(-0.310725, -0.191367, 0.0561369), float3(-0.479646, 0.0939877, -0.580265), float3(0.139999, -0.33577, 0.559679), float3(-0.248458, 0.255532, 0.348944), float3(0.18719, -0.702764, -0.231748), float3(0.884915, 0.284208, 0.368524)};
|
||||
struct xlatMtlShaderInput {
|
||||
|
@ -315,9 +315,9 @@ static bool CheckGLSL (bool vertex, bool gles, const std::string& testName, cons
|
||||
|
||||
static bool CheckMetal (bool vertex, bool gles, const std::string& testName, const char* prefix, const std::string& source)
|
||||
{
|
||||
#if !GOT_GFX
|
||||
#if !GOT_GFX || !defined(__APPLE__)
|
||||
return true; // just assume it's ok
|
||||
#endif
|
||||
#else
|
||||
|
||||
FILE* f = fopen ("metalTemp.metal", "wb");
|
||||
fwrite (source.c_str(), source.size(), 1, f);
|
||||
@ -333,6 +333,7 @@ static bool CheckMetal (bool vertex, bool gles, const std::string& testName, con
|
||||
#endif //
|
||||
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 _inVertex [[attribute(0)]];
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 _glesVertex [[attribute(0)]];
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float3 _inPos [[attribute(0)]];
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 _glesVertex [[attribute(0)]];
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 dcl_Input0_POSITION0 [[attribute(0)]];
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 in_POSITION0 [[attribute(0)]];
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 _glesVertex [[attribute(0)]];
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 _inVertex [[attribute(0)]];
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
inline float4x4 _xlcast_float4x4(half4x4 v) { return float4x4(float4(v[0]), float4(v[1]), float4(v[2]), float4(v[3])); }
|
||||
inline float3x3 _xlcast_float3x3(half3x3 v) { return float3x3(float3(v[0]), float3(v[1]), float3(v[2])); }
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 attrVertex [[attribute(0)]];
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 _glesVertex [[attribute(0)]];
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 _inVertex [[attribute(0)]];
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 _glesVertex [[attribute(0)]];
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 _glesVertex [[attribute(0)]];
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 _vertex [[attribute(0)]];
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <metal_stdlib>
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
using namespace metal;
|
||||
struct xlatMtlShaderInput {
|
||||
float4 _inVertex [[attribute(0)]];
|
||||
|
98
3rdparty/bgfx/3rdparty/khronos/vulkan/vk_lunarg_debug_marker.h
vendored
Normal file
98
3rdparty/bgfx/3rdparty/khronos/vulkan/vk_lunarg_debug_marker.h
vendored
Normal file
@ -0,0 +1,98 @@
|
||||
//
|
||||
// File: vk_lunarg_debug_marker.h
|
||||
//
|
||||
/*
|
||||
* Copyright (c) 2015-2016 The Khronos Group Inc.
|
||||
* Copyright (c) 2015-2016 Valve Corporation
|
||||
* Copyright (c) 2015-2016 LunarG, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and/or associated documentation files (the "Materials"), to
|
||||
* deal in the Materials without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Materials, and to permit persons to whom the Materials are
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice(s) and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Materials.
|
||||
*
|
||||
* THE MATERIALS ARE 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 MATERIALS OR THE
|
||||
* USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*
|
||||
* Authors:
|
||||
* Jon Ashburn <jon@lunarg.com>
|
||||
* Courtney Goeltzenleuchter <courtney@lunarg.com>
|
||||
*/
|
||||
|
||||
#ifndef __VK_DEBUG_MARKER_H__
|
||||
#define __VK_DEBUG_MARKER_H__
|
||||
|
||||
#include "vulkan.h"
|
||||
|
||||
#define VK_DEBUG_MARKER_EXTENSION_NUMBER 6
|
||||
#define VK_DEBUG_MARKER_EXTENSION_REVISION 1
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
/*
|
||||
***************************************************************************************************
|
||||
* DebugMarker Vulkan Extension API
|
||||
***************************************************************************************************
|
||||
*/
|
||||
|
||||
#define DEBUG_MARKER_EXTENSION_NAME "VK_LUNARG_DEBUG_MARKER"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Enumerations
|
||||
|
||||
#define VK_DEBUG_MARKER_ENUM_EXTEND(type, id) \
|
||||
((type)(VK_DEBUG_MARKER_EXTENSION_NUMBER * -1000 + (id)))
|
||||
|
||||
#define VK_OBJECT_INFO_TYPE_DBG_OBJECT_TAG \
|
||||
VK_DEBUG_MARKER_ENUM_EXTEND(VkDbgObjectInfoType, 0)
|
||||
#define VK_OBJECT_INFO_TYPE_DBG_OBJECT_NAME \
|
||||
VK_DEBUG_MARKER_ENUM_EXTEND(VkDbgObjectInfoType, 1)
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// API functions
|
||||
|
||||
typedef void(VKAPI_PTR *PFN_vkCmdDbgMarkerBegin)(VkCommandBuffer commandBuffer,
|
||||
const char *pMarker);
|
||||
typedef void(VKAPI_PTR *PFN_vkCmdDbgMarkerEnd)(VkCommandBuffer commandBuffer);
|
||||
typedef VkResult(VKAPI_PTR *PFN_vkDbgSetObjectTag)(
|
||||
VkDevice device, VkDebugReportObjectTypeEXT objType, uint64_t object,
|
||||
size_t tagSize, const void *pTag);
|
||||
typedef VkResult(VKAPI_PTR *PFN_vkDbgSetObjectName)(
|
||||
VkDevice device, VkDebugReportObjectTypeEXT objType, uint64_t object,
|
||||
size_t nameSize, const char *pName);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
|
||||
// DebugMarker extension entrypoints
|
||||
VKAPI_ATTR void VKAPI_CALL
|
||||
vkCmdDbgMarkerBegin(VkCommandBuffer commandBuffer, const char *pMarker);
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL vkCmdDbgMarkerEnd(VkCommandBuffer commandBuffer);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
vkDbgSetObjectTag(VkDevice device, VkDebugReportObjectTypeEXT objType,
|
||||
uint64_t object, size_t tagSize, const void *pTag);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL
|
||||
vkDbgSetObjectName(VkDevice device, VkDebugReportObjectTypeEXT objType,
|
||||
uint64_t object, size_t nameSize, const char *pName);
|
||||
|
||||
#endif // VK_NO_PROTOTYPES
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // __VK_DEBUG_MARKER_H__
|
127
3rdparty/bgfx/3rdparty/khronos/vulkan/vk_platform.h
vendored
Normal file
127
3rdparty/bgfx/3rdparty/khronos/vulkan/vk_platform.h
vendored
Normal file
@ -0,0 +1,127 @@
|
||||
//
|
||||
// File: vk_platform.h
|
||||
//
|
||||
/*
|
||||
** Copyright (c) 2014-2015 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are 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 Materials.
|
||||
**
|
||||
** THE MATERIALS ARE 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
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __VK_PLATFORM_H__
|
||||
#define __VK_PLATFORM_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
|
||||
/*
|
||||
***************************************************************************************************
|
||||
* Platform-specific directives and type declarations
|
||||
***************************************************************************************************
|
||||
*/
|
||||
|
||||
/* Platform-specific calling convention macros.
|
||||
*
|
||||
* Platforms should define these so that Vulkan clients call Vulkan commands
|
||||
* with the same calling conventions that the Vulkan implementation expects.
|
||||
*
|
||||
* VKAPI_ATTR - Placed before the return type in function declarations.
|
||||
* Useful for C++11 and GCC/Clang-style function attribute syntax.
|
||||
* VKAPI_CALL - Placed after the return type in function declarations.
|
||||
* Useful for MSVC-style calling convention syntax.
|
||||
* VKAPI_PTR - Placed between the '(' and '*' in function pointer types.
|
||||
*
|
||||
* Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void);
|
||||
* Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void);
|
||||
*/
|
||||
#if defined(_WIN32)
|
||||
// On Windows, Vulkan commands use the stdcall convention
|
||||
#define VKAPI_ATTR
|
||||
#define VKAPI_CALL __stdcall
|
||||
#define VKAPI_PTR VKAPI_CALL
|
||||
#elif defined(__ANDROID__) && defined(__ARM_EABI__) && !defined(__ARM_ARCH_7A__)
|
||||
// Android does not support Vulkan in native code using the "armeabi" ABI.
|
||||
#error "Vulkan requires the 'armeabi-v7a' or 'armeabi-v7a-hard' ABI on 32-bit ARM CPUs"
|
||||
#elif defined(__ANDROID__) && defined(__ARM_ARCH_7A__)
|
||||
// On Android/ARMv7a, Vulkan functions use the armeabi-v7a-hard calling
|
||||
// convention, even if the application's native code is compiled with the
|
||||
// armeabi-v7a calling convention.
|
||||
#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))
|
||||
#define VKAPI_CALL
|
||||
#define VKAPI_PTR VKAPI_ATTR
|
||||
#else
|
||||
// On other platforms, use the default calling convention
|
||||
#define VKAPI_ATTR
|
||||
#define VKAPI_CALL
|
||||
#define VKAPI_PTR
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#if !defined(VK_NO_STDINT_H)
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||
typedef signed __int8 int8_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef signed __int16 int16_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef signed __int32 int32_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#endif // !defined(VK_NO_STDINT_H)
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
|
||||
// Platform-specific headers required by platform window system extensions.
|
||||
// These are enabled prior to #including "vulkan.h". The same enable then
|
||||
// controls inclusion of the extension interfaces in vulkan.h.
|
||||
|
||||
#ifdef VK_USE_PLATFORM_ANDROID_KHR
|
||||
#include <android/native_window.h>
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_MIR_KHR
|
||||
#include <mir_toolkit/client_types.h>
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
||||
#include <wayland-client.h>
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_XLIB_KHR
|
||||
#include <X11/Xlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_XCB_KHR
|
||||
#include <xcb/xcb.h>
|
||||
#endif
|
||||
|
||||
#endif // __VK_PLATFORM_H__
|
3775
3rdparty/bgfx/3rdparty/khronos/vulkan/vulkan.h
vendored
Normal file
3775
3rdparty/bgfx/3rdparty/khronos/vulkan/vulkan.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
3rdparty/bgfx/3rdparty/nvtt/nvcore/posh.h
vendored
6
3rdparty/bgfx/3rdparty/nvtt/nvcore/posh.h
vendored
@ -412,7 +412,9 @@ LLVM:
|
||||
# if !defined POSH_OS_XBOX
|
||||
# if defined _WIN64
|
||||
# define POSH_OS_WIN64 1
|
||||
# define POSH_OS_STRING "Win64"
|
||||
# if !defined POSH_OS_STRING
|
||||
# define POSH_OS_STRING "Win64"
|
||||
# endif // !defined POSH_OS_STRING
|
||||
# else
|
||||
# if !defined POSH_OS_STRING
|
||||
# define POSH_OS_STRING "Win32"
|
||||
@ -1026,5 +1028,3 @@ extern posh_i64_t POSH_ReadI64FromBig( const void *src );
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
42
3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
vendored
42
3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
vendored
@ -595,7 +595,7 @@ static void SetWindowScrollY(ImGuiWindow* window, float new_scroll_y
|
||||
static void SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiSetCond cond);
|
||||
static void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiSetCond cond);
|
||||
static void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiSetCond cond);
|
||||
static ImGuiWindow* FindWindowByName(const char* name);
|
||||
ImGuiWindow* FindWindowByName(const char* name);
|
||||
static ImGuiWindow* FindHoveredWindow(ImVec2 pos, bool excluding_childs);
|
||||
static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFlags flags);
|
||||
static inline bool IsWindowContentHoverable(ImGuiWindow* window);
|
||||
@ -2286,25 +2286,26 @@ static void AddWindowToSortedBuffer(ImVector<ImGuiWindow*>& out_sorted_windows,
|
||||
|
||||
static void AddDrawListToRenderList(ImVector<ImDrawList*>& out_render_list, ImDrawList* draw_list)
|
||||
{
|
||||
if (!draw_list->CmdBuffer.empty() && !draw_list->VtxBuffer.empty())
|
||||
if (draw_list->CmdBuffer.empty())
|
||||
return;
|
||||
|
||||
// Remove trailing command if unused
|
||||
ImDrawCmd& last_cmd = draw_list->CmdBuffer.back();
|
||||
if (last_cmd.ElemCount == 0 && last_cmd.UserCallback == NULL)
|
||||
{
|
||||
// Remove trailing command if unused
|
||||
ImDrawCmd& last_cmd = draw_list->CmdBuffer.back();
|
||||
if (last_cmd.ElemCount == 0 && last_cmd.UserCallback == NULL)
|
||||
draw_list->CmdBuffer.pop_back();
|
||||
|
||||
out_render_list.push_back(draw_list);
|
||||
|
||||
// Check that draw_list doesn't use more vertices than indexable (default ImDrawIdx = 2 bytes = 64K vertices)
|
||||
// If this assert triggers because you are drawing lots of stuff manually, A) workaround by calling BeginChild()/EndChild() to put your draw commands in multiple draw lists, B) #define ImDrawIdx to a 'unsigned int' in imconfig.h and render accordingly.
|
||||
const unsigned long long int max_vtx_idx = (unsigned long long int)1L << (sizeof(ImDrawIdx)*8);
|
||||
(void)max_vtx_idx;
|
||||
IM_ASSERT((int)draw_list->_VtxCurrentIdx == draw_list->VtxBuffer.Size); // Sanity check. Bug or mismatch between PrimReserve() calls and incrementing _VtxCurrentIdx, _VtxWritePtr etc.
|
||||
IM_ASSERT((unsigned long long int)draw_list->_VtxCurrentIdx <= max_vtx_idx); // Too many vertices in same ImDrawList. See comment above.
|
||||
|
||||
GImGui->IO.MetricsRenderVertices += draw_list->VtxBuffer.Size;
|
||||
GImGui->IO.MetricsRenderIndices += draw_list->IdxBuffer.Size;
|
||||
draw_list->CmdBuffer.pop_back();
|
||||
if (draw_list->CmdBuffer.empty())
|
||||
return;
|
||||
}
|
||||
|
||||
// Check that draw_list doesn't use more vertices than indexable (default ImDrawIdx = 2 bytes = 64K vertices)
|
||||
// If this assert triggers because you are drawing lots of stuff manually, A) workaround by calling BeginChild()/EndChild() to put your draw commands in multiple draw lists, B) #define ImDrawIdx to a 'unsigned int' in imconfig.h and render accordingly.
|
||||
IM_ASSERT((int)draw_list->_VtxCurrentIdx == draw_list->VtxBuffer.Size); // Sanity check. Bug or mismatch between PrimReserve() calls and incrementing _VtxCurrentIdx, _VtxWritePtr etc.
|
||||
IM_ASSERT((unsigned long long int)draw_list->_VtxCurrentIdx <= ((unsigned long long int)1L << (sizeof(ImDrawIdx)*8))); // Too many vertices in same ImDrawList. See comment above.
|
||||
|
||||
out_render_list.push_back(draw_list);
|
||||
GImGui->IO.MetricsRenderVertices += draw_list->VtxBuffer.Size;
|
||||
GImGui->IO.MetricsRenderIndices += draw_list->IdxBuffer.Size;
|
||||
}
|
||||
|
||||
static void AddWindowToRenderList(ImVector<ImDrawList*>& out_render_list, ImGuiWindow* window)
|
||||
@ -3458,9 +3459,9 @@ static ImVec2 FindBestPopupWindowPos(const ImVec2& base_pos, const ImVec2& size,
|
||||
return pos;
|
||||
}
|
||||
|
||||
static ImGuiWindow* FindWindowByName(const char* name)
|
||||
ImGuiWindow* ImGui::FindWindowByName(const char* name)
|
||||
{
|
||||
// FIXME-OPT: Store sorted hashes -> pointers.
|
||||
// FIXME-OPT: Store sorted hashes -> pointers so we can do a bissection in a contiguous block
|
||||
ImGuiState& g = *GImGui;
|
||||
ImGuiID id = ImHash(name, 0);
|
||||
for (int i = 0; i < g.Windows.Size; i++)
|
||||
@ -7209,6 +7210,7 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
|
||||
}
|
||||
|
||||
// Edit a string of text
|
||||
// NB: when active, hold on a privately held copy of the text (and apply back to 'buf'). So changing 'buf' while active has no effect.
|
||||
// FIXME: Rather messy function partly because we are doing UTF8 > u16 > UTF8 conversions on the go to more easily handle stb_textedit calls. Ideally we should stay in UTF-8 all the time. See https://github.com/nothings/stb/issues/188
|
||||
bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback, void* user_data)
|
||||
{
|
||||
|
4
3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h
vendored
4
3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h
vendored
@ -146,8 +146,8 @@ namespace ImGui
|
||||
IMGUI_API void SetWindowSize(const ImVec2& size, ImGuiSetCond cond = 0); // set current window size. set to ImVec2(0,0) to force an auto-fit. may incur tearing
|
||||
IMGUI_API void SetWindowCollapsed(bool collapsed, ImGuiSetCond cond = 0); // set current window collapsed state
|
||||
IMGUI_API void SetWindowFocus(); // set current window to be focused / front-most
|
||||
IMGUI_API void SetWindowPos(const char* name, const ImVec2& pos, ImGuiSetCond cond = 0); // set named window position - call within Begin()/End(). may incur tearing
|
||||
IMGUI_API void SetWindowSize(const char* name, const ImVec2& size, ImGuiSetCond cond = 0); // set named window size. set axis to 0.0f to force an auto-fit on this axis. may incur tearing
|
||||
IMGUI_API void SetWindowPos(const char* name, const ImVec2& pos, ImGuiSetCond cond = 0); // set named window position.
|
||||
IMGUI_API void SetWindowSize(const char* name, const ImVec2& size, ImGuiSetCond cond = 0); // set named window size. set axis to 0.0f to force an auto-fit on this axis.
|
||||
IMGUI_API void SetWindowCollapsed(const char* name, bool collapsed, ImGuiSetCond cond = 0); // set named window collapsed state
|
||||
IMGUI_API void SetWindowFocus(const char* name); // set named window to be focused / front-most. use NULL to remove focus.
|
||||
|
||||
|
@ -675,6 +675,7 @@ namespace ImGui
|
||||
inline ImGuiWindow* GetCurrentWindowRead() { ImGuiState& g = *GImGui; return g.CurrentWindow; }
|
||||
inline ImGuiWindow* GetCurrentWindow() { ImGuiState& g = *GImGui; g.CurrentWindow->Accessed = true; return g.CurrentWindow; }
|
||||
IMGUI_API ImGuiWindow* GetParentWindow();
|
||||
IMGUI_API ImGuiWindow* FindWindowByName(const char* name);
|
||||
IMGUI_API void FocusWindow(ImGuiWindow* window);
|
||||
|
||||
IMGUI_API void SetActiveID(ImGuiID id, ImGuiWindow* window);
|
||||
|
17
3rdparty/bgfx/3rdparty/renderdoc/renderdoc_app.h
vendored
17
3rdparty/bgfx/3rdparty/renderdoc/renderdoc_app.h
vendored
@ -1,7 +1,7 @@
|
||||
/******************************************************************************
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2015 Baldur Karlsson
|
||||
* Copyright (c) 2015-2016 Baldur Karlsson
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@ -445,10 +445,17 @@ typedef uint32_t (RENDERDOC_CC *pRENDERDOC_EndFrameCapture)(RENDERDOC_DevicePoin
|
||||
// instead of 1.0.0. You can check this with the GetAPIVersion entry point
|
||||
typedef enum
|
||||
{
|
||||
eRENDERDOC_API_Version_1_0_0 = 10000, // RENDERDOC_API_1_0_0 = 1 000 000
|
||||
eRENDERDOC_API_Version_1_0_0 = 10000, // RENDERDOC_API_1_0_0 = 1 00 00
|
||||
eRENDERDOC_API_Version_1_0_1 = 10001, // RENDERDOC_API_1_0_1 = 1 00 01
|
||||
} RENDERDOC_Version;
|
||||
|
||||
// eRENDERDOC_API_Version_1_0_0
|
||||
// API version changelog:
|
||||
//
|
||||
// 1.0.0 - initial release
|
||||
// 1.0.1 - Bugfix: IsFrameCapturing() was returning false for captures that were triggered
|
||||
// by keypress or TriggerCapture, instead of Start/EndFrameCapture.
|
||||
|
||||
// eRENDERDOC_API_Version_1_0_1
|
||||
typedef struct
|
||||
{
|
||||
pRENDERDOC_GetAPIVersion GetAPIVersion;
|
||||
@ -484,7 +491,9 @@ typedef struct
|
||||
pRENDERDOC_StartFrameCapture StartFrameCapture;
|
||||
pRENDERDOC_IsFrameCapturing IsFrameCapturing;
|
||||
pRENDERDOC_EndFrameCapture EndFrameCapture;
|
||||
} RENDERDOC_API_1_0_0;
|
||||
} RENDERDOC_API_1_0_1;
|
||||
|
||||
typedef RENDERDOC_API_1_0_1 RENDERDOC_API_1_0_0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// RenderDoc API entry point
|
||||
|
3
3rdparty/bgfx/3rdparty/stb/stb_image.c
vendored
3
3rdparty/bgfx/3rdparty/stb/stb_image.c
vendored
@ -1,6 +1,9 @@
|
||||
#ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wshadow"
|
||||
# pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
# ifndef __clang__
|
||||
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
# endif // __clang__
|
||||
#elif defined(_MSC_VER)
|
||||
# pragma warning(disable:4312) // warning C4312: 'type cast': conversion from '' to '' of greater size
|
||||
# pragma warning(disable:4456) // warning C4456: declaration of 'k' hides previous local declaration
|
||||
|
26
3rdparty/bgfx/README.md
vendored
26
3rdparty/bgfx/README.md
vendored
@ -55,14 +55,24 @@ Languages:
|
||||
* [Go language API bindings](https://github.com/james4k/go-bgfx)
|
||||
* [Java language API bindings](https://github.com/enleeten/twilight-bgfx)
|
||||
* [Haskell language API bindings](https://github.com/haskell-game/bgfx)
|
||||
* [Python language API bindings](https://github.com/jnadro/pybgfx#pybgf)
|
||||
* [Rust language API bindings](https://github.com/rhoot/bgfx-rs)
|
||||
|
||||
Build
|
||||
-----
|
||||
[Building](https://bkaradzic.github.io/bgfx/build.html)
|
||||
----------------------------------------------------
|
||||
|
||||
- AppVeyor https://ci.appveyor.com/project/bkaradzic/bgfx
|
||||
- TravisCI https://travis-ci.org/bkaradzic/bgfx
|
||||
|
||||
[Examples](https://bkaradzic.github.io/bgfx/examples.html)
|
||||
----------------------------------------------------------
|
||||
|
||||
[API Reference](https://bkaradzic.github.io/bgfx/bgfx.html)
|
||||
-----------------------------------------------------------
|
||||
|
||||
[Tools](https://bkaradzic.github.io/bgfx/tools.html)
|
||||
----------------------------------------------------
|
||||
|
||||
Who is using it?
|
||||
----------------
|
||||
|
||||
@ -118,18 +128,6 @@ http://makingartstudios.itch.io/dls - DLS the digital logic simulator game.
|
||||
|
||||
https://github.com/mamedev/mame MAME - Multiple Arcade Machine Emulator
|
||||
|
||||
[Building](https://bkaradzic.github.io/bgfx/build.html)
|
||||
-------------------------------------------------------
|
||||
|
||||
[Examples](https://bkaradzic.github.io/bgfx/examples.html)
|
||||
----------------------------------------------------------
|
||||
|
||||
[API Reference](https://bkaradzic.github.io/bgfx/bgfx.html)
|
||||
-----------------------------------------------------------
|
||||
|
||||
[Tools](https://bkaradzic.github.io/bgfx/tools.html)
|
||||
----------------------------------------------------
|
||||
|
||||
[License (BSD 2-clause)](https://bkaradzic.github.io/bgfx/license.html)
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
|
4
3rdparty/bgfx/examples/01-cubes/cubes.cpp
vendored
4
3rdparty/bgfx/examples/01-cubes/cubes.cpp
vendored
@ -55,7 +55,7 @@ static const uint16_t s_cubeIndices[36] =
|
||||
6, 3, 7,
|
||||
};
|
||||
|
||||
class Cubes : public entry::AppI
|
||||
class ExampleCubes : public entry::AppI
|
||||
{
|
||||
void init(int _argc, char** _argv) BX_OVERRIDE
|
||||
{
|
||||
@ -218,4 +218,4 @@ class Cubes : public entry::AppI
|
||||
int64_t m_timeOffset;
|
||||
};
|
||||
|
||||
ENTRY_IMPLEMENT_MAIN(Cubes);
|
||||
ENTRY_IMPLEMENT_MAIN(ExampleCubes);
|
||||
|
3
3rdparty/bgfx/examples/01-cubes/makefile
vendored
3
3rdparty/bgfx/examples/01-cubes/makefile
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
|
||||
# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
|
||||
# License: http://www.opensource.org/licenses/BSD-2-Clause
|
||||
#
|
||||
|
||||
@ -15,3 +15,4 @@ rebuild:
|
||||
@make -s --no-print-directory TARGET=2 clean all
|
||||
@make -s --no-print-directory TARGET=3 clean all
|
||||
@make -s --no-print-directory TARGET=4 clean all
|
||||
@make -s --no-print-directory TARGET=5 clean all
|
||||
|
2
3rdparty/bgfx/examples/02-metaballs/makefile
vendored
2
3rdparty/bgfx/examples/02-metaballs/makefile
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
|
||||
# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
|
||||
# License: http://www.opensource.org/licenses/BSD-2-Clause
|
||||
#
|
||||
|
||||
|
@ -462,16 +462,16 @@ uint32_t triangulate(uint8_t* _result, uint32_t _stride, const float* __restrict
|
||||
|
||||
#define DIMS 32
|
||||
|
||||
class Metaballs : public entry::AppI
|
||||
class ExampleMetaballs : public entry::AppI
|
||||
{
|
||||
void init(int _argc, char** _argv) BX_OVERRIDE
|
||||
{
|
||||
Args args(_argc, _argv);
|
||||
|
||||
m_width = 1280;
|
||||
m_width = 1280;
|
||||
m_height = 720;
|
||||
m_debug = BGFX_DEBUG_TEXT;
|
||||
m_reset = BGFX_RESET_VSYNC;
|
||||
m_debug = BGFX_DEBUG_TEXT;
|
||||
m_reset = BGFX_RESET_VSYNC;
|
||||
|
||||
bgfx::init(args.m_type, args.m_pciId);
|
||||
bgfx::reset(m_width, m_height, m_reset);
|
||||
@ -778,7 +778,6 @@ class Metaballs : public entry::AppI
|
||||
|
||||
Grid* m_grid;
|
||||
int64_t m_timeOffset;
|
||||
|
||||
};
|
||||
|
||||
ENTRY_IMPLEMENT_MAIN(Metaballs);
|
||||
ENTRY_IMPLEMENT_MAIN(ExampleMetaballs);
|
||||
|
3
3rdparty/bgfx/examples/03-raymarch/makefile
vendored
3
3rdparty/bgfx/examples/03-raymarch/makefile
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2011-2015 Branimir Karadzic. All rights reserved.
|
||||
# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
|
||||
# License: http://www.opensource.org/licenses/BSD-2-Clause
|
||||
#
|
||||
|
||||
@ -15,3 +15,4 @@ rebuild:
|
||||
@make -s --no-print-directory TARGET=2 clean all
|
||||
@make -s --no-print-directory TARGET=3 clean all
|
||||
@make -s --no-print-directory TARGET=4 clean all
|
||||
@make -s --no-print-directory TARGET=5 clean all
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user