Removed D3D9. (#3191)

This commit is contained in:
Бранимир Караџић
2023-11-03 21:15:42 -07:00
committed by GitHub
parent 6a914f5b13
commit f14c14a485
333 changed files with 8957 additions and 23428 deletions

View File

@@ -160,7 +160,7 @@ struct RenderTarget
bgfx::FrameBufferHandle m_buffer;
};
void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf, bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f)
void screenSpaceQuad(bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f)
{
if (3 == bgfx::getAvailTransientVertexBuffer(3, PosTexCoord0Vertex::ms_layout) )
{
@@ -173,15 +173,13 @@ void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf
const float miny = 0.0f;
const float maxy = _height * 2.0f;
const float texelHalfW = _texelHalf / _textureWidth;
const float texelHalfH = _texelHalf / _textureHeight;
const float minu = -1.0f + texelHalfW;
const float maxu = 1.0f + texelHalfW;
const float minu = -1.0f;
const float maxu = 1.0f;
const float zz = 0.0f;
float minv = texelHalfH;
float maxv = 2.0f + texelHalfH;
float minv = 0.0f;
float maxv = 2.0f;
if (_originBottomLeft)
{
@@ -235,7 +233,6 @@ public:
ExampleDenoise(const char* _name, const char* _description)
: entry::AppI(_name, _description)
, m_currFrame(UINT32_MAX)
, m_texelHalf(0.0f)
{
}
@@ -329,10 +326,6 @@ public:
// Track whether previous results are valid
m_havePrevious = false;
// Get renderer capabilities info.
const bgfx::RendererType::Enum renderer = bgfx::getRendererType();
m_texelHalf = bgfx::RendererType::Direct3D9 == renderer ? 0.5f : 0.0f;
imguiCreate();
}
@@ -480,7 +473,7 @@ public:
m_uniforms.submit();
screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft);
screenSpaceQuad(caps->originBottomLeft);
bgfx::submit(view, m_combineProgram);
@@ -512,7 +505,7 @@ public:
m_uniforms.submit();
screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft);
screenSpaceQuad(caps->originBottomLeft);
bgfx::submit(view, m_denoiseTemporalProgram);
@@ -558,7 +551,7 @@ public:
m_uniforms.m_denoiseStep = denoiseStepScale;
m_uniforms.submit();
screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft);
screenSpaceQuad(caps->originBottomLeft);
const bgfx::ProgramHandle spatialProgram = (0 == m_spatialSampleType)
? m_denoiseSpatialProgram3x3
@@ -593,7 +586,7 @@ public:
bgfx::setState(BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A | BGFX_STATE_DEPTH_TEST_ALWAYS);
bgfx::setTexture(0, s_color, lastTex);
screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft);
screenSpaceQuad(caps->originBottomLeft);
bgfx::submit(view, m_copyProgram);
++view;
@@ -620,7 +613,7 @@ public:
bgfx::setTexture(1, s_albedo, m_gbufferTex[GBUFFER_RT_COLOR]);
m_uniforms.submit();
screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft);
screenSpaceQuad(caps->originBottomLeft);
bgfx::submit(view, m_denoiseApplyLighting);
++view;
@@ -651,7 +644,7 @@ public:
bgfx::setTexture(3, s_depth, m_gbufferTex[GBUFFER_RT_DEPTH]);
m_uniforms.submit();
screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft);
screenSpaceQuad(caps->originBottomLeft);
bgfx::submit(view, m_txaaProgram);
++view;
@@ -671,7 +664,7 @@ public:
);
bgfx::setTexture(0, s_color, m_txaaColor.m_texture);
screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft);
screenSpaceQuad(caps->originBottomLeft);
bgfx::submit(view, m_copyProgram);
++view;
@@ -691,7 +684,7 @@ public:
);
bgfx::setTexture(0, s_color, m_txaaColor.m_texture);
screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft);
screenSpaceQuad(caps->originBottomLeft);
bgfx::submit(view, m_copyProgram);
++view;
@@ -718,7 +711,7 @@ public:
);
bgfx::setTexture(0, s_color, lastTex);
screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft);
screenSpaceQuad(caps->originBottomLeft);
bgfx::submit(view, m_copyProgram);
++view;
@@ -734,7 +727,7 @@ public:
bgfx::setState(BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A | BGFX_STATE_DEPTH_TEST_ALWAYS);
bgfx::setTexture(0, s_color, m_gbufferTex[GBUFFER_RT_NORMAL]);
screenSpaceQuad(float(m_width), float(m_height), m_texelHalf, caps->originBottomLeft);
screenSpaceQuad(caps->originBottomLeft);
bgfx::submit(view, m_copyProgram);
++view;
@@ -1095,7 +1088,6 @@ public:
bgfx::TextureHandle m_normalTexture;
uint32_t m_currFrame;
float m_texelHalf = 0.0f;
float m_fovY = 60.0f;
bool m_recreateFrameBuffers = false;
bool m_havePrevious = false;