DX WIP
This commit is contained in:
parent
104c2748c1
commit
2fa14fb024
11 changed files with 26 additions and 20 deletions
3
external/bgfx/include/bgfx.c99.h
vendored
3
external/bgfx/include/bgfx.c99.h
vendored
|
@ -66,6 +66,7 @@ typedef enum bgfx_attrib
|
||||||
typedef enum bgfx_attrib_type
|
typedef enum bgfx_attrib_type
|
||||||
{
|
{
|
||||||
BGFX_ATTRIB_TYPE_UINT8,
|
BGFX_ATTRIB_TYPE_UINT8,
|
||||||
|
BGFX_ATTRIB_TYPE_UINT10,
|
||||||
BGFX_ATTRIB_TYPE_INT16,
|
BGFX_ATTRIB_TYPE_INT16,
|
||||||
BGFX_ATTRIB_TYPE_HALF,
|
BGFX_ATTRIB_TYPE_HALF,
|
||||||
BGFX_ATTRIB_TYPE_FLOAT,
|
BGFX_ATTRIB_TYPE_FLOAT,
|
||||||
|
@ -236,7 +237,7 @@ typedef struct bgfx_vertex_decl
|
||||||
uint32_t hash;
|
uint32_t hash;
|
||||||
uint16_t stride;
|
uint16_t stride;
|
||||||
uint16_t offset[BGFX_ATTRIB_COUNT];
|
uint16_t offset[BGFX_ATTRIB_COUNT];
|
||||||
uint8_t attributes[BGFX_ATTRIB_COUNT];
|
uint16_t attributes[BGFX_ATTRIB_COUNT];
|
||||||
|
|
||||||
} bgfx_vertex_decl_t;
|
} bgfx_vertex_decl_t;
|
||||||
|
|
||||||
|
|
5
external/bgfx/include/bgfx.h
vendored
5
external/bgfx/include/bgfx.h
vendored
|
@ -120,8 +120,9 @@ namespace bgfx
|
||||||
enum Enum
|
enum Enum
|
||||||
{
|
{
|
||||||
Uint8,
|
Uint8,
|
||||||
|
Uint10, //!< Availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_UINT10`.
|
||||||
Int16,
|
Int16,
|
||||||
Half, // Availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_HALF`.
|
Half, //!< Availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_HALF`.
|
||||||
Float,
|
Float,
|
||||||
|
|
||||||
Count
|
Count
|
||||||
|
@ -607,7 +608,7 @@ namespace bgfx
|
||||||
uint32_t m_hash;
|
uint32_t m_hash;
|
||||||
uint16_t m_stride;
|
uint16_t m_stride;
|
||||||
uint16_t m_offset[Attrib::Count];
|
uint16_t m_offset[Attrib::Count];
|
||||||
uint8_t m_attributes[Attrib::Count];
|
uint16_t m_attributes[Attrib::Count];
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Pack vec4 into vertex stream format.
|
/// Pack vec4 into vertex stream format.
|
||||||
|
|
21
external/bgfx/include/bgfxdefines.h
vendored
21
external/bgfx/include/bgfxdefines.h
vendored
|
@ -344,16 +344,17 @@
|
||||||
#define BGFX_CAPS_TEXTURE_COMPARE_ALL UINT64_C(0x0000000000000003) //!< All texture compare modes are supported.
|
#define BGFX_CAPS_TEXTURE_COMPARE_ALL UINT64_C(0x0000000000000003) //!< All texture compare modes are supported.
|
||||||
#define BGFX_CAPS_TEXTURE_3D UINT64_C(0x0000000000000004) //!< 3D textures are supported.
|
#define BGFX_CAPS_TEXTURE_3D UINT64_C(0x0000000000000004) //!< 3D textures are supported.
|
||||||
#define BGFX_CAPS_VERTEX_ATTRIB_HALF UINT64_C(0x0000000000000008) //!< Vertex attribute half-float is supported.
|
#define BGFX_CAPS_VERTEX_ATTRIB_HALF UINT64_C(0x0000000000000008) //!< Vertex attribute half-float is supported.
|
||||||
#define BGFX_CAPS_INSTANCING UINT64_C(0x0000000000000010) //!< Instancing is supported.
|
#define BGFX_CAPS_VERTEX_ATTRIB_UINT10 UINT64_C(0x0000000000000010) //!< Vertex attribute 10_10_10_2 is supported.
|
||||||
#define BGFX_CAPS_RENDERER_MULTITHREADED UINT64_C(0x0000000000000020) //!< Renderer is on separate thread.
|
#define BGFX_CAPS_INSTANCING UINT64_C(0x0000000000000020) //!< Instancing is supported.
|
||||||
#define BGFX_CAPS_FRAGMENT_DEPTH UINT64_C(0x0000000000000040) //!< Fragment depth is accessible in fragment shader.
|
#define BGFX_CAPS_RENDERER_MULTITHREADED UINT64_C(0x0000000000000040) //!< Renderer is on separate thread.
|
||||||
#define BGFX_CAPS_BLEND_INDEPENDENT UINT64_C(0x0000000000000080) //!< Blend independent is supported.
|
#define BGFX_CAPS_FRAGMENT_DEPTH UINT64_C(0x0000000000000080) //!< Fragment depth is accessible in fragment shader.
|
||||||
#define BGFX_CAPS_COMPUTE UINT64_C(0x0000000000000100) //!< Compute shaders are supported.
|
#define BGFX_CAPS_BLEND_INDEPENDENT UINT64_C(0x0000000000000100) //!< Blend independent is supported.
|
||||||
#define BGFX_CAPS_FRAGMENT_ORDERING UINT64_C(0x0000000000000200) //!< Fragment ordering is available in fragment shader.
|
#define BGFX_CAPS_COMPUTE UINT64_C(0x0000000000000200) //!< Compute shaders are supported.
|
||||||
#define BGFX_CAPS_SWAP_CHAIN UINT64_C(0x0000000000000400) //!< Multiple windows are supported.
|
#define BGFX_CAPS_FRAGMENT_ORDERING UINT64_C(0x0000000000000400) //!< Fragment ordering is available in fragment shader.
|
||||||
#define BGFX_CAPS_HMD UINT64_C(0x0000000000000800) //!< Head Mounted Display is available.
|
#define BGFX_CAPS_SWAP_CHAIN UINT64_C(0x0000000000000800) //!< Multiple windows are supported.
|
||||||
#define BGFX_CAPS_INDEX32 UINT64_C(0x0000000000001000) //!< 32-bit indices are supported.
|
#define BGFX_CAPS_HMD UINT64_C(0x0000000000001000) //!< Head Mounted Display is available.
|
||||||
#define BGFX_CAPS_DRAW_INDIRECT UINT64_C(0x0000000000002000) //!< Draw indirect is supported.
|
#define BGFX_CAPS_INDEX32 UINT64_C(0x0000000000002000) //!< 32-bit indices are supported.
|
||||||
|
#define BGFX_CAPS_DRAW_INDIRECT UINT64_C(0x0000000000004000) //!< Draw indirect is supported.
|
||||||
|
|
||||||
///
|
///
|
||||||
#define BGFX_CAPS_FORMAT_TEXTURE_NONE UINT8_C(0x00) //!<
|
#define BGFX_CAPS_FORMAT_TEXTURE_NONE UINT8_C(0x00) //!<
|
||||||
|
|
BIN
external/bgfx/lib/bgfxDebug.lib
vendored
BIN
external/bgfx/lib/bgfxDebug.lib
vendored
Binary file not shown.
BIN
external/bgfx/lib/bgfxRelease.lib
vendored
BIN
external/bgfx/lib/bgfxRelease.lib
vendored
Binary file not shown.
BIN
external/bgfx/lib/bgfxdebug.pdb
vendored
BIN
external/bgfx/lib/bgfxdebug.pdb
vendored
Binary file not shown.
BIN
external/bgfx/lib/bgfxrelease.pdb
vendored
BIN
external/bgfx/lib/bgfxrelease.pdb
vendored
Binary file not shown.
|
@ -19,7 +19,7 @@ FrameBuffer::FrameBuffer(const Declaration& decl)
|
||||||
for (int i = 0; i < decl.m_renderbuffers_count; ++i)
|
for (int i = 0; i < decl.m_renderbuffers_count; ++i)
|
||||||
{
|
{
|
||||||
const RenderBuffer& renderbuffer = decl.m_renderbuffers[i];
|
const RenderBuffer& renderbuffer = decl.m_renderbuffers[i];
|
||||||
texture_handles[i] = bgfx::createTexture2D(decl.m_width, decl.m_height, 1, renderbuffer.m_format, 0);
|
texture_handles[i] = bgfx::createTexture2D(decl.m_width, decl.m_height, 1, renderbuffer.m_format, BGFX_TEXTURE_RT);
|
||||||
m_declaration.m_renderbuffers[i].m_handle = texture_handles[i];
|
m_declaration.m_renderbuffers[i].m_handle = texture_handles[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -284,6 +284,11 @@ const char* Material::getTextureUniform(int i)
|
||||||
|
|
||||||
Texture* Material::getTextureByUniform(const char* uniform) const
|
Texture* Material::getTextureByUniform(const char* uniform) const
|
||||||
{
|
{
|
||||||
|
if (!m_shader)
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0, c = m_shader->getTextureSlotCount(); i < c; ++i)
|
for (int i = 0, c = m_shader->getTextureSlotCount(); i < c; ++i)
|
||||||
{
|
{
|
||||||
if (strcmp(m_shader->getTextureSlot(i).m_uniform, uniform) == 0)
|
if (strcmp(m_shader->getTextureSlot(i).m_uniform, uniform) == 0)
|
||||||
|
|
|
@ -1242,8 +1242,7 @@ struct PipelineInstanceImpl : public PipelineInstance
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TODO("todo");
|
bgfx::reset(w, h);
|
||||||
//bgfx::reset(w, h);
|
|
||||||
}
|
}
|
||||||
m_width = w;
|
m_width = w;
|
||||||
m_height = h;
|
m_height = h;
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include "physics/physics_system.h"
|
#include "physics/physics_system.h"
|
||||||
#include "sceneview.h"
|
#include "sceneview.h"
|
||||||
#include "gameview.h"
|
#include "gameview.h"
|
||||||
#include "wgl_render_device.h"
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <qdir.h>
|
#include <qdir.h>
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
@ -79,6 +78,9 @@ public:
|
||||||
m_memory_device =
|
m_memory_device =
|
||||||
m_allocator.newObject<Lumix::FS::MemoryFileDevice>(m_allocator);
|
m_allocator.newObject<Lumix::FS::MemoryFileDevice>(m_allocator);
|
||||||
m_file_system->mount(m_memory_device);
|
m_file_system->mount(m_memory_device);
|
||||||
|
m_disk_device =
|
||||||
|
m_allocator.newObject<Lumix::FS::DiskFileDevice>(m_allocator);
|
||||||
|
m_file_system->mount(m_disk_device);
|
||||||
|
|
||||||
if (is_network)
|
if (is_network)
|
||||||
{
|
{
|
||||||
|
@ -97,9 +99,6 @@ public:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_disk_device =
|
|
||||||
m_allocator.newObject<Lumix::FS::DiskFileDevice>(m_allocator);
|
|
||||||
m_file_system->mount(m_disk_device);
|
|
||||||
m_file_system->setDefaultDevice("memory:disk");
|
m_file_system->setDefaultDevice("memory:disk");
|
||||||
m_file_system->setSaveGameDevice("memory:disk");
|
m_file_system->setSaveGameDevice("memory:disk");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue