mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2025-03-14 00:49:53 -04:00
Cleanup.
This commit is contained in:
parent
3bee46ede9
commit
29b7249fc1
14 changed files with 48 additions and 45 deletions
14
3rdparty/glsl-optimizer/include/c99_compat.h
vendored
14
3rdparty/glsl-optimizer/include/c99_compat.h
vendored
|
@ -134,7 +134,13 @@
|
|||
* C99 __func__ macro
|
||||
*/
|
||||
#ifndef __func__
|
||||
# if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
||||
# if defined(_MSC_VER)
|
||||
# if _MSC_VER >= 1300
|
||||
# define __func__ __FUNCTION__
|
||||
# else
|
||||
# define __func__ "<unknown>"
|
||||
# endif
|
||||
# elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
||||
/* C99 */
|
||||
# elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
|
||||
/* C99 */
|
||||
|
@ -144,12 +150,6 @@
|
|||
# else
|
||||
# define __func__ "<unknown>"
|
||||
# endif
|
||||
# elif defined(_MSC_VER)
|
||||
# if _MSC_VER >= 1300
|
||||
# define __func__ __FUNCTION__
|
||||
# else
|
||||
# define __func__ "<unknown>"
|
||||
# endif
|
||||
# else
|
||||
# define __func__ "<unknown>"
|
||||
# endif
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
* name and parameters.
|
||||
*/
|
||||
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include "main/core.h" /* for struct gl_shader */
|
||||
|
|
|
@ -642,7 +642,7 @@ glsl_type::field_type(const char *name) const
|
|||
return error_type;
|
||||
}
|
||||
|
||||
const glsl_precision
|
||||
glsl_precision
|
||||
glsl_type::field_precision(const char *name) const
|
||||
{
|
||||
if (this->base_type != GLSL_TYPE_STRUCT)
|
||||
|
|
|
@ -578,7 +578,7 @@ struct glsl_type {
|
|||
*/
|
||||
const glsl_type *field_type(const char *name) const;
|
||||
|
||||
const glsl_precision field_precision(const char *name) const;
|
||||
glsl_precision field_precision(const char *name) const;
|
||||
|
||||
|
||||
/**
|
||||
|
|
2
3rdparty/glsl-optimizer/src/glsl/linker.cpp
vendored
2
3rdparty/glsl-optimizer/src/glsl/linker.cpp
vendored
|
@ -2531,7 +2531,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
|||
}
|
||||
|
||||
prog->ARB_fragment_coord_conventions_enable |=
|
||||
prog->Shaders[i]->ARB_fragment_coord_conventions_enable;
|
||||
GLboolean(prog->Shaders[i]->ARB_fragment_coord_conventions_enable);
|
||||
|
||||
gl_shader_stage shader_type = prog->Shaders[i]->Stage;
|
||||
shader_list[shader_type][num_shaders[shader_type]] = prog->Shaders[i];
|
||||
|
|
|
@ -129,7 +129,7 @@ is_less_than_one(ir_constant *ir)
|
|||
return false;
|
||||
|
||||
unsigned component = 0;
|
||||
for (int c = 0; c < ir->type->vector_elements; c++) {
|
||||
for (unsigned c = 0; c < ir->type->vector_elements; c++) {
|
||||
if (ir->get_float_component(c) < 1.0f)
|
||||
component++;
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ is_greater_than_zero(ir_constant *ir)
|
|||
return false;
|
||||
|
||||
unsigned component = 0;
|
||||
for (int c = 0; c < ir->type->vector_elements; c++) {
|
||||
for (unsigned c = 0; c < ir->type->vector_elements; c++) {
|
||||
if (ir->get_float_component(c) > 0.0f)
|
||||
component++;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#ifndef ERRORS_H
|
||||
#define ERRORS_H
|
||||
|
||||
|
||||
#include "c99_compat.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
26
makefile
26
makefile
|
@ -21,7 +21,7 @@ all:
|
|||
$(GENIE) --with-tools --with-shared-lib vs2010
|
||||
$(GENIE) --with-tools --with-shared-lib vs2012
|
||||
$(GENIE) --with-tools --with-shared-lib vs2013
|
||||
$(GENIE) --with-tools --with-shared-lib --gcc=mingw gmake
|
||||
$(GENIE) --with-tools --with-shared-lib --gcc=mingw-gcc gmake
|
||||
$(GENIE) --with-tools --with-shared-lib --gcc=linux-gcc gmake
|
||||
$(GENIE) --with-tools --with-shared-lib --gcc=osx gmake
|
||||
$(GENIE) --with-tools --with-shared-lib xcode4
|
||||
|
@ -81,16 +81,16 @@ linux-release64: .build/projects/gmake-linux
|
|||
make -R -C .build/projects/gmake-linux config=release64
|
||||
linux: linux-debug32 linux-release32 linux-debug64 linux-release64
|
||||
|
||||
.build/projects/gmake-mingw:
|
||||
$(GENIE) --with-tools --with-shared-lib --gcc=mingw gmake
|
||||
mingw-debug32: .build/projects/gmake-mingw
|
||||
make -R -C .build/projects/gmake-mingw config=debug32
|
||||
mingw-release32: .build/projects/gmake-mingw
|
||||
make -R -C .build/projects/gmake-mingw config=release32
|
||||
mingw-debug64: .build/projects/gmake-mingw
|
||||
make -R -C .build/projects/gmake-mingw config=debug64
|
||||
mingw-release64: .build/projects/gmake-mingw
|
||||
make -R -C .build/projects/gmake-mingw config=release64
|
||||
.build/projects/gmake-mingw-gcc:
|
||||
$(GENIE) --with-tools --with-shared-lib --gcc=mingw-gcc gmake
|
||||
mingw-debug32: .build/projects/gmake-mingw-gcc
|
||||
make -R -C .build/projects/gmake-mingw-gcc config=debug32
|
||||
mingw-release32: .build/projects/gmake-mingw-gcc
|
||||
make -R -C .build/projects/gmake-mingw-gcc config=release32
|
||||
mingw-debug64: .build/projects/gmake-mingw-gcc
|
||||
make -R -C .build/projects/gmake-mingw-gcc config=debug64
|
||||
mingw-release64: .build/projects/gmake-mingw-gcc
|
||||
make -R -C .build/projects/gmake-mingw-gcc config=release64
|
||||
mingw: mingw-debug32 mingw-release32 mingw-debug64 mingw-release64
|
||||
|
||||
.build/projects/vs2008:
|
||||
|
@ -214,8 +214,8 @@ EXE=
|
|||
endif
|
||||
else
|
||||
OS=windows
|
||||
BUILD_PROJECT_DIR=gmake-mingw
|
||||
BUILD_OUTPUT_DIR=win32_mingw
|
||||
BUILD_PROJECT_DIR=gmake-mingw-gcc
|
||||
BUILD_OUTPUT_DIR=win32_mingw-gcc
|
||||
BUILD_TOOLS_CONFIG=release32
|
||||
EXE=.exe
|
||||
endif
|
||||
|
|
|
@ -56,7 +56,7 @@ function bgfxProject(_name, _kind, _defines)
|
|||
BGFX_DIR .. "3rdparty/khronos",
|
||||
}
|
||||
|
||||
configuration { "x64", "vs* or mingw" }
|
||||
configuration { "x64", "vs* or mingw*" }
|
||||
defines {
|
||||
"_WIN32_WINNT=0x601",
|
||||
}
|
||||
|
|
|
@ -111,12 +111,17 @@ function exampleProject(_name)
|
|||
"/DELAYLOAD:\"libGLESv2.dll\"",
|
||||
}
|
||||
|
||||
configuration { "windows" }
|
||||
configuration { "vs20* or mingw*" }
|
||||
links {
|
||||
"gdi32",
|
||||
"psapi",
|
||||
}
|
||||
|
||||
configuration { "mingw*" }
|
||||
links {
|
||||
"dxguid",
|
||||
}
|
||||
|
||||
configuration { "mingw-clang" }
|
||||
kind "ConsoleApp"
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ project "shaderc"
|
|||
"/wd4996" -- warning C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup.
|
||||
}
|
||||
|
||||
configuration { "mingw or linux or osx" }
|
||||
configuration { "mingw* or linux or osx" }
|
||||
buildoptions {
|
||||
"-fno-strict-aliasing" -- glsl-optimizer has bugs if strict aliasing is used.
|
||||
}
|
||||
|
|
|
@ -332,10 +332,9 @@ namespace bgfx
|
|||
ID3D11SamplerState* m_sampler[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS];
|
||||
};
|
||||
|
||||
#if BX_COMPILER_CLANG
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wunused-const-variable"
|
||||
#endif // BX_COMPILER_CLANG
|
||||
BX_PRAGMA_DIAGNOSTIC_PUSH();
|
||||
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wunused-const-variable");
|
||||
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wunneeded-internal-declaration");
|
||||
|
||||
static const GUID WKPDID_D3DDebugObjectName = { 0x429b8c22, 0x9188, 0x4b0c, { 0x87, 0x42, 0xac, 0xb0, 0xbf, 0x85, 0xc2, 0x00 } };
|
||||
|
||||
|
@ -355,9 +354,7 @@ namespace bgfx
|
|||
}
|
||||
}
|
||||
|
||||
#if BX_COMPILER_CLANG
|
||||
# pragma GCC diagnostic pop
|
||||
#endif // BX_COMPILER_CLANG
|
||||
BX_PRAGMA_DIAGNOSTIC_POP();
|
||||
|
||||
static BX_NO_INLINE bool getIntelExtensions(ID3D11Device* _device)
|
||||
{
|
||||
|
|
|
@ -13,16 +13,13 @@
|
|||
# define BGFX_CONFIG_DEBUG_PIX 0
|
||||
#endif // !USE_D3D11_DYNAMIC_LIB
|
||||
|
||||
BX_PRAGMA_DIAGNOSTIC_PUSH();
|
||||
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wunknown-pragmas" );
|
||||
BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC("-Wpragmas");
|
||||
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4005) // warning C4005: '' : macro redefinition
|
||||
#define D3D11_NO_HELPERS
|
||||
#if BX_COMPILER_MSVC
|
||||
# pragma warning(push)
|
||||
// winerror.h and dxgitypes.h both define DXGI_ERRORs.
|
||||
# pragma warning(disable:4005) // warning C4005: '' : macro redefinition
|
||||
# include <d3d11.h>
|
||||
# pragma warning(pop)
|
||||
#else
|
||||
# include <d3d11.h>
|
||||
#endif // BX_COMPILER_MSVC
|
||||
#include <d3d11.h>
|
||||
BX_PRAGMA_DIAGNOSTIC_POP()
|
||||
|
||||
#include "renderer_d3d.h"
|
||||
|
||||
|
|
|
@ -72,8 +72,11 @@ extern "C"
|
|||
#if BX_PLATFORM_WINDOWS
|
||||
# include <sal.h>
|
||||
# define __D3DX9MATH_INL__ // not used and MinGW complains about type-punning
|
||||
BX_PRAGMA_DIAGNOSTIC_PUSH();
|
||||
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wundef");
|
||||
# include <d3dx9.h>
|
||||
# include <d3dcompiler.h>
|
||||
BX_PRAGMA_DIAGNOSTIC_POP();
|
||||
#endif // BX_PLATFORM_WINDOWS
|
||||
|
||||
long int fsize(FILE* _file)
|
||||
|
|
Loading…
Reference in a new issue