mirror of
https://github.com/microsoft/terminal.git
synced 2026-04-05 21:59:47 +00:00
atlas: build with Windows Razzle; fix inbox build (#19848)
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
#include <shader_vs.h>
|
#include <shader_vs.h>
|
||||||
|
|
||||||
#include "BuiltinGlyphs.h"
|
#include "BuiltinGlyphs.h"
|
||||||
#include "dwrite.h"
|
#include "dwrite_helpers.h"
|
||||||
#include "wic.h"
|
#include "wic.h"
|
||||||
#include "../../types/inc/ColorFix.hpp"
|
#include "../../types/inc/ColorFix.hpp"
|
||||||
#include "../../types/inc/convert.hpp"
|
#include "../../types/inc/convert.hpp"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<ClCompile Include="BackendD2D.cpp" />
|
<ClCompile Include="BackendD2D.cpp" />
|
||||||
<ClCompile Include="BackendD3D.cpp" />
|
<ClCompile Include="BackendD3D.cpp" />
|
||||||
<ClCompile Include="BuiltinGlyphs.cpp" />
|
<ClCompile Include="BuiltinGlyphs.cpp" />
|
||||||
<ClCompile Include="dwrite.cpp" />
|
<ClCompile Include="dwrite_helpers.cpp" />
|
||||||
<ClCompile Include="DWriteTextAnalysis.cpp" />
|
<ClCompile Include="DWriteTextAnalysis.cpp" />
|
||||||
<ClCompile Include="pch.cpp">
|
<ClCompile Include="pch.cpp">
|
||||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
<ClInclude Include="BackendD3D.h" />
|
<ClInclude Include="BackendD3D.h" />
|
||||||
<ClInclude Include="BuiltinGlyphs.h" />
|
<ClInclude Include="BuiltinGlyphs.h" />
|
||||||
<ClInclude Include="common.h" />
|
<ClInclude Include="common.h" />
|
||||||
<ClInclude Include="dwrite.h" />
|
<ClInclude Include="dwrite_helpers.h" />
|
||||||
<ClInclude Include="DWriteTextAnalysis.h" />
|
<ClInclude Include="DWriteTextAnalysis.h" />
|
||||||
<ClInclude Include="pch.h" />
|
<ClInclude Include="pch.h" />
|
||||||
<ClInclude Include="wic.h" />
|
<ClInclude Include="wic.h" />
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
<FxCompile Include="custom_shader_vs.hlsl">
|
<FxCompile Include="custom_shader_vs.hlsl">
|
||||||
<ShaderType>Vertex</ShaderType>
|
<ShaderType>Vertex</ShaderType>
|
||||||
</FxCompile>
|
</FxCompile>
|
||||||
<FxCompile Include="dwrite.hlsl">
|
<FxCompile Include="dwrite_helpers.hlsl">
|
||||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||||
</FxCompile>
|
</FxCompile>
|
||||||
<FxCompile Include="shader_common.hlsl">
|
<FxCompile Include="shader_common.hlsl">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// Licensed under the MIT license.
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "dwrite.h"
|
#include "dwrite_helpers.h"
|
||||||
|
|
||||||
#pragma warning(disable : 26429) // Symbol '...' is never tested for nullness, it can be marked as not_null (f.23).
|
#pragma warning(disable : 26429) // Symbol '...' is never tested for nullness, it can be marked as not_null (f.23).
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ void DWrite_GetRenderParams(IDWriteFactory1* factory, float* gamma, float* clear
|
|||||||
THROW_IF_FAILED(factory->CreateCustomRenderingParams(1.0f, 0.0f, 0.0f, defaultParams->GetClearTypeLevel(), defaultParams->GetPixelGeometry(), defaultParams->GetRenderingMode(), linearParams));
|
THROW_IF_FAILED(factory->CreateCustomRenderingParams(1.0f, 0.0f, 0.0f, defaultParams->GetClearTypeLevel(), defaultParams->GetPixelGeometry(), defaultParams->GetRenderingMode(), linearParams));
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function produces 4 magic constants for DWrite_ApplyAlphaCorrection() in dwrite.hlsl
|
// This function produces 4 magic constants for DWrite_ApplyAlphaCorrection() in dwrite_helpers.hlsl
|
||||||
// and are required as an argument for DWrite_GetGrayscaleCorrectedAlpha().
|
// and are required as an argument for DWrite_GetGrayscaleCorrectedAlpha().
|
||||||
// gamma should be set to the return value of DWrite_GetRenderParams() or (pseudo-code):
|
// gamma should be set to the return value of DWrite_GetRenderParams() or (pseudo-code):
|
||||||
// IDWriteRenderingParams* defaultParams;
|
// IDWriteRenderingParams* defaultParams;
|
||||||
@@ -4,8 +4,13 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// Exclude stuff from <Windows.h> we don't need.
|
// Exclude stuff from <Windows.h> we don't need.
|
||||||
|
#ifndef NOMINMAX
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <dwrite_1.h>
|
#include <dwrite_1.h>
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ float3 DWrite_ApplyAlphaCorrection3(float3 a, float3 f, float4 g)
|
|||||||
// out of the blending of foregroundColor with glyphAlpha.
|
// out of the blending of foregroundColor with glyphAlpha.
|
||||||
//
|
//
|
||||||
// gammaRatios:
|
// gammaRatios:
|
||||||
// Magic constants produced by DWrite_GetGammaRatios() in dwrite.cpp.
|
// Magic constants produced by DWrite_GetGammaRatios() in dwrite_helpers.cpp.
|
||||||
// The default value for this are the 1.8 gamma ratios, which equates to:
|
// The default value for this are the 1.8 gamma ratios, which equates to:
|
||||||
// 0.148054421f, -0.894594550f, 1.47590804f, -0.324668258f
|
// 0.148054421f, -0.894594550f, 1.47590804f, -0.324668258f
|
||||||
// grayscaleEnhancedContrast:
|
// grayscaleEnhancedContrast:
|
||||||
@@ -92,7 +92,7 @@ float4 DWrite_GrayscaleBlend(float4 gammaRatios, float grayscaleEnhancedContrast
|
|||||||
// of foregroundColor and backgroundColor using glyphColor to do sub-pixel AA.
|
// of foregroundColor and backgroundColor using glyphColor to do sub-pixel AA.
|
||||||
//
|
//
|
||||||
// gammaRatios:
|
// gammaRatios:
|
||||||
// Magic constants produced by DWrite_GetGammaRatios() in dwrite.cpp.
|
// Magic constants produced by DWrite_GetGammaRatios() in dwrite_helpers.cpp.
|
||||||
// The default value for this are the 1.8 gamma ratios, which equates to:
|
// The default value for this are the 1.8 gamma ratios, which equates to:
|
||||||
// 0.148054421f, -0.894594550f, 1.47590804f, -0.324668258f
|
// 0.148054421f, -0.894594550f, 1.47590804f, -0.324668258f
|
||||||
// enhancedContrast:
|
// enhancedContrast:
|
||||||
21
src/renderer/atlas/makefile.inc
Normal file
21
src/renderer/atlas/makefile.inc
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
.SUFFIXES: .hlsl
|
||||||
|
|
||||||
|
# Vertex Shaders
|
||||||
|
|
||||||
|
$(OBJ_PATH)\$(O)\custom_shader_vs.h: custom_shader_vs.hlsl
|
||||||
|
@$(ECHO) Compiling shader $(*F)...
|
||||||
|
$(FXC) $(FXC_FLAGS) /Tvs_$(FXC_PROFILE_VERSION) /Fh"$@" /Vn$(*B) $?
|
||||||
|
|
||||||
|
$(OBJ_PATH)\$(O)\shader_vs.h: shader_vs.hlsl
|
||||||
|
@$(ECHO) Compiling shader $(*F)...
|
||||||
|
$(FXC) $(FXC_FLAGS) /Tvs_$(FXC_PROFILE_VERSION) /Fh"$@" /Vn$(*B) $?
|
||||||
|
|
||||||
|
# Pixel Shaders
|
||||||
|
|
||||||
|
$(OBJ_PATH)\$(O)\custom_shader_ps.h: custom_shader_ps.hlsl
|
||||||
|
@$(ECHO) Compiling shader $(*F)...
|
||||||
|
$(FXC) $(FXC_FLAGS) /Tps_$(FXC_PROFILE_VERSION) /Fh"$@" /Vn$(*B) $?
|
||||||
|
|
||||||
|
$(OBJ_PATH)\$(O)\shader_ps.h: shader_ps.hlsl
|
||||||
|
@$(ECHO) Compiling shader $(*F)...
|
||||||
|
$(FXC) $(FXC_FLAGS) /Tps_$(FXC_PROFILE_VERSION) /Fh"$@" /Vn$(*B) $?
|
||||||
@@ -3,8 +3,13 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef NOMINMAX
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) Microsoft Corporation.
|
// Copyright (c) Microsoft Corporation.
|
||||||
// Licensed under the MIT license.
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
#include "dwrite.hlsl"
|
#include "dwrite_helpers.hlsl"
|
||||||
#include "shader_common.hlsl"
|
#include "shader_common.hlsl"
|
||||||
|
|
||||||
cbuffer ConstBuffer : register(b0)
|
cbuffer ConstBuffer : register(b0)
|
||||||
|
|||||||
46
src/renderer/atlas/sources
Normal file
46
src/renderer/atlas/sources
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
!include ..\..\project.inc
|
||||||
|
|
||||||
|
TARGETNAME = ConRenderAtlas
|
||||||
|
TARGETTYPE = LIBRARY
|
||||||
|
|
||||||
|
PRECOMPILED_CXX = 1
|
||||||
|
PRECOMPILED_INCLUDE = pch.h
|
||||||
|
|
||||||
|
MSC_WARNING_LEVEL = $(MSC_WARNING_LEVEL) /wd4201
|
||||||
|
|
||||||
|
FXC_FLAGS = /nologo /Emain /WX /all_resources_bound /Zi
|
||||||
|
FXC_PROFILE_VERSION = 4_0
|
||||||
|
|
||||||
|
# Release flags for the shader compiler
|
||||||
|
!if $(FREEBUILD)
|
||||||
|
FXC_FLAGS = $(FXC_FLAGS) /O3 /Zsb /Qstrip_debug /Qstrip_reflect
|
||||||
|
!endif
|
||||||
|
|
||||||
|
INCLUDES = \
|
||||||
|
$(INCLUDES); \
|
||||||
|
..\..\inc; \
|
||||||
|
..\..\..\oss\stb; \
|
||||||
|
$(OBJ_PATH)\$(O); \
|
||||||
|
$(MINWIN_INTERNAL_PRIV_SDK_INC_PATH_L); \
|
||||||
|
$(MINWIN_RESTRICTED_PRIV_SDK_INC_PATH_L); \
|
||||||
|
|
||||||
|
SOURCES = \
|
||||||
|
$(SOURCES) \
|
||||||
|
AtlasEngine.api.cpp \
|
||||||
|
AtlasEngine.cpp \
|
||||||
|
AtlasEngine.r.cpp \
|
||||||
|
Backend.cpp \
|
||||||
|
BackendD2D.cpp \
|
||||||
|
BackendD3D.cpp \
|
||||||
|
BuiltinGlyphs.cpp \
|
||||||
|
dwrite_helpers.cpp \
|
||||||
|
DWriteTextAnalysis.cpp \
|
||||||
|
stb_rect_pack.cpp \
|
||||||
|
wic.cpp \
|
||||||
|
|
||||||
|
# Build rules specified in makefile.inc
|
||||||
|
NTTARGETFILE0 = \
|
||||||
|
$(OBJ_PATH)\$(O)\custom_shader_vs.h \
|
||||||
|
$(OBJ_PATH)\$(O)\custom_shader_ps.h \
|
||||||
|
$(OBJ_PATH)\$(O)\shader_vs.h \
|
||||||
|
$(OBJ_PATH)\$(O)\shader_ps.h \
|
||||||
3
src/renderer/atlas/sources.dep
Normal file
3
src/renderer/atlas/sources.dep
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
BUILD_PASS1_CONSUMES= \
|
||||||
|
onecore\windows\core\console\vcpkg|PASS1 \
|
||||||
|
|
||||||
@@ -2,3 +2,4 @@ DIRS= \
|
|||||||
base \
|
base \
|
||||||
gdi \
|
gdi \
|
||||||
wddmcon \
|
wddmcon \
|
||||||
|
atlas \
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ static int run(int argc, const wchar_t* argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int wmain(int argc, const wchar_t* argv[])
|
int __cdecl wmain(int argc, const wchar_t* argv[])
|
||||||
{
|
{
|
||||||
const auto inputHandle = GetStdHandle(STD_INPUT_HANDLE);
|
const auto inputHandle = GetStdHandle(STD_INPUT_HANDLE);
|
||||||
const auto outputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
|
const auto outputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
|
|||||||
Reference in New Issue
Block a user