From 529b9274a5dc077b6fa98ef6b359966f5970ac19 Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Wed, 3 Sep 2014 00:29:54 -0700 Subject: [PATCH] Cleanup. --- examples/21-deferred/deferred.cpp | 2 +- premake/bgfx.lua | 3 +- src/bgfx.cpp | 56 +++++++++++++++++-------------- 3 files changed, 33 insertions(+), 28 deletions(-) diff --git a/examples/21-deferred/deferred.cpp b/examples/21-deferred/deferred.cpp index 64e54ce0d..eea731264 100644 --- a/examples/21-deferred/deferred.cpp +++ b/examples/21-deferred/deferred.cpp @@ -155,7 +155,7 @@ static const uint16_t s_cubeIndices[36] = 8, 10, 9, 9, 10, 11, - 12, 13, 14, + 12, 13, 14, 13, 15, 14, 16, 18, 17, diff --git a/premake/bgfx.lua b/premake/bgfx.lua index bfd3ea327..f43900f0f 100644 --- a/premake/bgfx.lua +++ b/premake/bgfx.lua @@ -20,13 +20,12 @@ function bgfxProject(_name, _uuid, _kind, _defines) } defines { - -- "BGFX_CONFIG_RENDERER_OPENGL=1", + _defines, } configuration { "Debug" } defines { "BGFX_CONFIG_DEBUG=1", - _defines, } configuration { "android*" } diff --git a/src/bgfx.cpp b/src/bgfx.cpp index e99b224cd..e3f0bebd3 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -503,8 +503,14 @@ namespace bgfx struct Mem { + Mem(const void* _data, size_t _size) + : data(_data) + , size(_size) + { + } + const void* data; - const size_t size; + size_t size; }; const Memory* fragMem[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS]; @@ -514,14 +520,14 @@ namespace bgfx const Mem mem[] = { - { fs_clear0_dx9, sizeof(fs_clear0_dx9) }, - { fs_clear1_dx9, sizeof(fs_clear1_dx9) }, - { fs_clear2_dx9, sizeof(fs_clear2_dx9) }, - { fs_clear3_dx9, sizeof(fs_clear3_dx9) }, - { fs_clear4_dx9, sizeof(fs_clear4_dx9) }, - { fs_clear5_dx9, sizeof(fs_clear5_dx9) }, - { fs_clear6_dx9, sizeof(fs_clear6_dx9) }, - { fs_clear7_dx9, sizeof(fs_clear7_dx9) }, + Mem(fs_clear0_dx9, sizeof(fs_clear0_dx9) ), + Mem(fs_clear1_dx9, sizeof(fs_clear1_dx9) ), + Mem(fs_clear2_dx9, sizeof(fs_clear2_dx9) ), + Mem(fs_clear3_dx9, sizeof(fs_clear3_dx9) ), + Mem(fs_clear4_dx9, sizeof(fs_clear4_dx9) ), + Mem(fs_clear5_dx9, sizeof(fs_clear5_dx9) ), + Mem(fs_clear6_dx9, sizeof(fs_clear6_dx9) ), + Mem(fs_clear7_dx9, sizeof(fs_clear7_dx9) ), }; for (uint32_t ii = 0, num = g_caps.maxFBAttachments; ii < num; ++ii) @@ -535,14 +541,14 @@ namespace bgfx const Mem mem[] = { - { fs_clear0_dx11, sizeof(fs_clear0_dx11) }, - { fs_clear1_dx11, sizeof(fs_clear1_dx11) }, - { fs_clear2_dx11, sizeof(fs_clear2_dx11) }, - { fs_clear3_dx11, sizeof(fs_clear3_dx11) }, - { fs_clear4_dx11, sizeof(fs_clear4_dx11) }, - { fs_clear5_dx11, sizeof(fs_clear5_dx11) }, - { fs_clear6_dx11, sizeof(fs_clear6_dx11) }, - { fs_clear7_dx11, sizeof(fs_clear7_dx11) }, + Mem(fs_clear0_dx11, sizeof(fs_clear0_dx11) ), + Mem(fs_clear1_dx11, sizeof(fs_clear1_dx11) ), + Mem(fs_clear2_dx11, sizeof(fs_clear2_dx11) ), + Mem(fs_clear3_dx11, sizeof(fs_clear3_dx11) ), + Mem(fs_clear4_dx11, sizeof(fs_clear4_dx11) ), + Mem(fs_clear5_dx11, sizeof(fs_clear5_dx11) ), + Mem(fs_clear6_dx11, sizeof(fs_clear6_dx11) ), + Mem(fs_clear7_dx11, sizeof(fs_clear7_dx11) ), }; for (uint32_t ii = 0, num = g_caps.maxFBAttachments; ii < num; ++ii) @@ -557,14 +563,14 @@ namespace bgfx const Mem mem[] = { - { fs_clear0_glsl, sizeof(fs_clear0_glsl) }, - { fs_clear1_glsl, sizeof(fs_clear1_glsl) }, - { fs_clear2_glsl, sizeof(fs_clear2_glsl) }, - { fs_clear3_glsl, sizeof(fs_clear3_glsl) }, - { fs_clear4_glsl, sizeof(fs_clear4_glsl) }, - { fs_clear5_glsl, sizeof(fs_clear5_glsl) }, - { fs_clear6_glsl, sizeof(fs_clear6_glsl) }, - { fs_clear7_glsl, sizeof(fs_clear7_glsl) }, + Mem(fs_clear0_glsl, sizeof(fs_clear0_glsl) ), + Mem(fs_clear1_glsl, sizeof(fs_clear1_glsl) ), + Mem(fs_clear2_glsl, sizeof(fs_clear2_glsl) ), + Mem(fs_clear3_glsl, sizeof(fs_clear3_glsl) ), + Mem(fs_clear4_glsl, sizeof(fs_clear4_glsl) ), + Mem(fs_clear5_glsl, sizeof(fs_clear5_glsl) ), + Mem(fs_clear6_glsl, sizeof(fs_clear6_glsl) ), + Mem(fs_clear7_glsl, sizeof(fs_clear7_glsl) ), }; for (uint32_t ii = 0, num = g_caps.maxFBAttachments; ii < num; ++ii)