New editor tabs.

This commit is contained in:
Justin Marshall
2026-05-14 18:37:41 -07:00
parent 16bd1baf35
commit 44f2e67078
18 changed files with 2775 additions and 62 deletions
+84 -2
View File
@@ -188,6 +188,12 @@ using Microsoft::WRL::ComPtr;
#ifndef GL_QD3D12_TONEMAP_BRIGHTNESS
#define GL_QD3D12_TONEMAP_BRIGHTNESS 0x600A
#endif
#ifndef GL_QD3D12_TAA_ENABLED
#define GL_QD3D12_TAA_ENABLED 0x600B
#endif
#ifndef GL_QD3D12_TAA
#define GL_QD3D12_TAA GL_QD3D12_TAA_ENABLED
#endif
#ifndef GL_QD3D12_TONE_MAP_BRIGHTNESS
#define GL_QD3D12_TONE_MAP_BRIGHTNESS GL_QD3D12_TONEMAP_BRIGHTNESS
#endif
@@ -314,6 +320,12 @@ void QD3D12_EnableDLAA(int enabled);
int QD3D12_IsDLAAEnabled(void);
void APIENTRY glDLAAQD3D12(GLboolean enable);
void APIENTRY glEnableDLAAQD3D12(GLboolean enable);
void QD3D12_EnableTAA(int enabled);
int QD3D12_IsTAAEnabled(void);
void APIENTRY glTAAQD3D12(GLboolean enable);
void APIENTRY glEnableTAAQD3D12(GLboolean enable);
void APIENTRY glTemporalAAQD3D12(GLboolean enable);
void APIENTRY glEnableTemporalAAQD3D12(GLboolean enable);
void QD3D12_SetPathTracingQuality(uint32_t samplesPerPixel, uint32_t maxBounces);
void QD3D12_SetPathTracingFallbackSamples(uint32_t samplesPerPixel);
void QD3D12_SetCameraInfo(
@@ -661,7 +673,7 @@ struct GLBufferObject
const char* vendor = "Justin Marshall";
const char* renderer = "Quake D3D12 Wrapper";
const char* version = "1.1-quake-d3d12";
const char* extensions = "GL_SGIS_multitexture GL_ARB_multitexture GL_EXT_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_compression GL_EXT_texture_compression_s3tc GL_ARB_vertex_program GL_ARB_fragment_program GL_EXT_texture_cube_map GL_EXT_depth_bounds_test GL_EXT_stencil_two_side GL_ATI_separate_stencil GL_QD3D12_normal_map GL_QD3D12_glow_map GL_QD3D12_specular_map GL_QD3D12_glass_material GL_QD3D12_volumetric_light GL_QD3D12_dlaa GL_QD3D12_tonemap_brightness";
const char* extensions = "GL_SGIS_multitexture GL_ARB_multitexture GL_EXT_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_compression GL_EXT_texture_compression_s3tc GL_ARB_vertex_program GL_ARB_fragment_program GL_EXT_texture_cube_map GL_EXT_depth_bounds_test GL_EXT_stencil_two_side GL_ATI_separate_stencil GL_QD3D12_normal_map GL_QD3D12_glow_map GL_QD3D12_specular_map GL_QD3D12_glass_material GL_QD3D12_volumetric_light GL_QD3D12_dlaa GL_QD3D12_taa GL_QD3D12_tonemap_brightness";
enum TexEnvModeShader
{
@@ -1207,6 +1219,7 @@ struct GLState
QD3D12UpscalerBackend upscalerBackend = QD3D12_UPSCALER_DLSS;
QD3D12UpscalerQuality upscalerQuality = QD3D12_QUALITY_PERFORMANCE;
bool enableInternalTAA = true;
bool enableRayAIDenoise = false;
bool enableDLSSRayReconstruction = true;
bool enableFSRRayRegeneration = false;
@@ -5874,7 +5887,9 @@ static bool QD3D12_ShouldRunInternalTAA(const QD3D12Window& w)
{
// DLSS/DLSS-RR/FSR are already temporal. The internal TAA pass replaces MSAA
// for the native/no-upscaler path and runs after lighting but before 2D.
return !w.isPbuffer && !QD3D12_ExternalTemporalUpscalerActive(w);
return g_gl.enableInternalTAA &&
!w.isPbuffer &&
!QD3D12_ExternalTemporalUpscalerActive(w);
}
static bool QD3D12_FinalBlitToBackBuffer(
@@ -10348,6 +10363,9 @@ void APIENTRY glEnable(GLenum cap)
case GL_FRAGMENT_PROGRAM_ARB:
QD3D12ARB_SetEnabled(cap, true);
break;
case GL_QD3D12_TAA:
QD3D12_EnableTAA(1);
break;
case GL_TEXTURE_2D:
#ifdef GL_TEXTURE_RECTANGLE_ARB
case GL_TEXTURE_RECTANGLE_ARB:
@@ -10385,6 +10403,9 @@ void APIENTRY glDisable(GLenum cap)
case GL_FRAGMENT_PROGRAM_ARB:
QD3D12ARB_SetEnabled(cap, false);
break;
case GL_QD3D12_TAA:
QD3D12_EnableTAA(0);
break;
case GL_TEXTURE_2D:
#ifdef GL_TEXTURE_RECTANGLE_ARB
case GL_TEXTURE_RECTANGLE_ARB:
@@ -10954,6 +10975,10 @@ void APIENTRY glGetIntegerv(GLenum pname, GLint* params)
*params = (GLint)QD3D12_IsDLAAEnabled();
break;
case GL_QD3D12_TAA_ENABLED:
*params = (GLint)QD3D12_IsTAAEnabled();
break;
#ifdef GL_ACTIVE_STENCIL_FACE_EXT
case GL_ACTIVE_STENCIL_FACE_EXT:
*params = (GLint)g_gl.activeStencilFace;
@@ -13561,6 +13586,12 @@ PROC WINAPI qd3d12_wglGetProcAddress(LPCSTR name) {
{ "QD3D12_IsDLAAEnabled", (PROC)QD3D12_IsDLAAEnabled },
{ "glDLAAQD3D12", (PROC)glDLAAQD3D12 },
{ "glEnableDLAAQD3D12", (PROC)glEnableDLAAQD3D12 },
{ "QD3D12_EnableTAA", (PROC)QD3D12_EnableTAA },
{ "QD3D12_IsTAAEnabled", (PROC)QD3D12_IsTAAEnabled },
{ "glTAAQD3D12", (PROC)glTAAQD3D12 },
{ "glEnableTAAQD3D12", (PROC)glEnableTAAQD3D12 },
{ "glTemporalAAQD3D12", (PROC)glTemporalAAQD3D12 },
{ "glEnableTemporalAAQD3D12", (PROC)glEnableTemporalAAQD3D12 },
{ "QD3D12_SetPathTracingQuality", (PROC)QD3D12_SetPathTracingQuality },
{ "QD3D12_SetPathTracingFallbackSamples", (PROC)QD3D12_SetPathTracingFallbackSamples },
{ "glSetTopLevelAccelStructureVisible", (PROC)glSetTopLevelAccelStructureVisible },
@@ -14503,6 +14534,56 @@ void APIENTRY glEnableDLAAQD3D12(GLboolean enable)
glDLAAQD3D12(enable);
}
static void QD3D12_ResetInternalTAAHistoryForWindow(QD3D12Window* window)
{
if (!window)
return;
for (UINT i = 0; i < QD3D12_FrameCount; ++i)
window->taaHistoryValid[i] = false;
}
void QD3D12_EnableTAA(int enabled)
{
const bool newValue = enabled ? true : false;
if (g_gl.enableInternalTAA == newValue)
return;
g_gl.enableInternalTAA = newValue;
g_gl.motionHistoryReset = true;
// TAA history is only valid for the previous TAA mode. Drop it so re-enabling
// starts from the current frame instead of blending against stale history.
QD3D12_ResetInternalTAAHistoryForWindow(g_currentWindow);
for (auto& kv : g_windows)
QD3D12_ResetInternalTAAHistoryForWindow(&kv.second);
}
int QD3D12_IsTAAEnabled(void)
{
return g_gl.enableInternalTAA ? 1 : 0;
}
void APIENTRY glTAAQD3D12(GLboolean enable)
{
QD3D12_EnableTAA(enable != GL_FALSE ? 1 : 0);
}
void APIENTRY glEnableTAAQD3D12(GLboolean enable)
{
glTAAQD3D12(enable);
}
void APIENTRY glTemporalAAQD3D12(GLboolean enable)
{
glTAAQD3D12(enable);
}
void APIENTRY glEnableTemporalAAQD3D12(GLboolean enable)
{
glTAAQD3D12(enable);
}
void QD3D12_SetUpscalerSharpness(float sharpness)
{
g_gl.upscalerSharpness = ClampValue<float>(sharpness, 0.0f, 1.0f);
@@ -15679,6 +15760,7 @@ GLboolean APIENTRY glIsEnabled(GLenum cap)
case GL_STENCIL_TEST_TWO_SIDE_EXT: return g_gl.stencilTwoSide ? GL_TRUE : GL_FALSE;
#endif
case GL_TEXTURE_2D: return g_gl.texture2D[g_gl.activeTextureUnit] ? GL_TRUE : GL_FALSE;
case GL_QD3D12_TAA: return QD3D12_IsTAAEnabled() ? GL_TRUE : GL_FALSE;
case GL_LIGHTING:
return g_glState.lightingEnabled;