Cleanup.
This commit is contained in:
parent
895f697f50
commit
13ac805085
@ -495,6 +495,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::Direct3D11:
|
||||
case bgfx::RendererType::Direct3D12:
|
||||
vs_metaballs = bgfx::makeRef(vs_metaballs_dx11, sizeof(vs_metaballs_dx11) );
|
||||
fs_metaballs = bgfx::makeRef(fs_metaballs_dx11, sizeof(fs_metaballs_dx11) );
|
||||
break;
|
||||
@ -544,7 +545,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
|
||||
float at[3] = { 0.0f, 0.0f, 0.0f };
|
||||
float eye[3] = { 0.0f, 0.0f, -50.0f };
|
||||
|
||||
|
||||
// Set view and projection matrix for view 0.
|
||||
const bgfx::HMD* hmd = bgfx::getHMD();
|
||||
if (NULL != hmd)
|
||||
@ -598,7 +599,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
}
|
||||
|
||||
profUpdate = bx::getHPCounter();
|
||||
|
||||
|
||||
for (uint32_t zz = 0; zz < DIMS; ++zz)
|
||||
{
|
||||
for (uint32_t yy = 0; yy < DIMS; ++yy)
|
||||
@ -690,7 +691,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
-DIMS*0.5f + float(zz)
|
||||
};
|
||||
|
||||
const Grid* val[8] = {
|
||||
const Grid* val[8] = {
|
||||
&grid[xoffset+zpitch+ypitch ],
|
||||
&grid[xoffset+zpitch+ypitch+1],
|
||||
&grid[xoffset+ypitch+1 ],
|
||||
@ -735,7 +736,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
bgfx::dbgTextPrintf(1, 7, 0x0f, " Triangulate: % 7.3f[ms]", double(profTriangulate)*toMs);
|
||||
bgfx::dbgTextPrintf(1, 8, 0x0f, " Frame: % 7.3f[ms]", double(frameTime)*toMs);
|
||||
|
||||
// Advance to next frame. Rendering thread will be kicked to
|
||||
// Advance to next frame. Rendering thread will be kicked to
|
||||
// process submitted rendering primitives.
|
||||
bgfx::frame();
|
||||
}
|
||||
|
@ -146,7 +146,6 @@ static const uint16_t s_planeIndices[] =
|
||||
1, 3, 2,
|
||||
};
|
||||
|
||||
static const char* s_shaderPath = NULL;
|
||||
static bool s_flipV = false;
|
||||
static uint32_t s_viewMask = 0;
|
||||
static uint32_t s_clearMask = 0;
|
||||
@ -858,22 +857,12 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
switch (bgfx::getRendererType() )
|
||||
{
|
||||
default:
|
||||
case bgfx::RendererType::Direct3D9:
|
||||
s_shaderPath = "shaders/dx9/";
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::Direct3D11:
|
||||
s_shaderPath = "shaders/dx11/";
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::OpenGL:
|
||||
s_shaderPath = "shaders/glsl/";
|
||||
case bgfx::RendererType::OpenGLES:
|
||||
s_flipV = true;
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::OpenGLES:
|
||||
s_shaderPath = "shaders/gles/";
|
||||
s_flipV = true;
|
||||
default:8
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,6 @@ static const uint16_t s_planeIndices[] =
|
||||
1, 3, 2,
|
||||
};
|
||||
|
||||
static const char* s_shaderPath = NULL;
|
||||
static bool s_oglNdc = false;
|
||||
static float s_texelHalf = 0.0f;
|
||||
|
||||
@ -1874,22 +1873,15 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
{
|
||||
default:
|
||||
case bgfx::RendererType::Direct3D9:
|
||||
s_shaderPath = "shaders/dx9/";
|
||||
s_texelHalf = 0.5f;
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::Direct3D11:
|
||||
s_shaderPath = "shaders/dx11/";
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::OpenGL:
|
||||
s_shaderPath = "shaders/glsl/";
|
||||
case bgfx::RendererType::OpenGLES:
|
||||
s_oglNdc = true;
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::OpenGLES:
|
||||
s_shaderPath = "shaders/gles/";
|
||||
s_oglNdc = true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -220,7 +220,6 @@ static const uint16_t s_planeIndices[] =
|
||||
1, 3, 2,
|
||||
};
|
||||
|
||||
static const char* s_shaderPath = NULL;
|
||||
static bool s_flipV = false;
|
||||
static float s_texelHalf = 0.0f;
|
||||
|
||||
@ -1335,22 +1334,15 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
{
|
||||
default:
|
||||
case bgfx::RendererType::Direct3D9:
|
||||
s_shaderPath = "shaders/dx9/";
|
||||
s_texelHalf = 0.5f;
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::Direct3D11:
|
||||
s_shaderPath = "shaders/dx11/";
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::OpenGL:
|
||||
s_shaderPath = "shaders/glsl/";
|
||||
case bgfx::RendererType::OpenGLES:
|
||||
s_flipV = true;
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::OpenGLES:
|
||||
s_shaderPath = "shaders/gles/";
|
||||
s_flipV = true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -280,6 +280,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::Direct3D11:
|
||||
case bgfx::RendererType::Direct3D12:
|
||||
vs_drawstress = bgfx::makeRef(vs_drawstress_dx11, sizeof(vs_drawstress_dx11) );
|
||||
fs_drawstress = bgfx::makeRef(fs_drawstress_dx11, sizeof(fs_drawstress_dx11) );
|
||||
break;
|
||||
|
@ -71,6 +71,7 @@ static bgfx::ShaderHandle loadShader(bx::FileReaderI* _reader, const char* _name
|
||||
switch (bgfx::getRendererType() )
|
||||
{
|
||||
case bgfx::RendererType::Direct3D11:
|
||||
case bgfx::RendererType::Direct3D12:
|
||||
shaderPath = "shaders/dx11/";
|
||||
break;
|
||||
|
||||
|
@ -60,8 +60,8 @@ private:
|
||||
int32_t width; //< The line _width. The ending coordinate (inclusive) will be x+width-1.
|
||||
};
|
||||
|
||||
|
||||
uint32_t m_width; //< width (in pixels) of the underlying texture
|
||||
|
||||
uint32_t m_width; //< width (in pixels) of the underlying texture
|
||||
uint32_t m_height; //< height (in pixels) of the underlying texture
|
||||
uint32_t m_usedSpace; //< Surface used in squared pixel
|
||||
std::vector<Node> m_skyline; //< node of the skyline algorithm
|
||||
@ -326,6 +326,7 @@ void Atlas::init()
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::Direct3D11:
|
||||
case bgfx::RendererType::Direct3D12:
|
||||
m_texelOffset[0] = texelHalf;
|
||||
m_texelOffset[1] = texelHalf;
|
||||
break;
|
||||
|
@ -74,7 +74,7 @@ public:
|
||||
/// Append a wide char unicode string to the buffer using current pen
|
||||
/// position and color.
|
||||
void appendText(FontHandle _fontHandle, const wchar_t* _string, const wchar_t* _end = NULL);
|
||||
|
||||
|
||||
/// Append a whole face of the atlas cube, mostly used for debugging
|
||||
/// and visualizing atlas.
|
||||
void appendAtlasFace(uint16_t _faceIndex);
|
||||
@ -250,7 +250,7 @@ void TextBuffer::appendText(FontHandle _fontHandle, const char* _string, const c
|
||||
}
|
||||
}
|
||||
|
||||
BX_CHECK(state == UTF8_ACCEPT, "The string is not well-formed");
|
||||
BX_CHECK(state == UTF8_ACCEPT, "The string is not well-formed");
|
||||
}
|
||||
|
||||
void TextBuffer::appendText(FontHandle _fontHandle, const wchar_t* _string, const wchar_t* _end)
|
||||
@ -366,7 +366,7 @@ void TextBuffer::appendGlyph(FontHandle _handle, CodePoint _codePoint)
|
||||
|
||||
float txtDecals = (font.ascender - m_lineAscender);
|
||||
m_lineAscender = font.ascender;
|
||||
m_lineGap = font.lineGap;
|
||||
m_lineGap = font.lineGap;
|
||||
verticalCenterLastLine( (txtDecals), (m_penY - m_lineAscender), (m_penY + m_lineAscender - m_lineDescender + m_lineGap) );
|
||||
}
|
||||
|
||||
@ -575,6 +575,7 @@ TextBufferManager::TextBufferManager(FontManager* _fontManager)
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::Direct3D11:
|
||||
case bgfx::RendererType::Direct3D12:
|
||||
vs_font_basic = bgfx::makeRef(vs_font_basic_dx11, sizeof(vs_font_basic_dx11) );
|
||||
fs_font_basic = bgfx::makeRef(fs_font_basic_dx11, sizeof(fs_font_basic_dx11) );
|
||||
vs_font_distance_field = bgfx::makeRef(vs_font_distance_field_dx11, sizeof(vs_font_distance_field_dx11) );
|
||||
|
@ -468,9 +468,9 @@ struct Imgui
|
||||
IMGUI_create(_data, _size, _fontSize);
|
||||
|
||||
m_nvg = nvgCreate(1, m_view);
|
||||
nvgCreateFontMem(m_nvg, "default", (unsigned char*)_data, INT32_MAX, 0);
|
||||
nvgFontSize(m_nvg, _fontSize);
|
||||
nvgFontFace(m_nvg, "default");
|
||||
nvgCreateFontMem(m_nvg, "default", (unsigned char*)_data, INT32_MAX, 0);
|
||||
nvgFontSize(m_nvg, _fontSize);
|
||||
nvgFontFace(m_nvg, "default");
|
||||
|
||||
for (int32_t ii = 0; ii < NUM_CIRCLE_VERTS; ++ii)
|
||||
{
|
||||
@ -518,6 +518,7 @@ struct Imgui
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::Direct3D11:
|
||||
case bgfx::RendererType::Direct3D12:
|
||||
vs_imgui_color = bgfx::makeRef(vs_imgui_color_dx11, sizeof(vs_imgui_color_dx11) );
|
||||
fs_imgui_color = bgfx::makeRef(fs_imgui_color_dx11, sizeof(fs_imgui_color_dx11) );
|
||||
vs_imgui_texture = bgfx::makeRef(vs_imgui_texture_dx11, sizeof(vs_imgui_texture_dx11) );
|
||||
|
@ -99,6 +99,7 @@ struct OcornutImguiContext
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::Direct3D11:
|
||||
case bgfx::RendererType::Direct3D12:
|
||||
vsmem = bgfx::makeRef(vs_ocornut_imgui_dx11, sizeof(vs_ocornut_imgui_dx11));
|
||||
fsmem = bgfx::makeRef(fs_ocornut_imgui_dx11, sizeof(fs_ocornut_imgui_dx11));
|
||||
break;
|
||||
|
@ -239,6 +239,7 @@ namespace
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::Direct3D11:
|
||||
case bgfx::RendererType::Direct3D12:
|
||||
vs_nanovg_fill = bgfx::makeRef(vs_nanovg_fill_dx11, sizeof(vs_nanovg_fill_dx11) );
|
||||
fs_nanovg_fill = bgfx::makeRef(fs_nanovg_fill_dx11, sizeof(fs_nanovg_fill_dx11) );
|
||||
break;
|
||||
|
@ -355,6 +355,7 @@ namespace bgfx
|
||||
break;
|
||||
|
||||
case RendererType::Direct3D11:
|
||||
case RendererType::Direct3D12:
|
||||
mem = makeRef(vs_debugfont_dx11, sizeof(vs_debugfont_dx11) );
|
||||
break;
|
||||
|
||||
@ -372,6 +373,7 @@ namespace bgfx
|
||||
break;
|
||||
|
||||
case RendererType::Direct3D11:
|
||||
case RendererType::Direct3D12:
|
||||
mem = makeRef(fs_debugfont_dx11, sizeof(fs_debugfont_dx11) );
|
||||
break;
|
||||
|
||||
@ -552,7 +554,8 @@ namespace bgfx
|
||||
fragMem[ii] = makeRef(mem[ii].data, uint32_t(mem[ii].size) );
|
||||
}
|
||||
}
|
||||
else if (RendererType::Direct3D11 == g_caps.rendererType)
|
||||
else if (RendererType::Direct3D11 == g_caps.rendererType
|
||||
|| RendererType::Direct3D12 == g_caps.rendererType)
|
||||
{
|
||||
vsh = createShader(makeRef(vs_clear_dx11, sizeof(vs_clear_dx11) ) );
|
||||
|
||||
@ -1928,7 +1931,7 @@ again:
|
||||
uint8_t num = 0;
|
||||
for (uint8_t ii = 0; ii < uint8_t(RendererType::Count); ++ii)
|
||||
{
|
||||
if (RendererType::Direct3D11 == ii
|
||||
if ( (RendererType::Direct3D11 == ii || RendererType::Direct3D12 == ii)
|
||||
&& windowsVersionIs(Condition::LessEqual, 0x0502) )
|
||||
{
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user