Previous 199869 Revisions Next

r36307 Saturday 7th March, 2015 at 18:12:51 UTC by Miodrag Milanović
update bgfx (nw)
[3rdparty/bgfx]README.md
[3rdparty/bgfx/examples/23-vectordisplay]vectordisplay.cpp
[3rdparty/bgfx/examples/common/entry]entry_osx.mm
[3rdparty/bgfx/examples/common/imgui]imgui.cpp
[3rdparty/bgfx/include]bgfx.c99.h bgfx.h
[3rdparty/bgfx/scripts]bgfx.lua example-common.lua
[3rdparty/bgfx/src]bgfx.cpp bgfx_compute.sh bgfx_p.h config.h image.cpp renderer_d3d.h renderer_d3d11.cpp renderer_d3d9.cpp renderer_gl.cpp renderer_vk.cpp* vertexdecl.cpp
[3rdparty/bx/include/bx]platform.h
[3rdparty/bx/scripts]toolchain.lua
[3rdparty/bx/tools/bin/darwin]genie
[3rdparty/bx/tools/bin/linux]genie
[3rdparty/bx/tools/bin/windows]genie.exe
[src/lib]lib.mak

trunk/3rdparty/bgfx/README.md
r244818r244819
593593 - Animated mesh example.
594594 - Direct3D 12 renderer backend.
595595 - Metal renderer backend.
596 - Vulkan renderer backend.
596597
597598Contact
598599-------
trunk/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp
r244818r244819
152152void VectorDisplay::endFrame()
153153{
154154   float proj[16];
155   float ident[16];
156   bx::mtxIdentity(ident);
157
158155   bx::mtxOrtho(proj, 0.0f, (float)m_screenWidth, (float)m_screenHeight, 0.0f, 0.0f, 1000.0f);
159156
160157   bgfx::setViewRect(m_view, 0, 0, m_screenWidth, m_screenHeight);
r244818r244819
171168   );
172169   m_vertexBuffersSize[m_currentDrawStep] = (uint32_t)m_points.size();
173170
174   //if the index buffer is cleared from the last "submit"-call everything is fine, but if not
175   //we clear it here again just to be sure it's not set... (the same for the Transform)
176   bgfx::IndexBufferHandle ib;
177   ib.idx = bgfx::invalidHandle;
178   bgfx::setIndexBuffer(ib);
179
180   bgfx::setTransform(ident);
181
182171   for (int loopvar = 0; loopvar < m_numberDecaySteps; loopvar++)
183172   {
184173      int stepi = m_numberDecaySteps - loopvar - 1;
trunk/3rdparty/bgfx/examples/common/entry/entry_osx.mm
r244818r244819
7777   struct Context
7878   {
7979      Context()
80         : m_scroll(0)
80         : m_scrollf(0.0f)
81         , m_mx(0)
82         , m_my(0)
83         , m_scroll(0)
8184         , m_exit(false)
8285      {
8386         s_translateKey[27]             = Key::Esc;
r244818r244819
170173         return mask;
171174      }
172175
173      Key::Enum handleKeyEvent(NSEvent* event, uint8_t* specialKeys)
176      Key::Enum handleKeyEvent(NSEvent* event, uint8_t* specialKeys, uint8_t* _pressedChar)
174177      {
175178         NSString* key = [event charactersIgnoringModifiers];
176179         unichar keyChar = 0;
177//DBG("keyChar %d", keyChar);
178180         if ([key length] == 0)
179181         {
180182            return Key::None;
181183         }
182184
183185         keyChar = [key characterAtIndex:0];
186         *_pressedChar = (uint8_t)keyChar;
184187
185188         int keyCode = keyChar;
186//DBG("keyCode %d", keyCode);
187189         *specialKeys = translateModifiers([event modifierFlags]);
188190
189191         // if this is a unhandled key just return None
r244818r244819
236238               case NSRightMouseDragged:
237239               case NSOtherMouseDragged:
238240               {
239                  int x, y;
240                  getMousePos(&x, &y);
241                  m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll);
241                  getMousePos(&m_mx, &m_my);
242                  m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll);
242243                  break;
243244               }
244245
245246               case NSLeftMouseDown:
246247               {
247                  int x, y;
248                  getMousePos(&x, &y);
249                  m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll, MouseButton::Left, true);
248                  // TODO: remove!
249                  // Shift + Left Mouse Button acts as middle! This just a temporary solution!
250                  // This is becase the average OSX user doesn't have middle mouse click.
251                  MouseButton::Enum mb = ([event modifierFlags] & NSShiftKeyMask) ? MouseButton::Middle : MouseButton::Left;
252                  m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, mb, true);
250253                  break;
251254               }
252255
253256               case NSLeftMouseUp:
254257               {
255                  int x, y;
256                  getMousePos(&x, &y);
257                  m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll, MouseButton::Left, false);
258                  m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Left, false);
259                  m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Middle, false); // TODO: remove!
258260                  break;
259261               }
260262
261263               case NSRightMouseDown:
262264               {
263                  int x, y;
264                  getMousePos(&x, &y);
265                  m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll, MouseButton::Right, true);
265                  m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Right, true);
266266                  break;
267267               }
268268
269269               case NSRightMouseUp:
270270               {
271                  int x, y;
272                  getMousePos(&x, &y);
273                  m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll, MouseButton::Right, false);
271                  m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Right, false);
274272                  break;
275273               }
276274
277275               case NSOtherMouseDown:
278276               {
279                  int x, y;
280                  getMousePos(&x, &y);
281                  m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll, MouseButton::Middle, true);
277                  m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Middle, true);
282278                  break;
283279               }
284280
285281               case NSOtherMouseUp:
286282               {
287                  int x, y;
288                  getMousePos(&x, &y);
289                  m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll, MouseButton::Middle, false);
283                  m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Middle, false);
290284                  break;
291285               }
292286
293287               case NSScrollWheel:
294288               {
295                  int x, y;
296                  getMousePos(&x, &y);
297                  m_scroll += ([event deltaY] > 0.0f) ? 1 : -1;
298                  m_eventQueue.postMouseEvent(s_defaultWindow, x, y, m_scroll);
289                  m_scrollf += [event deltaY];
290
291                  m_scroll = (int32_t)m_scrollf;
292                  m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll);
299293                  break;
300294               }
301295
302296               case NSKeyDown:
303297               {
304298                  uint8_t modifiers = 0;
305                  Key::Enum key = handleKeyEvent(event, &modifiers);
299                  uint8_t pressedChar[4];
300                  Key::Enum key = handleKeyEvent(event, &modifiers, &pressedChar[0]);
306301
307                  // If KeyCode is none we don't don't handle the key and special case for cmd+q (quit)
308                  // Note that return false here means that we take care of the key (instead of the default behavior)
302                  // Returning false means that we take care of the key (instead of the default behavior)
309303                  if (key != Key::None)
310304                  {
311                     if (key != Key::KeyQ
312                     && !(modifiers & Modifier::RightMeta) )
305                     if (key == Key::KeyQ && (modifiers & Modifier::RightMeta) )
313306                     {
307                        m_eventQueue.postExitEvent();
308                     }
309                     else if ( (Key::Key0 <= key && key <= Key::KeyZ)
310                          ||   (Key::Esc  <= key && key <= Key::Minus) )
311                     {
312                        m_eventQueue.postCharEvent(s_defaultWindow, 1, pressedChar);
313                        return false;
314                     }
315                     else
316                     {
314317                        m_eventQueue.postKeyEvent(s_defaultWindow, key, modifiers, true);
315318                        return false;
316319                     }
r244818r244819
322325               case NSKeyUp:
323326               {
324327                  uint8_t modifiers  = 0;
325                  Key::Enum key = handleKeyEvent(event, &modifiers);
328                  uint8_t pressedChar[4];
329                  Key::Enum key = handleKeyEvent(event, &modifiers, &pressedChar[0]);
326330
331                  BX_UNUSED(pressedChar);
332
327333                  if (key != Key::None)
328334                  {
329335                     m_eventQueue.postKeyEvent(s_defaultWindow, key, modifiers, false);
r244818r244819
347353      {
348354         WindowHandle handle = { 0 };
349355         NSWindow* window = m_window[handle.idx];
350         NSRect rect = [window frame];
356         NSRect originalFrame = [window frame];
357         NSRect rect = [NSWindow contentRectForFrameRect: originalFrame styleMask: NSTitledWindowMask];
351358         uint32_t width  = uint32_t(rect.size.width);
352359         uint32_t height = uint32_t(rect.size.height);
353360         m_eventQueue.postSizeEvent(handle, width, height);
361
362         // Make sure mouse button state is 'up' after resize.
363         m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Left,  false);
364         m_eventQueue.postMouseEvent(s_defaultWindow, m_mx, m_my, m_scroll, MouseButton::Right, false);
354365      }
355366
356367      int32_t run(int _argc, char** _argv)
r244818r244819
429440            }
430441         }
431442
432
433443         m_eventQueue.postExitEvent();
434444
435445         while (bgfx::RenderFrame::NoContext != bgfx::renderFrame() ) {};
r244818r244819
443453      bx::HandleAllocT<ENTRY_CONFIG_MAX_WINDOWS> m_windowAlloc;
444454      NSWindow* m_window[ENTRY_CONFIG_MAX_WINDOWS];
445455
456      float   m_scrollf;
457      int32_t m_mx;
458      int32_t m_my;
446459      int32_t m_scroll;
447      bool m_exit;
460      bool    m_exit;
448461   };
449462
450463   static Context s_ctx;
trunk/3rdparty/bgfx/examples/common/imgui/imgui.cpp
r244818r244819
14051405      {
14061406         const size_t cursor = size_t(strlen(_str));
14071407
1408         if (m_char == 0x08) //backspace
1408         if (m_char == 0x08 || m_char == 0x7f) //backspace or delete
14091409         {
14101410            _str[cursor-1] = '\0';
14111411         }
trunk/3rdparty/bgfx/include/bgfx.c99.h
r244818r244819
1919    BGFX_RENDERER_TYPE_NULL,
2020    BGFX_RENDERER_TYPE_DIRECT3D9,
2121    BGFX_RENDERER_TYPE_DIRECT3D11,
22    BGFX_RENDERER_TYPE_OPENGLES = 4,
22    BGFX_RENDERER_TYPE_DIRECT3D12,
23    BGFX_RENDERER_TYPE_OPENGLES,
2324    BGFX_RENDERER_TYPE_OPENGL,
25    BGFX_RENDERER_TYPE_VULKAN,
2426
2527    BGFX_RENDERER_TYPE_COUNT
2628
r244818r244819
104106    BGFX_TEXTURE_FORMAT_RG32,
105107    BGFX_TEXTURE_FORMAT_RG32F,
106108    BGFX_TEXTURE_FORMAT_BGRA8,
109    BGFX_TEXTURE_FORMAT_RGBA8,
107110    BGFX_TEXTURE_FORMAT_RGBA16,
108111    BGFX_TEXTURE_FORMAT_RGBA16F,
109112    BGFX_TEXTURE_FORMAT_RGBA32,
trunk/3rdparty/bgfx/include/bgfx.h
r244818r244819
4949         Direct3D12,   //!< Direct3D 12.0
5050         OpenGLES,     //!< OpenGL ES 2.0+
5151         OpenGL,       //!< OpenGL 2.1+
52         Vulkan,       //!< Vulkan
5253
5354         Count
5455      };
r244818r244819
142143         RG32,
143144         RG32F,
144145         BGRA8,
146         RGBA8,
145147         RGBA16,
146148         RGBA16F,
147149         RGBA32,
trunk/3rdparty/bgfx/scripts/bgfx.lua
r244818r244819
6262            "$(DXSDK_DIR)/include",
6363         }
6464
65      if (_OPTIONS["vs"] == "vs2012-xp") or (_OPTIONS["vs"] == "vs2013-xp") then
66      configuration { "vs201*" }
67         includedirs {
68            "$(DXSDK_DIR)/include",
69         }
70      end
71
6572      configuration { "winphone8*"}
6673         linkoptions {
6774            "/ignore:4264" -- LNK4264: archiving object file compiled with /ZW into a static library; note that when authoring Windows Runtime types it is not recommended to link with a static library that contains Windows Runtime metadata
trunk/3rdparty/bgfx/scripts/example-common.lua
r244818r244819
3535      includedirs {
3636         "$(DXSDK_DIR)/include",
3737      }
38   if (_OPTIONS["vs"] == "vs2012-xp") or (_OPTIONS["vs"] == "vs2013-xp") then
39   configuration { "vs201*" }
40      includedirs {
41         "$(DXSDK_DIR)/include",
42      }
43   end
3844
39
4045   configuration { "winphone8*"}
4146      linkoptions {
4247         "/ignore:4264" -- LNK4264: archiving object file compiled with /ZW into a static library; note that when authoring Windows Runtime types it is not recommended to link with a static library that contains Windows Runtime metadata
trunk/3rdparty/bgfx/src/bgfx.cpp
r244818r244819
972972         m_viewRemap[ii] = ii;
973973      }
974974
975      memset(m_fb, 0xff, sizeof(m_fb) );
976      memset(m_clear, 0, sizeof(m_clear) );
977      memset(m_rect, 0, sizeof(m_rect) );
975      memset(m_fb,   0xff, sizeof(m_fb) );
976      memset(m_clear,   0, sizeof(m_clear) );
977      memset(m_rect,    0, sizeof(m_rect) );
978978      memset(m_scissor, 0, sizeof(m_scissor) );
979      memset(m_seq, 0, sizeof(m_seq) );
979      memset(m_seq,     0, sizeof(m_seq) );
980980      memset(m_seqMask, 0, sizeof(m_seqMask) );
981981
982982      for (uint32_t ii = 0; ii < BX_COUNTOF(m_rect); ++ii)
983983      {
984         m_rect[ii].m_width = 1;
984         m_rect[ii].m_width = 1;
985985         m_rect[ii].m_height = 1;
986986      }
987987
r244818r244819
13471347   extern RendererContextI* rendererCreateD3D12();
13481348   extern void rendererDestroyD3D12();
13491349
1350   extern RendererContextI* rendererCreateVK();
1351   extern void rendererDestroyVK();
1352
13501353   struct RendererCreator
13511354   {
13521355      RendererCreateFn  createFn;
r244818r244819
13631366      { rendererCreateD3D12, rendererDestroyD3D12, BGFX_RENDERER_DIRECT3D12_NAME, !!BGFX_CONFIG_RENDERER_DIRECT3D12 }, // Direct3D12
13641367      { rendererCreateGL,    rendererDestroyGL,    BGFX_RENDERER_OPENGL_NAME,     !!BGFX_CONFIG_RENDERER_OPENGLES   }, // OpenGLES
13651368      { rendererCreateGL,    rendererDestroyGL,    BGFX_RENDERER_OPENGL_NAME,     !!BGFX_CONFIG_RENDERER_OPENGL     }, // OpenGL
1369      { rendererCreateVK,    rendererDestroyVK,    BGFX_RENDERER_VULKAN_NAME,     !!BGFX_CONFIG_RENDERER_VULKAN     }, // Vulkan
13661370   };
13671371   BX_STATIC_ASSERT(BX_COUNTOF(s_rendererCreator) == RendererType::Count);
13681372
r244818r244819
14461450            {
14471451               _type = RendererType::OpenGLES;
14481452            }
1453            else if (s_rendererCreator[RendererType::Vulkan].supported)
1454            {
1455               _type = RendererType::Vulkan;
1456            }
14491457         }
14501458         else if (BX_ENABLED(0
14511459             ||  BX_PLATFORM_ANDROID
trunk/3rdparty/bgfx/src/bgfx_compute.sh
r244818r244819
4444
4545#define SHARED groupshared
4646
47#define IMAGE2D_RO(_name, _reg) Texture2D           _name : register(t[_reg])
48#define IMAGE2D_RW(_name, _reg) RWTexture2D<float4> _name : register(u[_reg])
49#define IMAGE2D_WR(_name, _reg) IMAGE2D_RW(_name, _reg)
47#define r32ui  uint
48#define r32f   float
49#define rg16f  float2
50#define rgba8  float4
5051
52#define IMAGE2D_RO( _name, _format, _reg) Texture2D<_format>   _name : register(t[_reg])
53#define UIMAGE2D_RO(_name, _format, _reg) Texture2D<_format>   _name : register(t[_reg])
54#define IMAGE2D_WR( _name, _format, _reg) RWTexture2D<_format> _name : register(u[_reg])
55#define UIMAGE2D_WR(_name, _format, _reg) RWTexture2D<_format> _name : register(u[_reg])
56#define IMAGE2D_RW( _name, _reg) RWTexture2D<float> _name : register(u[_reg])
57#define UIMAGE2D_RW(_name, _reg) RWTexture2D<uint>  _name : register(u[_reg])
58
5159#define BUFFER_RO(_name, _struct, _reg) Buffer<_struct>   _name : register(b[_reg])
5260#define BUFFER_RW(_name, _struct, _reg) RWBuffer<_struct> _name : register(u[_reg])
5361#define BUFFER_WR(_name, _struct, _reg) BUFFER_RW(_name, _struct, _reg)
r244818r244819
153161
154162#define SHARED shared
155163
156#define __IMAGE2D_XX(_name, _reg, _access) \
157         layout(rgba8, binding=_reg) _access uniform highp image2D _name
164#define __IMAGE_XX(_name, _format, _reg, _image, _access) \
165         layout(_format, binding=_reg) _access uniform highp _image _name
158166
159167#define readwrite
160#define IMAGE2D_RO(_name, _reg) __IMAGE2D_XX(_name, _reg, readonly)
161#define IMAGE2D_RW(_name, _reg) __IMAGE2D_XX(_name, _reg, readwrite)
162#define IMAGE2D_WR(_name, _reg) __IMAGE2D_XX(_name, _reg, writeonly)
168#define IMAGE2D_RO( _name, _format, _reg) __IMAGE_XX(_name, _format, _reg, image2D,  readonly)
169#define UIMAGE2D_RO(_name, _format, _reg) __IMAGE_XX(_name, _format, _reg, uimage2D, readonly)
170#define IMAGE2D_WR( _name, _format, _reg) __IMAGE_XX(_name, _format, _reg, image2D,  writeonly)
171#define UIMAGE2D_WR(_name, _format, _reg) __IMAGE_XX(_name, _format, _reg, uimage2D, writeonly)
172#define IMAGE2D_RW( _name, _reg) __IMAGE_XX(_name, r32f,  _reg, image2D,  readwrite)
173#define UIMAGE2D_RW(_name, _reg) __IMAGE_XX(_name, r32ui, _reg, uimage2D, readwrite)
163174
164175#define __BUFFER_XX(_name, _type, _reg, _access) \
165176         layout(std430, binding=_reg) _access buffer _name ## Buffer \
trunk/3rdparty/bgfx/src/bgfx_p.h
r244818r244819
154154#define BGFX_RENDERER_DIRECT3D9_NAME  "Direct3D 9"
155155#define BGFX_RENDERER_DIRECT3D11_NAME "Direct3D 11"
156156#define BGFX_RENDERER_DIRECT3D12_NAME "Direct3D 12"
157#define BGFX_RENDERER_VULKAN_NAME "Vulkan"
157158#define BGFX_RENDERER_NULL_NAME "NULL"
158159
159160#if BGFX_CONFIG_RENDERER_OPENGL
r244818r244819
32603261      BGFX_API_FUNC(void setImage(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format) )
32613262      {
32623263         _format = TextureFormat::Count == _format ? TextureFormat::Enum(m_textureRef[_handle.idx].m_format) : _format;
3264         BX_CHECK(_format != TextureFormat::BGRA8
3265               , "Can't use TextureFormat::BGRA8 with compute, use TextureFormat::RGBA8 instead."
3266               );
32633267         m_submit->setImage(_stage, _sampler, _handle, _mip, _access, _format);
32643268      }
32653269
trunk/3rdparty/bgfx/src/config.h
r244818r244819
1717   && !defined(BGFX_CONFIG_RENDERER_DIRECT3D12) \
1818   && !defined(BGFX_CONFIG_RENDERER_OPENGL) \
1919   && !defined(BGFX_CONFIG_RENDERER_OPENGLES) \
20   && !defined(BGFX_CONFIG_RENDERER_VULKAN) \
2021   && !defined(BGFX_CONFIG_RENDERER_NULL)
2122
2223#   ifndef BGFX_CONFIG_RENDERER_DIRECT3D9
r244818r244819
5960               ? 1 : 0)
6061#   endif // BGFX_CONFIG_RENDERER_OPENGLES
6162
63#   ifndef BGFX_CONFIG_RENDERER_VULKAN
64#      define BGFX_CONFIG_RENDERER_VULKAN 0
65#   endif // BGFX_CONFIG_RENDERER_VULKAN
66
6267#   ifndef BGFX_CONFIG_RENDERER_NULL
6368#      define BGFX_CONFIG_RENDERER_NULL (!(0 \
6469               || BGFX_CONFIG_RENDERER_DIRECT3D9 \
r244818r244819
8994#      define BGFX_CONFIG_RENDERER_OPENGLES 0
9095#   endif // BGFX_CONFIG_RENDERER_OPENGLES
9196
97#   ifndef BGFX_CONFIG_RENDERER_VULKAN
98#      define BGFX_CONFIG_RENDERER_VULKAN 0
99#   endif // BGFX_CONFIG_RENDERER_VULKAN
100
92101#   ifndef BGFX_CONFIG_RENDERER_NULL
93102#      define BGFX_CONFIG_RENDERER_NULL 0
94103#   endif // BGFX_CONFIG_RENDERER_NULL
trunk/3rdparty/bgfx/src/image.cpp
r244818r244819
4949      {  64, 1, 1,  8, 1, 1 }, // RG32
5050      {  64, 1, 1,  8, 1, 1 }, // RG32F
5151      {  32, 1, 1,  4, 1, 1 }, // BGRA8
52      {  32, 1, 1,  4, 1, 1 }, // RGBA8
5253      {  64, 1, 1,  8, 1, 1 }, // RGBA16
5354      {  64, 1, 1,  8, 1, 1 }, // RGBA16F
5455      { 128, 1, 1, 16, 1, 1 }, // RGBA32
r244818r244819
102103      "RG32",       // RG32
103104      "RG32F",      // RG32F
104105      "BGRA8",      // BGRA8
106      "RGBA8",      // RGBA8
105107      "RGBA16",     // RGBA16
106108      "RGBA16F",    // RGBA16F
107109      "RGBA32",     // RGBA32
trunk/3rdparty/bgfx/src/renderer_d3d.h
r244818r244819
138138      HashMap m_hashMap;
139139   };
140140
141   class StateCache
142   {
143   public:
144      void add(uint64_t _id, uint16_t _item)
145      {
146         invalidate(_id);
147         m_hashMap.insert(stl::make_pair(_id, _item));
148      }
149
150      uint16_t find(uint64_t _id)
151      {
152         HashMap::iterator it = m_hashMap.find(_id);
153         if (it != m_hashMap.end())
154         {
155            return it->second;
156         }
157
158         return UINT16_MAX;
159      }
160
161      void invalidate(uint64_t _id)
162      {
163         HashMap::iterator it = m_hashMap.find(_id);
164         if (it != m_hashMap.end())
165         {
166            m_hashMap.erase(it);
167         }
168      }
169
170      void invalidate()
171      {
172         m_hashMap.clear();
173      }
174
175      uint32_t getCount() const
176      {
177         return uint32_t(m_hashMap.size());
178      }
179
180   private:
181      typedef stl::unordered_map<uint64_t, uint16_t> HashMap;
182      HashMap m_hashMap;
183   };
184
141185} // namespace bgfx
142186
143187#endif // BGFX_RENDERER_D3D_H_HEADER_GUARD
trunk/3rdparty/bgfx/src/renderer_d3d11.cpp
r244818r244819
213213      { DXGI_FORMAT_R32G32_UINT,        DXGI_FORMAT_R32G32_UINT,           DXGI_FORMAT_UNKNOWN           }, // RG32
214214      { DXGI_FORMAT_R32G32_FLOAT,       DXGI_FORMAT_R32G32_FLOAT,          DXGI_FORMAT_UNKNOWN           }, // RG32F
215215      { DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_B8G8R8A8_UNORM,        DXGI_FORMAT_UNKNOWN           }, // BGRA8
216      { DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_R8G8B8A8_UNORM,        DXGI_FORMAT_UNKNOWN           }, // RGBA8
216217      { DXGI_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_R16G16B16A16_UNORM,    DXGI_FORMAT_UNKNOWN           }, // RGBA16
217218      { DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT,    DXGI_FORMAT_UNKNOWN           }, // RGBA16F
218219      { DXGI_FORMAT_R32G32B32A32_UINT,  DXGI_FORMAT_R32G32B32A32_UINT,     DXGI_FORMAT_UNKNOWN           }, // RGBA32
trunk/3rdparty/bgfx/src/renderer_d3d9.cpp
r244818r244819
219219      { D3DFMT_UNKNOWN       }, // RG32
220220      { D3DFMT_G32R32F       }, // RG32F
221221      { D3DFMT_A8R8G8B8      }, // BGRA8
222      { D3DFMT_A8R8G8B8      }, // RGBA8
222223      { D3DFMT_A16B16G16R16  }, // RGBA16
223224      { D3DFMT_A16B16G16R16F }, // RGBA16F
224225      { D3DFMT_UNKNOWN       }, // RGBA32
trunk/3rdparty/bgfx/src/renderer_gl.cpp
r244818r244819
215215      { GL_RG32UI,                                   GL_RG,                                       GL_UNSIGNED_INT,                 true  }, // RG32
216216      { GL_RG32F,                                    GL_RG,                                       GL_FLOAT,                        true  }, // RG32F
217217      { GL_RGBA,                                     GL_RGBA,                                     GL_UNSIGNED_BYTE,                true  }, // BGRA8
218      { GL_RGBA,                                     GL_RGBA,                                     GL_UNSIGNED_BYTE,                true  }, // RGBA8
218219      { GL_RGBA16,                                   GL_RGBA,                                     GL_UNSIGNED_BYTE,                true  }, // RGBA16
219220      { GL_RGBA16F,                                  GL_RGBA,                                     GL_HALF_FLOAT,                   true  }, // RGBA16F
220221      { GL_RGBA32UI,                                 GL_RGBA,                                     GL_UNSIGNED_INT,                 true  }, // RGBA32
r244818r244819
268269      GL_RG32UI,             // RG32
269270      GL_RG32F,              // RG32F
270271      GL_RGBA8,              // BGRA8
272      GL_RGBA8,              // RGBA8
271273      GL_RGBA16,             // RGBA16
272274      GL_RGBA16F,            // RGBA16F
273275      GL_RGBA32UI,           // RGBA32
r244818r244819
321323      GL_RG32UI,         // RG32
322324      GL_RG32F,          // RG32F
323325      GL_RGBA8,          // BGRA8
326      GL_RGBA8,          // RGBA8
324327      GL_RGBA16,         // RGBA16
325328      GL_RGBA16F,        // RGBA16F
326329      GL_RGBA32UI,       // RGBA32
trunk/3rdparty/bgfx/src/renderer_vk.cpp
r0r244819
1/*
2 * Copyright 2011-2015 Branimir Karadzic. All rights reserved.
3 * License: http://www.opensource.org/licenses/BSD-2-Clause
4 */
5
6#include "bgfx_p.h"
7#if BGFX_CONFIG_RENDERER_VULKAN
8#   include "../../vk/src/renderer_vk.cpp"
9#else
10
11namespace bgfx
12{
13   RendererContextI* rendererCreateVK()
14   {
15      return NULL;
16   }
17
18   void rendererDestroyVK()
19   {
20   }
21} // namespace bgfx
22
23#endif // BGFX_CONFIG_RENDERER_VULKAN
trunk/3rdparty/bgfx/src/vertexdecl.cpp
r244818r244819
4545      &s_attribTypeSizeDx9,
4646#elif BGFX_CONFIG_RENDERER_DIRECT3D11 || BGFX_CONFIG_RENDERER_DIRECT3D12
4747      &s_attribTypeSizeDx1x,
48#elif BGFX_CONFIG_RENDERER_OPENGL || BGFX_CONFIG_RENDERER_OPENGLES
48#elif BGFX_CONFIG_RENDERER_OPENGL || BGFX_CONFIG_RENDERER_OPENGLES || BGFX_CONFIG_RENDERER_VULKAN
4949      &s_attribTypeSizeGl,
5050#else
5151      &s_attribTypeSizeDx9,
r244818r244819
5555      &s_attribTypeSizeDx1x, // Direct3D12
5656      &s_attribTypeSizeGl,   // OpenGLES
5757      &s_attribTypeSizeGl,   // OpenGL
58      &s_attribTypeSizeGl,   // Vulkan
5859   };
5960   BX_STATIC_ASSERT(BX_COUNTOF(s_attribTypeSize) == bgfx::RendererType::Count);
6061
r244818r244819
140141      _asInt      = !!(val&(1<<7) );
141142   }
142143
143   static const char* s_attrName[] =
144   static const char* s_attrName[] =
144145   {
145146      "Attrib::Position",
146147      "Attrib::Normal",
trunk/3rdparty/bx/include/bx/platform.h
r244818r244819
125125#   ifndef NOMINMAX
126126#      define NOMINMAX
127127#   endif // NOMINMAX
128#   if defined(_MSC_VER) && (_MSC_VER >= 1700)
128//  If _USING_V110_SDK71_ is defined it means we are using the v110_xp or v120_xp toolset.
129#   if defined(_MSC_VER) && (_MSC_VER >= 1700) && (!_USING_V110_SDK71_)
129130#      include <winapifamily.h>
130#   endif // defined(_MSC_VER) && (_MSC_VER >= 1700)
131#   endif // defined(_MSC_VER) && (_MSC_VER >= 1700) && (!_USING_V110_SDK71_)
131132#   if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
132133#      undef  BX_PLATFORM_WINDOWS
133134#      if !defined(WINVER) && !defined(_WIN32_WINNT)
trunk/3rdparty/bx/scripts/toolchain.lua
r244818r244819
4040      allowed = {
4141         { "vs2012-clang",  "Clang 3.6"         },
4242         { "vs2013-clang",  "Clang 3.6"         },
43         { "vs2012-xp",       "Visual Studio 2012 targeting XP" },
44         { "vs2013-xp",       "Visual Studio 2013 targeting XP" },
4345         { "winphone8",     "Windows Phone 8.0" },
4446         { "winphone81",    "Windows Phone 8.1" },
4547      },
r244818r244819
291293         platforms { "ARM" }
292294         location (path.join(_buildDir, "projects", _ACTION .. "-winphone81"))
293295      end
296
297      if ("vs2012-xp") == _OPTIONS["vs"] then
298         premake.vstudio.toolset = ("v110_xp")
299         location (path.join(_buildDir, "projects", _ACTION .. "-xp"))
300      end
301     
302      if ("vs2013-xp") == _OPTIONS["vs"] then
303         premake.vstudio.toolset = ("v120_xp")
304         location (path.join(_buildDir, "projects", _ACTION .. "-xp"))
305      end
306     
294307   elseif _ACTION == "xcode4" then
295308
296309      if "osx" == _OPTIONS["xcode"] then
trunk/3rdparty/bx/tools/bin/darwin/genie
r244818r244819
Previous 199869 Revisions Next


© 1997-2024 The MAME Team