Updated samples for 2306 release.
This commit is contained in:
Родитель
b5bbf45a64
Коммит
e5328b9c06
|
@ -34,3 +34,4 @@ Kits/DirectXTex/Shaders/Compiled/
|
|||
AppPackages
|
||||
packages
|
||||
!Kits/OpenSource/**/
|
||||
.vscode
|
||||
|
|
|
@ -21,7 +21,8 @@ namespace DX
|
|||
D3D12_GPU_DESCRIPTOR_HANDLE cubeTexture,
|
||||
const DirectX::RenderTargetState& rtState,
|
||||
const DirectX::CommonStates& commonStates,
|
||||
bool lhcoords = false)
|
||||
bool lhcoords = false,
|
||||
bool reverseZ = false)
|
||||
{
|
||||
using namespace DirectX;
|
||||
using namespace DirectX::SimpleMath;
|
||||
|
@ -29,12 +30,12 @@ namespace DX
|
|||
// Skybox effect
|
||||
EffectPipelineStateDescription skyPSD(&GeometricPrimitive::VertexType::InputLayout,
|
||||
CommonStates::Opaque,
|
||||
CommonStates::DepthRead,
|
||||
reverseZ ? CommonStates::DepthReadReverseZ : CommonStates::DepthRead,
|
||||
lhcoords ? CommonStates::CullCounterClockwise : CommonStates::CullClockwise,
|
||||
rtState,
|
||||
D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE);
|
||||
|
||||
m_effect = std::make_unique<SkyboxEffect>(device, skyPSD);
|
||||
m_effect = std::make_unique<SkyboxEffect>(device, skyPSD, reverseZ);
|
||||
m_effect->SetTexture(cubeTexture, commonStates.LinearWrap());
|
||||
|
||||
// "Skybox" geometry
|
||||
|
|
|
@ -26,6 +26,8 @@ namespace
|
|||
struct __declspec(align(16)) SkyboxEffectConstants
|
||||
{
|
||||
XMMATRIX worldViewProj;
|
||||
float zMultiplier;
|
||||
float padding[3];
|
||||
};
|
||||
|
||||
static_assert((sizeof(SkyboxEffectConstants) % 16) == 0, "CB size alignment");
|
||||
|
@ -36,11 +38,13 @@ namespace
|
|||
|
||||
SkyboxEffect::SkyboxEffect(
|
||||
_In_ ID3D12Device* device,
|
||||
const EffectPipelineStateDescription& pipelineStateDesc) :
|
||||
const EffectPipelineStateDescription& pipelineStateDesc,
|
||||
bool reverseZ) :
|
||||
m_device(device),
|
||||
m_texture{},
|
||||
m_textureSampler{},
|
||||
m_dirtyFlags(uint32_t(-1))
|
||||
m_dirtyFlags(uint32_t(-1)),
|
||||
m_reverseZ(reverseZ)
|
||||
{
|
||||
// Create root signature
|
||||
constexpr D3D12_ROOT_SIGNATURE_FLAGS rootSignatureFlags =
|
||||
|
@ -95,8 +99,11 @@ void SkyboxEffect::Apply(_In_ ID3D12GraphicsCommandList* commandList)
|
|||
{
|
||||
auto cb = GraphicsMemory::Get(m_device.Get()).AllocateConstant<SkyboxEffectConstants>();
|
||||
|
||||
const XMMATRIX transpose = XMMatrixTranspose(m_worldViewProj);
|
||||
memcpy(cb.Memory(), &transpose, cb.Size());
|
||||
SkyboxEffectConstants constants;
|
||||
constants.worldViewProj = XMMatrixTranspose(m_worldViewProj);
|
||||
constants.zMultiplier = m_reverseZ ? 0.f : 1.0f;
|
||||
|
||||
memcpy(cb.Memory(), &constants, cb.Size());
|
||||
std::swap(m_constantBuffer, cb);
|
||||
|
||||
m_dirtyFlags &= ~DirtyConstantBuffer;
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace DX
|
|||
class SkyboxEffect : public DirectX::IEffect, public DirectX::IEffectMatrices
|
||||
{
|
||||
public:
|
||||
explicit SkyboxEffect(_In_ ID3D12Device* device, const DirectX::EffectPipelineStateDescription& pipelineStateDesc);
|
||||
explicit SkyboxEffect(_In_ ID3D12Device* device, const DirectX::EffectPipelineStateDescription& pipelineStateDesc, bool reverseZ = false);
|
||||
|
||||
SkyboxEffect(SkyboxEffect&&) = delete;
|
||||
SkyboxEffect& operator= (SkyboxEffect&&) = delete;
|
||||
|
@ -62,5 +62,7 @@ namespace DX
|
|||
DirectX::SimpleMath::Matrix m_worldViewProj;
|
||||
|
||||
DirectX::GraphicsResource m_constantBuffer;
|
||||
|
||||
bool m_reverseZ;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
cbuffer SkyboxConstants : register(b0)
|
||||
{
|
||||
float4x4 WorldViewProj;
|
||||
float zMultiplier;
|
||||
float3 padding;
|
||||
}
|
||||
|
||||
struct VSOutput
|
||||
|
|
|
@ -15,7 +15,7 @@ VSOutput main(float4 position : SV_Position)
|
|||
VSOutput vout;
|
||||
|
||||
vout.PositionPS = mul(position, WorldViewProj);
|
||||
vout.PositionPS.z = vout.PositionPS.w; // Draw on far plane
|
||||
vout.PositionPS.z = zMultiplier * vout.PositionPS.w; // Draw on far plane
|
||||
vout.TexCoord = position.xyz;
|
||||
|
||||
return vout;
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -11,7 +11,6 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
#include "pch.h"
|
||||
|
||||
#ifdef ATG_ENABLE_TELEMETRY
|
||||
#include "ATGTelemetry.h"
|
||||
|
||||
#include <XGame.h>
|
||||
|
@ -81,9 +80,6 @@ public:
|
|||
m_bHCInitialized{ false },
|
||||
m_authToken{},
|
||||
m_data{}
|
||||
#if _GAMING_XBOX
|
||||
, m_notificationChangedHandle{ nullptr }
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -93,50 +89,9 @@ public:
|
|||
{
|
||||
HCCleanup();
|
||||
}
|
||||
|
||||
#if _GAMING_XBOX
|
||||
if (m_notificationChangedHandle)
|
||||
{
|
||||
CancelMibChangeNotify2(m_notificationChangedHandle);
|
||||
m_notificationChangedHandle = nullptr;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void SendTelemetry()
|
||||
{
|
||||
#if _GAMING_XBOX
|
||||
NL_NETWORK_CONNECTIVITY_HINT hint{};
|
||||
GetNetworkConnectivityHint(&hint);
|
||||
|
||||
// If the vm is being reused, this will return with internet access
|
||||
if (hint.ConnectivityLevel == NL_NETWORK_CONNECTIVITY_LEVEL_HINT::NetworkConnectivityLevelHintInternetAccess
|
||||
|| hint.ConnectivityLevel == NL_NETWORK_CONNECTIVITY_LEVEL_HINT::NetworkConnectivityLevelHintConstrainedInternetAccess)
|
||||
{
|
||||
OutputDebugStringA("GetNetworkConnectivityHint()\n");
|
||||
SendTelemetryInternal();
|
||||
}
|
||||
else
|
||||
{
|
||||
// The vm is not being reused and we should send when internet access is available
|
||||
NotifyNetworkConnectivityHintChange([](void* context, NL_NETWORK_CONNECTIVITY_HINT connectivityHint)
|
||||
{
|
||||
OutputDebugStringA("NotifyNetworkConnectivityHintChange()\n");
|
||||
auto atgTelemetry = static_cast<ATGTelemetry*>(context);
|
||||
if (connectivityHint.ConnectivityLevel == NL_NETWORK_CONNECTIVITY_LEVEL_HINT::NetworkConnectivityLevelHintInternetAccess
|
||||
|| connectivityHint.ConnectivityLevel == NL_NETWORK_CONNECTIVITY_LEVEL_HINT::NetworkConnectivityLevelHintConstrainedInternetAccess)
|
||||
{
|
||||
atgTelemetry->SendTelemetryInternal();
|
||||
}
|
||||
}, this, true, &m_notificationChangedHandle);
|
||||
}
|
||||
#else
|
||||
SendTelemetryInternal();
|
||||
#endif
|
||||
}
|
||||
|
||||
private:
|
||||
void SendTelemetryInternal()
|
||||
{
|
||||
static bool sent = false;
|
||||
|
||||
|
@ -155,6 +110,7 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
private:
|
||||
std::string NewGuid()
|
||||
{
|
||||
GUID id = {};
|
||||
|
@ -416,14 +372,11 @@ private:
|
|||
bool m_bHCInitialized;
|
||||
std::string m_authToken;
|
||||
TelemetryData m_data;
|
||||
|
||||
#if _GAMING_XBOX
|
||||
HANDLE m_notificationChangedHandle;
|
||||
#endif
|
||||
};
|
||||
|
||||
void ATG::SendLaunchTelemetry()
|
||||
{
|
||||
#ifndef ATG_DISABLE_TELEMETRY
|
||||
AsyncUniquePtr async = CreateAsync();
|
||||
async->callback = [](XAsyncBlock* ab)
|
||||
{
|
||||
|
@ -440,5 +393,6 @@ void ATG::SendLaunchTelemetry()
|
|||
{
|
||||
async.release();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -14,16 +14,5 @@
|
|||
|
||||
namespace ATG
|
||||
{
|
||||
// To opt-out of telemetry uncomment the following line
|
||||
// #undef ATG_ENABLE_TELEMETRY
|
||||
|
||||
#ifdef ATG_ENABLE_TELEMETRY
|
||||
// Sends sample launch telemetry
|
||||
void SendLaunchTelemetry();
|
||||
void CleanupTelemetry();
|
||||
#else
|
||||
void SendLaunchTelemetry() {};
|
||||
void CleanupTelemetry() {};
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
|
@ -246,6 +246,8 @@ namespace
|
|||
|
||||
return result.key;
|
||||
}
|
||||
|
||||
void GetDeviceOutputFormat(const wchar_t* deviceId, WAVEFORMATEX& wfx);
|
||||
}
|
||||
|
||||
static_assert(static_cast<unsigned int>(std::size(gReverbPresets)) == Reverb_MAX, "AUDIO_ENGINE_REVERB enum mismatch");
|
||||
|
@ -279,6 +281,7 @@ public:
|
|||
mCriticalError(false),
|
||||
mReverbEnabled(false),
|
||||
mEngineFlags(AudioEngine_Default),
|
||||
mOutputFormat{},
|
||||
mCategory(AudioCategory_GameEffects),
|
||||
mVoiceInstances(0)
|
||||
{
|
||||
|
@ -340,6 +343,7 @@ public:
|
|||
bool mReverbEnabled;
|
||||
|
||||
AUDIO_ENGINE_FLAGS mEngineFlags;
|
||||
WAVEFORMATEX mOutputFormat;
|
||||
|
||||
private:
|
||||
using notifylist_t = std::set<IVoiceNotify*>;
|
||||
|
@ -395,6 +399,7 @@ HRESULT AudioEngine::Impl::Reset(const WAVEFORMATEX* wfx, const wchar_t* deviceI
|
|||
assert(mReverbVoice == nullptr);
|
||||
|
||||
masterChannelMask = masterChannels = masterRate = 0;
|
||||
mOutputFormat = {};
|
||||
|
||||
memset(&mX3DAudio, 0, X3DAUDIO_HANDLE_BYTESIZE);
|
||||
|
||||
|
@ -481,6 +486,12 @@ HRESULT AudioEngine::Impl::Reset(const WAVEFORMATEX* wfx, const wchar_t* deviceI
|
|||
}
|
||||
}
|
||||
|
||||
mOutputFormat.wFormatTag = WAVE_FORMAT_PCM;
|
||||
mOutputFormat.nChannels = static_cast<WORD>(details.InputChannels);
|
||||
mOutputFormat.nSamplesPerSec = details.InputSampleRate;
|
||||
mOutputFormat.wBitsPerSample = 16;
|
||||
GetDeviceOutputFormat(deviceId, mOutputFormat);
|
||||
|
||||
//
|
||||
// Setup mastering volume limiter (optional)
|
||||
//
|
||||
|
@ -663,6 +674,7 @@ void AudioEngine::Impl::Shutdown() noexcept
|
|||
xaudio2.Reset();
|
||||
|
||||
masterChannelMask = masterChannels = masterRate = 0;
|
||||
mOutputFormat = {};
|
||||
|
||||
mCriticalError = false;
|
||||
mReverbEnabled = false;
|
||||
|
@ -1130,6 +1142,7 @@ AudioEngine::AudioEngine(
|
|||
HRESULT hr = pImpl->Initialize(flags, wfx, deviceId, category);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
const wchar_t* deviceName = (deviceId) ? deviceId : L"default";
|
||||
if (hr == HRESULT_FROM_WIN32(ERROR_NOT_FOUND))
|
||||
{
|
||||
if (flags & AudioEngine_ThrowOnNoAudioHW)
|
||||
|
@ -1142,11 +1155,22 @@ AudioEngine::AudioEngine(
|
|||
DebugTrace("WARNING: AudioEngine found no default audio device; running in 'silent mode'\n");
|
||||
}
|
||||
}
|
||||
else if (hr == AUDCLNT_E_DEVICE_IN_USE)
|
||||
{
|
||||
if (flags & AudioEngine_ThrowOnNoAudioHW)
|
||||
{
|
||||
DebugTrace("ERROR: AudioEngine audio device [%ls] was already in use\n", deviceName);
|
||||
throw std::runtime_error("AudioEngineNoAudioHW");
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugTrace("WARNING: AudioEngine audio device [%ls] already in use; running in 'silent mode'\n", deviceName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugTrace("ERROR: AudioEngine failed (%08X) to initialize using device [%ls]\n",
|
||||
static_cast<unsigned int>(hr),
|
||||
(deviceId) ? deviceId : L"default");
|
||||
static_cast<unsigned int>(hr), deviceName);
|
||||
throw std::runtime_error("AudioEngine");
|
||||
}
|
||||
}
|
||||
|
@ -1187,6 +1211,7 @@ bool AudioEngine::Reset(const WAVEFORMATEX* wfx, const wchar_t* deviceId)
|
|||
HRESULT hr = pImpl->Reset(wfx, deviceId);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
const wchar_t* deviceName = (deviceId) ? deviceId : L"default";
|
||||
if (hr == HRESULT_FROM_WIN32(ERROR_NOT_FOUND))
|
||||
{
|
||||
if (pImpl->mEngineFlags & AudioEngine_ThrowOnNoAudioHW)
|
||||
|
@ -1200,10 +1225,23 @@ bool AudioEngine::Reset(const WAVEFORMATEX* wfx, const wchar_t* deviceId)
|
|||
return false;
|
||||
}
|
||||
}
|
||||
else if (hr == AUDCLNT_E_DEVICE_IN_USE)
|
||||
{
|
||||
if (pImpl->mEngineFlags & AudioEngine_ThrowOnNoAudioHW)
|
||||
{
|
||||
DebugTrace("ERROR: AudioEngine failed to initialize using device [%ls] because it was already in use.\n", deviceName);
|
||||
throw std::runtime_error("AudioEngineNoAudioHW");
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugTrace("WARNING: AudioEngine failed to initialize using device [%ls] because it was already in use.\n", deviceName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugTrace("ERROR: AudioEngine failed (%08X) to Reset using device [%ls]\n",
|
||||
static_cast<unsigned int>(hr), (deviceId) ? deviceId : L"default");
|
||||
static_cast<unsigned int>(hr), deviceName);
|
||||
throw std::runtime_error("AudioEngine::Reset");
|
||||
}
|
||||
}
|
||||
|
@ -1229,7 +1267,11 @@ void AudioEngine::Resume()
|
|||
return;
|
||||
|
||||
HRESULT hr = pImpl->xaudio2->StartEngine();
|
||||
ThrowIfFailed(hr);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
DebugTrace("WARNING: Resume of the audio engine failed; running in 'silent mode'\n");
|
||||
pImpl->SetSilentMode();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1298,19 +1340,19 @@ WAVEFORMATEXTENSIBLE AudioEngine::GetOutputFormat() const noexcept
|
|||
if (!pImpl->xaudio2)
|
||||
return wfx;
|
||||
|
||||
wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
|
||||
wfx.Format.wBitsPerSample = wfx.Samples.wValidBitsPerSample = 16; // This is a guess
|
||||
wfx.Format = pImpl->mOutputFormat;
|
||||
wfx.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
|
||||
wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
|
||||
|
||||
wfx.Format.nChannels = static_cast<WORD>(pImpl->masterChannels);
|
||||
wfx.Format.nSamplesPerSec = pImpl->masterRate;
|
||||
wfx.Samples.wValidBitsPerSample = wfx.Format.wBitsPerSample;
|
||||
wfx.dwChannelMask = pImpl->masterChannelMask;
|
||||
|
||||
wfx.Format.nBlockAlign = static_cast<WORD>(wfx.Format.nChannels * wfx.Format.wBitsPerSample / 8);
|
||||
wfx.Format.nAvgBytesPerSec = wfx.Format.nSamplesPerSec * wfx.Format.nBlockAlign;
|
||||
|
||||
static const GUID s_pcm = { WAVE_FORMAT_PCM, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } };
|
||||
memcpy(&wfx.SubFormat, &s_pcm, sizeof(GUID));
|
||||
static const GUID s_wfexBase = { 0x00000000, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } };
|
||||
memcpy(&wfx.SubFormat, &s_wfexBase, sizeof(GUID));
|
||||
wfx.SubFormat.Data1 = wfx.Format.wFormatTag;
|
||||
|
||||
return wfx;
|
||||
}
|
||||
|
@ -1322,6 +1364,12 @@ uint32_t AudioEngine::GetChannelMask() const noexcept
|
|||
}
|
||||
|
||||
|
||||
int AudioEngine::GetOutputSampleRate() const noexcept
|
||||
{
|
||||
return static_cast<int>(pImpl->masterRate);
|
||||
}
|
||||
|
||||
|
||||
unsigned int AudioEngine::GetOutputChannels() const noexcept
|
||||
{
|
||||
return pImpl->masterChannels;
|
||||
|
@ -1420,15 +1468,15 @@ X3DAUDIO_HANDLE& AudioEngine::Get3DHandle() const noexcept
|
|||
|
||||
|
||||
// Static methods.
|
||||
#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_GAMES)
|
||||
#include <mmdeviceapi.h>
|
||||
#elif defined(_XBOX_ONE)
|
||||
#include <Windows.Media.Devices.h>
|
||||
#include <wrl.h>
|
||||
#elif defined(USING_XAUDIO2_REDIST) || defined(_GAMING_DESKTOP)
|
||||
#include <mmdeviceapi.h>
|
||||
#include <functiondiscoverykeys_devpkey.h>
|
||||
#elif (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
||||
#if (defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)) || defined(USING_XAUDIO2_8)
|
||||
//--- Use Windows Runtime device enumeration ---
|
||||
|
||||
// Note that this form of enumeration would also be needed for XAudio2.9 prior to Windows 10 (18362).
|
||||
//
|
||||
// If you care about supporting Windows 10 (17763), Windows Server 2019, or earlier Windows 10 builds,
|
||||
// you will need to modify the library to use this codepath for Windows desktop
|
||||
// -or- use XAudio2Redist -or- use XAudio 2.8.
|
||||
|
||||
#pragma comment(lib,"runtimeobject.lib")
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4471 5204 5256)
|
||||
|
@ -1436,144 +1484,194 @@ X3DAUDIO_HANDLE& AudioEngine::Get3DHandle() const noexcept
|
|||
#pragma clang diagnostic ignored "-Wnonportable-system-include-path"
|
||||
#endif
|
||||
#include <Windows.Devices.Enumeration.h>
|
||||
#include <Windows.Media.Devices.h>
|
||||
#pragma warning(pop)
|
||||
|
||||
#include <wrl.h>
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-dynamic-exception-spec"
|
||||
#endif
|
||||
|
||||
namespace
|
||||
{
|
||||
const wchar_t* c_PKEY_AudioEngine_DeviceFormat = L"{f19f064d-082c-4e27-bc73-6882a1bb8e4c} 0";
|
||||
|
||||
class PropertyIterator : public Microsoft::WRL::RuntimeClass<ABI::Windows::Foundation::Collections::IIterator<HSTRING>>
|
||||
{
|
||||
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
|
||||
InspectableClass(L"AudioEngine.PropertyIterator", FullTrust)
|
||||
#else
|
||||
InspectableClass(L"AudioEngine.PropertyIterator", BaseTrust)
|
||||
#endif
|
||||
|
||||
public:
|
||||
PropertyIterator() : mFirst(true), mString(c_PKEY_AudioEngine_DeviceFormat) {}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE get_Current(HSTRING *current) override
|
||||
{
|
||||
if (!current)
|
||||
return E_INVALIDARG;
|
||||
|
||||
if (mFirst)
|
||||
{
|
||||
*current = mString.Get();
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE get_HasCurrent(boolean *hasCurrent) override
|
||||
{
|
||||
if (!hasCurrent)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*hasCurrent = (mFirst) ? TRUE : FALSE;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE MoveNext(boolean *hasCurrent) override
|
||||
{
|
||||
if (!hasCurrent)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*hasCurrent = FALSE;
|
||||
mFirst = false;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
bool mFirst;
|
||||
Microsoft::WRL::Wrappers::HStringReference mString;
|
||||
|
||||
~PropertyIterator() override = default;
|
||||
};
|
||||
|
||||
class PropertyList : public Microsoft::WRL::RuntimeClass<ABI::Windows::Foundation::Collections::IIterable<HSTRING>>
|
||||
{
|
||||
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
|
||||
InspectableClass(L"AudioEngine.PropertyList", FullTrust)
|
||||
#else
|
||||
InspectableClass(L"AudioEngine.PropertyList", BaseTrust)
|
||||
#endif
|
||||
|
||||
public:
|
||||
HRESULT STDMETHODCALLTYPE First(ABI::Windows::Foundation::Collections::IIterator<HSTRING> **first) override
|
||||
{
|
||||
if (!first)
|
||||
return E_INVALIDARG;
|
||||
|
||||
ComPtr<PropertyIterator> p = Microsoft::WRL::Make<PropertyIterator>();
|
||||
*first = p.Detach();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
~PropertyList() override = default;
|
||||
};
|
||||
|
||||
void GetDeviceOutputFormat(const wchar_t* deviceId, WAVEFORMATEX& wfx)
|
||||
{
|
||||
using namespace Microsoft::WRL;
|
||||
using namespace Microsoft::WRL::Wrappers;
|
||||
using namespace ABI::Windows::Foundation;
|
||||
using namespace ABI::Windows::Foundation::Collections;
|
||||
using namespace ABI::Windows::Devices::Enumeration;
|
||||
|
||||
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
|
||||
RoInitializeWrapper initialize(RO_INIT_MULTITHREADED);
|
||||
ThrowIfFailed(initialize);
|
||||
#endif
|
||||
|
||||
ComPtr<IDeviceInformationStatics> diFactory;
|
||||
HRESULT hr = GetActivationFactory(HStringReference(RuntimeClass_Windows_Devices_Enumeration_DeviceInformation).Get(), &diFactory);
|
||||
ThrowIfFailed(hr);
|
||||
|
||||
HString id;
|
||||
if (!deviceId)
|
||||
{
|
||||
using namespace ABI::Windows::Media::Devices;
|
||||
|
||||
ComPtr<IMediaDeviceStatics> mdStatics;
|
||||
hr = GetActivationFactory(HStringReference(RuntimeClass_Windows_Media_Devices_MediaDevice).Get(), &mdStatics);
|
||||
ThrowIfFailed(hr);
|
||||
|
||||
hr = mdStatics->GetDefaultAudioRenderId(AudioDeviceRole_Default, id.GetAddressOf());
|
||||
ThrowIfFailed(hr);
|
||||
}
|
||||
else
|
||||
{
|
||||
id.Set(deviceId);
|
||||
}
|
||||
|
||||
ComPtr<IAsyncOperation<DeviceInformation*>> operation;
|
||||
ComPtr<IIterable<HSTRING>> props = Make<PropertyList>();
|
||||
|
||||
hr = diFactory->CreateFromIdAsyncAdditionalProperties(id.Get(), props.Get(), operation.GetAddressOf());
|
||||
if (FAILED(hr))
|
||||
return;
|
||||
|
||||
ComPtr<IAsyncInfo> asyncinfo;
|
||||
hr = operation.As(&asyncinfo);
|
||||
ThrowIfFailed(hr);
|
||||
|
||||
AsyncStatus status;
|
||||
hr = asyncinfo->get_Status(&status);
|
||||
ThrowIfFailed(hr);
|
||||
|
||||
while (status == ABI::Windows::Foundation::AsyncStatus::Started)
|
||||
{
|
||||
Sleep(100);
|
||||
hr = asyncinfo->get_Status(&status);
|
||||
ThrowIfFailed(hr);
|
||||
}
|
||||
|
||||
if (status != ABI::Windows::Foundation::AsyncStatus::Completed)
|
||||
{
|
||||
throw std::runtime_error("CreateFromIdAsync");
|
||||
}
|
||||
|
||||
ComPtr<IDeviceInformation> devInfo;
|
||||
hr = operation->GetResults(devInfo.GetAddressOf());
|
||||
ThrowIfFailed(hr);
|
||||
|
||||
ComPtr<IMapView<HSTRING, IInspectable*>> map;
|
||||
hr = devInfo->get_Properties(map.GetAddressOf());
|
||||
ThrowIfFailed(hr);
|
||||
|
||||
ComPtr<IInspectable> value;
|
||||
hr = map->Lookup(HStringReference(c_PKEY_AudioEngine_DeviceFormat).Get(), value.GetAddressOf());
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
ComPtr<IPropertyValue> pvalue;
|
||||
if (SUCCEEDED(value.As(&pvalue)))
|
||||
{
|
||||
PropertyType ptype;
|
||||
ThrowIfFailed(pvalue->get_Type(&ptype));
|
||||
|
||||
if (ptype == PropertyType_UInt8Array)
|
||||
{
|
||||
UINT32 length = 0;
|
||||
BYTE* ptr;
|
||||
ThrowIfFailed(pvalue->GetUInt8Array(&length, &ptr));
|
||||
|
||||
if (length >= sizeof(WAVEFORMATEX))
|
||||
{
|
||||
auto devicefx = reinterpret_cast<const WAVEFORMATEX*>(ptr);
|
||||
memcpy(&wfx, devicefx, sizeof(WAVEFORMATEX));
|
||||
wfx.wFormatTag = static_cast<WORD>(GetFormatTag(devicefx));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<AudioEngine::RendererDetail> AudioEngine::GetRendererDetails()
|
||||
{
|
||||
std::vector<RendererDetail> list;
|
||||
|
||||
#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_GAMES)
|
||||
|
||||
ComPtr<IMMDeviceEnumerator> devEnum;
|
||||
HRESULT hr = CoCreateInstance(__uuidof(MMDeviceEnumerator), nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(devEnum.GetAddressOf()));
|
||||
ThrowIfFailed(hr);
|
||||
|
||||
ComPtr<IMMDeviceCollection> devices;
|
||||
hr = devEnum->EnumAudioEndpoints(eRender, DEVICE_STATE_ACTIVE, &devices);
|
||||
ThrowIfFailed(hr);
|
||||
|
||||
ComPtr<IMMDevice> endpoint;
|
||||
ThrowIfFailed(devices->Item(0, endpoint.GetAddressOf()));
|
||||
|
||||
LPWSTR id = nullptr;
|
||||
ThrowIfFailed(endpoint->GetId(&id));
|
||||
|
||||
RendererDetail device;
|
||||
device.deviceId = id;
|
||||
device.description = L"Default";
|
||||
|
||||
CoTaskMemFree(id);
|
||||
|
||||
list.emplace_back(device);
|
||||
|
||||
#elif defined(_XBOX_ONE)
|
||||
|
||||
using namespace Microsoft::WRL;
|
||||
using namespace Microsoft::WRL::Wrappers;
|
||||
using namespace ABI::Windows::Foundation;
|
||||
using namespace ABI::Windows::Media::Devices;
|
||||
|
||||
ComPtr<IMediaDeviceStatics> mdStatics;
|
||||
HRESULT hr = GetActivationFactory(HStringReference(RuntimeClass_Windows_Media_Devices_MediaDevice).Get(), &mdStatics);
|
||||
ThrowIfFailed(hr);
|
||||
|
||||
HString id;
|
||||
hr = mdStatics->GetDefaultAudioRenderId(AudioDeviceRole_Default, id.GetAddressOf());
|
||||
ThrowIfFailed(hr);
|
||||
|
||||
RendererDetail device;
|
||||
device.deviceId = id.GetRawBuffer(nullptr);
|
||||
device.description = L"Default";
|
||||
list.emplace_back(device);
|
||||
|
||||
#elif defined(USING_XAUDIO2_REDIST) || defined(_GAMING_DESKTOP)
|
||||
|
||||
#ifdef __MINGW32__
|
||||
// Value matches Windows SDK header shared\devpkey.h
|
||||
constexpr static PROPERTYKEY PKEY_Device_FriendlyName = { { 0xa45c254e, 0xdf1c, 0x4efd, { 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0 } }, 14 };
|
||||
#endif
|
||||
|
||||
ComPtr<IMMDeviceEnumerator> devEnum;
|
||||
HRESULT hr = CoCreateInstance(__uuidof(MMDeviceEnumerator), nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(devEnum.GetAddressOf()));
|
||||
ThrowIfFailed(hr);
|
||||
|
||||
ComPtr<IMMDeviceCollection> devices;
|
||||
hr = devEnum->EnumAudioEndpoints(eRender, DEVICE_STATE_ACTIVE, &devices);
|
||||
ThrowIfFailed(hr);
|
||||
|
||||
UINT count = 0;
|
||||
ThrowIfFailed(devices->GetCount(&count));
|
||||
|
||||
if (!count)
|
||||
return list;
|
||||
|
||||
for (UINT j = 0; j < count; ++j)
|
||||
{
|
||||
ComPtr<IMMDevice> endpoint;
|
||||
hr = devices->Item(j, endpoint.GetAddressOf());
|
||||
ThrowIfFailed(hr);
|
||||
|
||||
LPWSTR id = nullptr;
|
||||
ThrowIfFailed(endpoint->GetId(&id));
|
||||
|
||||
RendererDetail device;
|
||||
device.deviceId = id;
|
||||
CoTaskMemFree(id);
|
||||
|
||||
ComPtr<IPropertyStore> props;
|
||||
if (SUCCEEDED(endpoint->OpenPropertyStore(STGM_READ, props.GetAddressOf())))
|
||||
{
|
||||
PROPVARIANT var;
|
||||
PropVariantInit(&var);
|
||||
|
||||
if (SUCCEEDED(props->GetValue(PKEY_Device_FriendlyName, &var)))
|
||||
{
|
||||
if (var.vt == VT_LPWSTR)
|
||||
{
|
||||
device.description = var.pwszVal;
|
||||
}
|
||||
PropVariantClear(&var);
|
||||
}
|
||||
}
|
||||
|
||||
list.emplace_back(device);
|
||||
}
|
||||
|
||||
#elif (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
||||
|
||||
#if defined(__cplusplus_winrt)
|
||||
|
||||
// Enumerating with WinRT using C++/CX (Windows Store apps)
|
||||
using Windows::Devices::Enumeration::DeviceClass;
|
||||
using Windows::Devices::Enumeration::DeviceInformation;
|
||||
using Windows::Devices::Enumeration::DeviceInformationCollection;
|
||||
|
||||
auto operation = DeviceInformation::FindAllAsync(DeviceClass::AudioRender);
|
||||
while (operation->Status == Windows::Foundation::AsyncStatus::Started) { Sleep(100); }
|
||||
if (operation->Status != Windows::Foundation::AsyncStatus::Completed)
|
||||
{
|
||||
throw std::runtime_error("FindAllAsync");
|
||||
}
|
||||
|
||||
DeviceInformationCollection^ devices = operation->GetResults();
|
||||
|
||||
for (unsigned i = 0; i < devices->Size; ++i)
|
||||
{
|
||||
using Windows::Devices::Enumeration::DeviceInformation;
|
||||
|
||||
DeviceInformation^ d = devices->GetAt(i);
|
||||
|
||||
RendererDetail device;
|
||||
device.deviceId = d->Id->Data();
|
||||
device.description = d->Name->Data();
|
||||
list.emplace_back(device);
|
||||
}
|
||||
#else
|
||||
|
||||
// Enumerating with WinRT using WRL (Win32 desktop app for Windows 8.x)
|
||||
using namespace Microsoft::WRL;
|
||||
using namespace Microsoft::WRL::Wrappers;
|
||||
using namespace ABI::Windows::Foundation;
|
||||
using namespace ABI::Windows::Foundation::Collections;
|
||||
|
@ -1646,10 +1744,156 @@ std::vector<AudioEngine::RendererDetail> AudioEngine::GetRendererDetails()
|
|||
list.emplace_back(device);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
#error DirectX Tool Kit for Audio not supported on this platform
|
||||
#endif
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
#elif defined(_XBOX_ONE)
|
||||
//--- Use legacy Xbox One XDK device enumeration ---
|
||||
|
||||
#include <Windows.Media.Devices.h>
|
||||
#include <wrl.h>
|
||||
|
||||
namespace
|
||||
{
|
||||
void GetDeviceOutputFormat(const wchar_t*, WAVEFORMATEX& wfx)
|
||||
{
|
||||
wfx.nSamplesPerSec = 48000;
|
||||
wfx.wBitsPerSample = 24;
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<AudioEngine::RendererDetail> AudioEngine::GetRendererDetails()
|
||||
{
|
||||
std::vector<RendererDetail> list;
|
||||
|
||||
using namespace Microsoft::WRL;
|
||||
using namespace Microsoft::WRL::Wrappers;
|
||||
using namespace ABI::Windows::Foundation;
|
||||
using namespace ABI::Windows::Media::Devices;
|
||||
|
||||
ComPtr<IMediaDeviceStatics> mdStatics;
|
||||
HRESULT hr = GetActivationFactory(HStringReference(RuntimeClass_Windows_Media_Devices_MediaDevice).Get(), &mdStatics);
|
||||
ThrowIfFailed(hr);
|
||||
|
||||
HString id;
|
||||
hr = mdStatics->GetDefaultAudioRenderId(AudioDeviceRole_Default, id.GetAddressOf());
|
||||
ThrowIfFailed(hr);
|
||||
|
||||
RendererDetail device;
|
||||
device.deviceId = id.GetRawBuffer(nullptr);
|
||||
device.description = L"Default";
|
||||
list.emplace_back(device);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
#elif defined(USING_XAUDIO2_9) || defined(USING_XAUDIO2_REDIST) || defined(_GAMING_DESKTOP)
|
||||
#include <mmdeviceapi.h>
|
||||
//--- Use WASAPI device enumeration ---
|
||||
|
||||
namespace
|
||||
{
|
||||
void GetDeviceOutputFormat(const wchar_t* deviceId, WAVEFORMATEX& wfx)
|
||||
{
|
||||
ComPtr<IMMDeviceEnumerator> devEnum;
|
||||
if (FAILED(CoCreateInstance(__uuidof(MMDeviceEnumerator), nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(devEnum.GetAddressOf()))))
|
||||
return;
|
||||
|
||||
ComPtr<IMMDevice> endpoint;
|
||||
if (!deviceId)
|
||||
{
|
||||
if (FAILED(devEnum->GetDefaultAudioEndpoint(eRender, eConsole, endpoint.GetAddressOf())))
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (FAILED(devEnum->GetDevice(deviceId, endpoint.GetAddressOf())))
|
||||
return;
|
||||
}
|
||||
|
||||
// Value matches Windows SDK header um\mmdeviceapi.h
|
||||
constexpr static PROPERTYKEY s_PKEY_AudioEngine_DeviceFormat = { { 0xf19f064d, 0x82c, 0x4e27, { 0xbc, 0x73, 0x68, 0x82, 0xa1, 0xbb, 0x8e, 0x4c } }, 0 };
|
||||
|
||||
ComPtr<IPropertyStore> props;
|
||||
if (SUCCEEDED(endpoint->OpenPropertyStore(STGM_READ, props.GetAddressOf())))
|
||||
{
|
||||
PROPVARIANT var;
|
||||
PropVariantInit(&var);
|
||||
|
||||
if (SUCCEEDED(props->GetValue(s_PKEY_AudioEngine_DeviceFormat, &var)))
|
||||
{
|
||||
if (var.vt == VT_BLOB && var.blob.cbSize >= sizeof(WAVEFORMATEX))
|
||||
{
|
||||
auto devicefx = reinterpret_cast<const WAVEFORMATEX*>(var.blob.pBlobData);
|
||||
memcpy(&wfx, devicefx, sizeof(WAVEFORMATEX));
|
||||
wfx.wFormatTag = static_cast<WORD>(GetFormatTag(devicefx));
|
||||
}
|
||||
PropVariantClear(&var);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<AudioEngine::RendererDetail> AudioEngine::GetRendererDetails()
|
||||
{
|
||||
std::vector<RendererDetail> list;
|
||||
|
||||
// Value matches Windows SDK header shared\devpkey.h
|
||||
constexpr static PROPERTYKEY s_PKEY_Device_FriendlyName = { { 0xa45c254e, 0xdf1c, 0x4efd, { 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0 } }, 14 };
|
||||
|
||||
ComPtr<IMMDeviceEnumerator> devEnum;
|
||||
HRESULT hr = CoCreateInstance(__uuidof(MMDeviceEnumerator), nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(devEnum.GetAddressOf()));
|
||||
ThrowIfFailed(hr);
|
||||
|
||||
ComPtr<IMMDeviceCollection> devices;
|
||||
hr = devEnum->EnumAudioEndpoints(eRender, DEVICE_STATE_ACTIVE, &devices);
|
||||
ThrowIfFailed(hr);
|
||||
|
||||
UINT count = 0;
|
||||
ThrowIfFailed(devices->GetCount(&count));
|
||||
|
||||
if (!count)
|
||||
return list;
|
||||
|
||||
for (UINT j = 0; j < count; ++j)
|
||||
{
|
||||
ComPtr<IMMDevice> endpoint;
|
||||
hr = devices->Item(j, endpoint.GetAddressOf());
|
||||
ThrowIfFailed(hr);
|
||||
|
||||
LPWSTR id = nullptr;
|
||||
ThrowIfFailed(endpoint->GetId(&id));
|
||||
|
||||
RendererDetail device;
|
||||
device.deviceId = id;
|
||||
CoTaskMemFree(id);
|
||||
|
||||
ComPtr<IPropertyStore> props;
|
||||
if (SUCCEEDED(endpoint->OpenPropertyStore(STGM_READ, props.GetAddressOf())))
|
||||
{
|
||||
PROPVARIANT var;
|
||||
PropVariantInit(&var);
|
||||
|
||||
if (SUCCEEDED(props->GetValue(s_PKEY_Device_FriendlyName, &var)))
|
||||
{
|
||||
if (var.vt == VT_LPWSTR)
|
||||
{
|
||||
device.description = var.pwszVal;
|
||||
}
|
||||
PropVariantClear(&var);
|
||||
}
|
||||
}
|
||||
|
||||
list.emplace_back(device);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
#error DirectX Tool Kit for Audio not supported on this platform
|
||||
#endif
|
||||
|
|
|
@ -242,13 +242,16 @@ namespace DirectX
|
|||
// Gathers audio engine statistics
|
||||
|
||||
WAVEFORMATEXTENSIBLE __cdecl GetOutputFormat() const noexcept;
|
||||
// Returns the format consumed by the mastering voice (which is the same as the device output if defaults are used)
|
||||
// Returns the format of the audio output device associated with the mastering voice.
|
||||
|
||||
uint32_t __cdecl GetChannelMask() const noexcept;
|
||||
// Returns the output channel mask
|
||||
|
||||
int __cdecl GetOutputSampleRate() const noexcept;
|
||||
// Returns the sample rate going into the mastering voice
|
||||
|
||||
unsigned int __cdecl GetOutputChannels() const noexcept;
|
||||
// Returns the number of output channels
|
||||
// Returns the number of channels going into the mastering voice
|
||||
|
||||
bool __cdecl IsAudioDevicePresent() const noexcept;
|
||||
// Returns true if the audio graph is operating normally, false if in 'silent mode'
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#endif // !USING_XINPUT && !USING_GAMEINPUT && !USING_WINDOWS_GAMING_INPUT
|
||||
|
||||
#ifdef USING_GAMEINPUT
|
||||
interface IGameInputDevice;
|
||||
#include <GameInput.h>
|
||||
#ifndef _GAMING_XBOX
|
||||
#pragma comment(lib,"gameinput.lib")
|
||||
#endif
|
||||
|
|
|
@ -426,6 +426,12 @@ namespace DirectX
|
|||
bool OemClear : 1; // VK_OEM_CLEAR, 0xFE
|
||||
bool Reserved26 : 1;
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunknown-warning-option"
|
||||
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
|
||||
#endif
|
||||
|
||||
bool __cdecl IsKeyDown(Keys key) const noexcept
|
||||
{
|
||||
if (key <= 0xfe)
|
||||
|
@ -447,6 +453,10 @@ namespace DirectX
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
};
|
||||
|
||||
class KeyboardStateTracker
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wfloat-equal"
|
||||
#pragma clang diagnostic ignored "-Wunknown-warning-option"
|
||||
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ http://go.microsoft.com/fwlink/?LinkID=615561
|
|||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
**February 6, 2023**
|
||||
**June 13, 2023**
|
||||
|
||||
This package contains the "DirectX Tool Kit", a collection of helper classes for writing Direct3D 12 C++ code for Universal Windows Platform (UWP) apps for Windows 11 and Windows 10, game titles for Xbox Series X\|S and Xbox One, and Win32 desktop applications for Windows 11 and Windows 10.
|
||||
|
||||
|
@ -114,6 +114,8 @@ This project welcomes contributions and suggestions. Most contributions require
|
|||
|
||||
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more informatsion see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||
|
||||
## Trademarks
|
||||
|
@ -137,3 +139,5 @@ Thanks to Pete Lewis and Justin Saunders for the normal-mapped and PBR shaders i
|
|||
Thanks for Travis Johnson for the mGPU support.
|
||||
|
||||
Thanks to Roberto Sonnino for his help with the CMO format and the VS Starter Kit animation.
|
||||
|
||||
Thanks to Andrew Farrier and Scott Matloff for their on-going help with code reviews.
|
||||
|
|
|
@ -193,7 +193,12 @@ AlphaTestEffect::Impl::Impl(
|
|||
D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS;
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS
|
||||
#ifdef _GAMING_XBOX_SCARLETT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS
|
||||
#endif
|
||||
;
|
||||
|
||||
const CD3DX12_DESCRIPTOR_RANGE textureRange(D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 1, 0);
|
||||
const CD3DX12_DESCRIPTOR_RANGE textureSamplerRange(D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER, 1, 0);
|
||||
|
|
|
@ -443,7 +443,12 @@ BasicEffect::Impl::Impl(
|
|||
D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS;
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS
|
||||
#ifdef _GAMING_XBOX_SCARLETT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS
|
||||
#endif
|
||||
;
|
||||
|
||||
// Create root parameters and initialize first (constants)
|
||||
CD3DX12_ROOT_PARAMETER rootParameters[RootParameterIndex::RootParameterCount] = {};
|
||||
|
|
|
@ -256,7 +256,12 @@ BasicPostProcess::Impl::Impl(_In_ ID3D12Device* device, const RenderTargetState&
|
|||
D3D12_ROOT_SIGNATURE_FLAG_DENY_VERTEX_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS;
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS
|
||||
#ifdef _GAMING_XBOX_SCARLETT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS
|
||||
#endif
|
||||
;
|
||||
|
||||
const CD3DX12_DESCRIPTOR_RANGE textureSRVs(D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 1, 0);
|
||||
|
||||
|
|
|
@ -277,7 +277,12 @@ DebugEffect::Impl::Impl(
|
|||
D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS;
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS
|
||||
#ifdef _GAMING_XBOX_SCARLETT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS
|
||||
#endif
|
||||
;
|
||||
|
||||
// Create root parameters and initialize first (constants)
|
||||
CD3DX12_ROOT_PARAMETER rootParameters[RootParameterIndex::RootParameterCount] = {};
|
||||
|
|
|
@ -188,7 +188,12 @@ DualPostProcess::Impl::Impl(_In_ ID3D12Device* device, const RenderTargetState&
|
|||
D3D12_ROOT_SIGNATURE_FLAG_DENY_VERTEX_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS;
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS
|
||||
#ifdef _GAMING_XBOX_SCARLETT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS
|
||||
#endif
|
||||
;
|
||||
|
||||
// Same as CommonStates::StaticLinearClamp
|
||||
const CD3DX12_STATIC_SAMPLER_DESC sampler(
|
||||
|
|
|
@ -175,7 +175,12 @@ DualTextureEffect::Impl::Impl(
|
|||
D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS;
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS
|
||||
#ifdef _GAMING_XBOX_SCARLETT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS
|
||||
#endif
|
||||
;
|
||||
|
||||
CD3DX12_ROOT_PARAMETER rootParameters[RootParameterIndex::RootParameterCount] = {};
|
||||
rootParameters[RootParameterIndex::ConstantBuffer].InitAsConstantBufferView(0, 0, D3D12_SHADER_VISIBILITY_ALL);
|
||||
|
|
|
@ -373,7 +373,12 @@ EnvironmentMapEffect::Impl::Impl(
|
|||
D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS;
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS
|
||||
#ifdef _GAMING_XBOX_SCARLETT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS
|
||||
#endif
|
||||
;
|
||||
|
||||
CD3DX12_ROOT_PARAMETER rootParameters[RootParameterIndex::RootParameterCount] = {};
|
||||
rootParameters[RootParameterIndex::ConstantBuffer].InitAsConstantBufferView(0, 0, D3D12_SHADER_VISIBILITY_ALL);
|
||||
|
|
|
@ -84,8 +84,6 @@ namespace
|
|||
#pragma region Implementations
|
||||
#ifdef USING_GAMEINPUT
|
||||
|
||||
#include <GameInput.h>
|
||||
|
||||
//======================================================================================
|
||||
// GameInput
|
||||
//======================================================================================
|
||||
|
|
|
@ -453,7 +453,12 @@ void NormalMapEffect::Impl::Initialize(
|
|||
D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS;
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS
|
||||
#ifdef _GAMING_XBOX_SCARLETT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS
|
||||
#endif
|
||||
;
|
||||
|
||||
CD3DX12_ROOT_PARAMETER rootParameters[RootParameterIndex::RootParameterCount] = {};
|
||||
const CD3DX12_DESCRIPTOR_RANGE textureSRV(D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 1, 0);
|
||||
|
|
|
@ -377,7 +377,12 @@ void PBREffect::Impl::Initialize(
|
|||
D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS;
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS
|
||||
#ifdef _GAMING_XBOX_SCARLETT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS
|
||||
#endif
|
||||
;
|
||||
|
||||
CD3DX12_ROOT_PARAMETER rootParameters[RootParametersCount] = {};
|
||||
CD3DX12_DESCRIPTOR_RANGE textureSRV[6] = {
|
||||
|
|
|
@ -239,6 +239,10 @@ namespace
|
|||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS
|
||||
#ifdef _GAMING_XBOX_SCARLETT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS
|
||||
#endif
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_PIXEL_SHADER_ROOT_ACCESS;
|
||||
|
||||
const CD3DX12_STATIC_SAMPLER_DESC sampler(
|
||||
|
|
|
@ -5,6 +5,8 @@ rem Licensed under the MIT License.
|
|||
setlocal
|
||||
set error=0
|
||||
|
||||
if %PROCESSOR_ARCHITECTURE%.==ARM64. (set FXCARCH=arm64) else (if %PROCESSOR_ARCHITECTURE%.==AMD64. (set FXCARCH=x64) else (set FXCARCH=x86))
|
||||
|
||||
set FXCOPTS=/nologo /WX /Ges /Zi /Zpc /Qstrip_reflect /Qstrip_debug
|
||||
|
||||
if %1.==xbox. goto continuexbox
|
||||
|
@ -47,9 +49,9 @@ goto continue
|
|||
|
||||
:continuedxil
|
||||
if defined DirectXShaderCompiler goto dxcviaenv
|
||||
set PCDXC="%WindowsSdkVerBinPath%x86\dxc.exe"
|
||||
set PCDXC="%WindowsSdkVerBinPath%%FXCARCH%\dxc.exe"
|
||||
if exist %PCDXC% goto continue
|
||||
set PCDXC="%WindowsSdkBinPath%%WindowsSDKVersion%\x86\dxc.exe"
|
||||
set PCDXC="%WindowsSdkBinPath%%WindowsSDKVersion%\%FXCARCH%\dxc.exe"
|
||||
if exist %PCDXC% goto continue
|
||||
|
||||
set PCDXC=dxc.exe
|
||||
|
@ -63,11 +65,11 @@ goto needdxil
|
|||
:continuepc
|
||||
set PCOPTS=
|
||||
|
||||
set PCFXC="%WindowsSdkVerBinPath%x86\fxc.exe"
|
||||
set PCFXC="%WindowsSdkVerBinPath%%FXCARCH%\fxc.exe"
|
||||
if exist %PCFXC% goto continue
|
||||
set PCFXC="%WindowsSdkBinPath%%WindowsSDKVersion%\x86\fxc.exe"
|
||||
set PCFXC="%WindowsSdkBinPath%%WindowsSDKVersion%\%FXCARCH%\fxc.exe"
|
||||
if exist %PCFXC% goto continue
|
||||
set PCFXC="%WindowsSdkDir%bin\%WindowsSDKVersion%\x86\fxc.exe"
|
||||
set PCFXC="%WindowsSdkDir%bin\%WindowsSDKVersion%\%FXCARCH%\fxc.exe"
|
||||
if exist %PCFXC% goto continue
|
||||
|
||||
set PCFXC=fxc.exe
|
||||
|
|
|
@ -4,6 +4,206 @@
|
|||
// http://go.microsoft.com/fwlink/?LinkID=615561
|
||||
|
||||
// Root signatures must match definition in each effect, or shaders will be recompiled on Xbox when PSO loads
|
||||
|
||||
#ifdef __XBOX_SCARLETT
|
||||
|
||||
#define NoTextureRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_AMPLIFICATION_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_MESH_SHADER_ROOT_ACCESS )," \
|
||||
"CBV(b0)"
|
||||
|
||||
#define MainRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_AMPLIFICATION_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_MESH_SHADER_ROOT_ACCESS )," \
|
||||
"CBV(b0),"\
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
#define DualTextureRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_AMPLIFICATION_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_MESH_SHADER_ROOT_ACCESS )," \
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL )," \
|
||||
"DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )," \
|
||||
"DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL )," \
|
||||
"DescriptorTable ( Sampler(s1), visibility = SHADER_VISIBILITY_PIXEL )," \
|
||||
"CBV(b0)"
|
||||
|
||||
#define NormalMapRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_AMPLIFICATION_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_MESH_SHADER_ROOT_ACCESS )," \
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL )," \
|
||||
"DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL )," \
|
||||
"DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )," \
|
||||
"CBV(b0)," \
|
||||
"CBV(b1, visibility = SHADER_VISIBILITY_VERTEX )," \
|
||||
"DescriptorTable ( SRV(t2), visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
#define NormalMapRSNoSpec \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_AMPLIFICATION_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_MESH_SHADER_ROOT_ACCESS )," \
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL )," \
|
||||
"DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL )," \
|
||||
"DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )," \
|
||||
"CBV(b0)," \
|
||||
"CBV(b1, visibility = SHADER_VISIBILITY_VERTEX )"
|
||||
|
||||
#define GenerateMipsRS \
|
||||
"RootFlags ( DENY_VERTEX_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_AMPLIFICATION_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_MESH_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_PIXEL_SHADER_ROOT_ACCESS )," \
|
||||
"RootConstants(num32BitConstants=3, b0)," \
|
||||
"DescriptorTable ( SRV(t0) )," \
|
||||
"DescriptorTable ( UAV(u0) )," \
|
||||
"StaticSampler(s0,"\
|
||||
" filter = FILTER_MIN_MAG_LINEAR_MIP_POINT,"\
|
||||
" addressU = TEXTURE_ADDRESS_CLAMP,"\
|
||||
" addressV = TEXTURE_ADDRESS_CLAMP,"\
|
||||
" addressW = TEXTURE_ADDRESS_CLAMP )"
|
||||
|
||||
#define SpriteStaticRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_AMPLIFICATION_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_MESH_SHADER_ROOT_ACCESS )," \
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"CBV(b0), "\
|
||||
"StaticSampler(s0,"\
|
||||
" filter = FILTER_MIN_MAG_MIP_LINEAR,"\
|
||||
" addressU = TEXTURE_ADDRESS_CLAMP,"\
|
||||
" addressV = TEXTURE_ADDRESS_CLAMP,"\
|
||||
" addressW = TEXTURE_ADDRESS_CLAMP,"\
|
||||
" visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
#define SpriteHeapRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_AMPLIFICATION_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_MESH_SHADER_ROOT_ACCESS )," \
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"CBV(b0), " \
|
||||
"DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
#define PostProcessRS \
|
||||
"RootFlags ( DENY_VERTEX_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_AMPLIFICATION_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_MESH_SHADER_ROOT_ACCESS )," \
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"CBV(b0, visibility = SHADER_VISIBILITY_PIXEL ), " \
|
||||
"StaticSampler(s0,"\
|
||||
" filter = FILTER_MIN_MAG_MIP_LINEAR,"\
|
||||
" addressU = TEXTURE_ADDRESS_CLAMP,"\
|
||||
" addressV = TEXTURE_ADDRESS_CLAMP,"\
|
||||
" addressW = TEXTURE_ADDRESS_CLAMP,"\
|
||||
" visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
#define PostProcessRSNoCB \
|
||||
"RootFlags ( DENY_VERTEX_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_AMPLIFICATION_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_MESH_SHADER_ROOT_ACCESS )," \
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"StaticSampler(s0,"\
|
||||
" filter = FILTER_MIN_MAG_MIP_LINEAR,"\
|
||||
" addressU = TEXTURE_ADDRESS_CLAMP,"\
|
||||
" addressV = TEXTURE_ADDRESS_CLAMP,"\
|
||||
" addressW = TEXTURE_ADDRESS_CLAMP,"\
|
||||
" visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
#define DualPostProcessRS \
|
||||
"RootFlags ( DENY_VERTEX_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_AMPLIFICATION_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_MESH_SHADER_ROOT_ACCESS )," \
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"CBV(b0, visibility = SHADER_VISIBILITY_PIXEL ), " \
|
||||
"StaticSampler(s0,"\
|
||||
" filter = FILTER_MIN_MAG_MIP_LINEAR,"\
|
||||
" addressU = TEXTURE_ADDRESS_CLAMP,"\
|
||||
" addressV = TEXTURE_ADDRESS_CLAMP,"\
|
||||
" addressW = TEXTURE_ADDRESS_CLAMP,"\
|
||||
" visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
#define ToneMapRS \
|
||||
"RootFlags ( DENY_VERTEX_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_AMPLIFICATION_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_MESH_SHADER_ROOT_ACCESS )," \
|
||||
"DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\
|
||||
"CBV(b0, visibility = SHADER_VISIBILITY_PIXEL ), " \
|
||||
"StaticSampler(s0,"\
|
||||
" filter = FILTER_MIN_MAG_MIP_POINT,"\
|
||||
" addressU = TEXTURE_ADDRESS_CLAMP,"\
|
||||
" addressV = TEXTURE_ADDRESS_CLAMP,"\
|
||||
" addressW = TEXTURE_ADDRESS_CLAMP,"\
|
||||
" visibility = SHADER_VISIBILITY_PIXEL )"
|
||||
|
||||
#define PBREffectRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_AMPLIFICATION_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_MESH_SHADER_ROOT_ACCESS )," \
|
||||
"DescriptorTable ( SRV(t0) ),"\
|
||||
"DescriptorTable ( SRV(t1) ),"\
|
||||
"DescriptorTable ( SRV(t2) ),"\
|
||||
"DescriptorTable ( SRV(t3) ),"\
|
||||
"DescriptorTable ( SRV(t4) ),"\
|
||||
"DescriptorTable ( SRV(t5) ),"\
|
||||
"DescriptorTable ( Sampler(s0) ),"\
|
||||
"DescriptorTable ( Sampler(s1) ),"\
|
||||
"CBV(b0)," \
|
||||
"CBV(b1, visibility = SHADER_VISIBILITY_VERTEX )"
|
||||
|
||||
#define DebugEffectRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_AMPLIFICATION_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_MESH_SHADER_ROOT_ACCESS )," \
|
||||
"CBV(b0)"
|
||||
|
||||
#else // !__XBOX_SCARLETT
|
||||
|
||||
#define NoTextureRS \
|
||||
"RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
|
@ -55,10 +255,10 @@
|
|||
"CBV(b1, visibility = SHADER_VISIBILITY_VERTEX )"
|
||||
|
||||
#define GenerateMipsRS \
|
||||
"RootFlags ( DENY_VERTEX_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
"RootFlags ( DENY_VERTEX_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_DOMAIN_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_PIXEL_SHADER_ROOT_ACCESS )," \
|
||||
"RootConstants(num32BitConstants=3, b0)," \
|
||||
"DescriptorTable ( SRV(t0) )," \
|
||||
|
@ -170,3 +370,5 @@
|
|||
" DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \
|
||||
" DENY_HULL_SHADER_ROOT_ACCESS )," \
|
||||
"CBV(b0)"
|
||||
|
||||
#endif
|
||||
|
|
|
@ -208,7 +208,12 @@ SkinnedEffect::Impl::Impl(
|
|||
D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS;
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS
|
||||
#ifdef _GAMING_XBOX_SCARLETT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS
|
||||
#endif
|
||||
;
|
||||
|
||||
const CD3DX12_DESCRIPTOR_RANGE textureSrvDescriptorRange(D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 1, 0);
|
||||
const CD3DX12_DESCRIPTOR_RANGE textureSamplerDescriptorRange(D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER, 1, 0);
|
||||
|
|
|
@ -343,7 +343,12 @@ void SpriteBatch::Impl::DeviceResources::CreateRootSignatures(_In_ ID3D12Device*
|
|||
D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS;
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS
|
||||
#ifdef _GAMING_XBOX_SCARLETT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS
|
||||
#endif
|
||||
;
|
||||
|
||||
const CD3DX12_DESCRIPTOR_RANGE textureSRV(D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 1, 0);
|
||||
|
||||
|
|
|
@ -316,7 +316,12 @@ ToneMapPostProcess::Impl::Impl(_In_ ID3D12Device* device, const RenderTargetStat
|
|||
D3D12_ROOT_SIGNATURE_FLAG_DENY_VERTEX_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS;
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS
|
||||
#ifdef _GAMING_XBOX_SCARLETT
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS
|
||||
| D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS
|
||||
#endif
|
||||
;
|
||||
|
||||
const CD3DX12_DESCRIPTOR_RANGE textureSRVs(D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 1, 0);
|
||||
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1184,7 +1184,7 @@ namespace
|
|||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
float OptimizeRGB(
|
||||
void OptimizeRGB(
|
||||
_In_reads_(NUM_PIXELS_PER_BLOCK) const HDRColorA* const pPoints,
|
||||
_Out_ HDRColorA* pX,
|
||||
_Out_ HDRColorA* pY,
|
||||
|
@ -1192,7 +1192,6 @@ namespace
|
|||
size_t cPixels,
|
||||
_In_reads_(cPixels) const size_t* pIndex) noexcept
|
||||
{
|
||||
constexpr float fError = FLT_MAX;
|
||||
const float *pC = (3 == cSteps) ? pC3 : pC4;
|
||||
const float *pD = (3 == cSteps) ? pD3 : pD4;
|
||||
|
||||
|
@ -1223,7 +1222,7 @@ namespace
|
|||
{
|
||||
pX->r = X.r; pX->g = X.g; pX->b = X.b;
|
||||
pY->r = Y.r; pY->g = Y.g; pY->b = Y.b;
|
||||
return 0.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
// Try all four axis directions, to determine which diagonal best fits data
|
||||
|
@ -1276,7 +1275,7 @@ namespace
|
|||
{
|
||||
pX->r = X.r; pX->g = X.g; pX->b = X.b;
|
||||
pY->r = Y.r; pY->g = Y.g; pY->b = Y.b;
|
||||
return 0.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
// Use Newton's Method to find local minima of sum-of-squares error.
|
||||
|
@ -1375,12 +1374,11 @@ namespace
|
|||
|
||||
pX->r = X.r; pX->g = X.g; pX->b = X.b;
|
||||
pY->r = Y.r; pY->g = Y.g; pY->b = Y.b;
|
||||
return fError;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
float OptimizeRGBA(
|
||||
void OptimizeRGBA(
|
||||
_In_reads_(NUM_PIXELS_PER_BLOCK) const HDRColorA* const pPoints,
|
||||
_Out_ HDRColorA* pX,
|
||||
_Out_ HDRColorA* pY,
|
||||
|
@ -1388,7 +1386,6 @@ namespace
|
|||
size_t cPixels,
|
||||
_In_reads_(cPixels) const size_t* pIndex) noexcept
|
||||
{
|
||||
constexpr float fError = FLT_MAX;
|
||||
const float *pC = (3 == cSteps) ? pC3 : pC4;
|
||||
const float *pD = (3 == cSteps) ? pD3 : pD4;
|
||||
|
||||
|
@ -1417,7 +1414,7 @@ namespace
|
|||
{
|
||||
*pX = X;
|
||||
*pY = Y;
|
||||
return 0.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
// Try all four axis directions, to determine which diagonal best fits data
|
||||
|
@ -1468,13 +1465,13 @@ namespace
|
|||
{
|
||||
*pX = X;
|
||||
*pY = Y;
|
||||
return 0.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
// Use Newton's Method to find local minima of sum-of-squares error.
|
||||
const auto fSteps = static_cast<float>(cSteps - 1u);
|
||||
|
||||
for (size_t iIteration = 0; iIteration < 8 && fError > 0.0f; iIteration++)
|
||||
for (size_t iIteration = 0; iIteration < 8; iIteration++)
|
||||
{
|
||||
// Calculate new steps
|
||||
HDRColorA pSteps[BC7_MAX_INDICES];
|
||||
|
@ -1544,7 +1541,6 @@ namespace
|
|||
|
||||
*pX = X;
|
||||
*pY = Y;
|
||||
return fError;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -20,13 +20,27 @@ using Microsoft::WRL::ComPtr;
|
|||
|
||||
namespace
|
||||
{
|
||||
#include "BC7Encode_EncodeBlockCS.inc"
|
||||
#include "BC7Encode_TryMode02CS.inc"
|
||||
#include "BC7Encode_TryMode137CS.inc"
|
||||
#include "BC7Encode_TryMode456CS.inc"
|
||||
#include "BC6HEncode_EncodeBlockCS.inc"
|
||||
#include "BC6HEncode_TryModeG10CS.inc"
|
||||
#include "BC6HEncode_TryModeLE10CS.inc"
|
||||
namespace cs5
|
||||
{
|
||||
#include "BC7Encode_EncodeBlockCS.inc"
|
||||
#include "BC7Encode_TryMode02CS.inc"
|
||||
#include "BC7Encode_TryMode137CS.inc"
|
||||
#include "BC7Encode_TryMode456CS.inc"
|
||||
#include "BC6HEncode_EncodeBlockCS.inc"
|
||||
#include "BC6HEncode_TryModeG10CS.inc"
|
||||
#include "BC6HEncode_TryModeLE10CS.inc"
|
||||
}
|
||||
|
||||
namespace cs4
|
||||
{
|
||||
#include "BC7Encode_EncodeBlockCS_cs40.inc"
|
||||
#include "BC7Encode_TryMode02CS_cs40.inc"
|
||||
#include "BC7Encode_TryMode137CS_cs40.inc"
|
||||
#include "BC7Encode_TryMode456CS_cs40.inc"
|
||||
#include "BC6HEncode_EncodeBlockCS_cs40.inc"
|
||||
#include "BC6HEncode_TryModeG10CS_cs40.inc"
|
||||
#include "BC6HEncode_TryModeLE10CS_cs40.inc"
|
||||
}
|
||||
|
||||
struct BufferBC6HBC7
|
||||
{
|
||||
|
@ -132,39 +146,53 @@ HRESULT GPUCompressBC::Initialize(ID3D11Device* pDevice)
|
|||
//--- Create compute shader library: BC6H -----------------------------------------
|
||||
|
||||
// Modes 11-14
|
||||
HRESULT hr = pDevice->CreateComputeShader(BC6HEncode_TryModeG10CS, sizeof(BC6HEncode_TryModeG10CS), nullptr, m_BC6H_tryModeG10CS.ReleaseAndGetAddressOf());
|
||||
auto blob = (fl >= D3D_FEATURE_LEVEL_11_0) ? cs5::BC6HEncode_TryModeG10CS : cs4::BC6HEncode_TryModeG10CS;
|
||||
auto blobSize = (fl >= D3D_FEATURE_LEVEL_11_0) ? sizeof(cs5::BC6HEncode_TryModeG10CS) : sizeof(cs4::BC6HEncode_TryModeG10CS);
|
||||
HRESULT hr = pDevice->CreateComputeShader(blob, blobSize, nullptr, m_BC6H_tryModeG10CS.ReleaseAndGetAddressOf());
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
// Modes 1-10
|
||||
hr = pDevice->CreateComputeShader(BC6HEncode_TryModeLE10CS, sizeof(BC6HEncode_TryModeLE10CS), nullptr, m_BC6H_tryModeLE10CS.ReleaseAndGetAddressOf());
|
||||
blob = (fl >= D3D_FEATURE_LEVEL_11_0) ? cs5::BC6HEncode_TryModeLE10CS : cs4::BC6HEncode_TryModeLE10CS;
|
||||
blobSize = (fl >= D3D_FEATURE_LEVEL_11_0) ? sizeof(cs5::BC6HEncode_TryModeLE10CS) : sizeof(cs4::BC6HEncode_TryModeLE10CS);
|
||||
hr = pDevice->CreateComputeShader(blob, blobSize, nullptr, m_BC6H_tryModeLE10CS.ReleaseAndGetAddressOf());
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
// Encode
|
||||
hr = pDevice->CreateComputeShader(BC6HEncode_EncodeBlockCS, sizeof(BC6HEncode_EncodeBlockCS), nullptr, m_BC6H_encodeBlockCS.ReleaseAndGetAddressOf());
|
||||
blob = (fl >= D3D_FEATURE_LEVEL_11_0) ? cs5::BC6HEncode_EncodeBlockCS : cs4::BC6HEncode_EncodeBlockCS;
|
||||
blobSize = (fl >= D3D_FEATURE_LEVEL_11_0) ? sizeof(cs5::BC6HEncode_EncodeBlockCS) : sizeof(cs4::BC6HEncode_EncodeBlockCS);
|
||||
hr = pDevice->CreateComputeShader(blob, blobSize, nullptr, m_BC6H_encodeBlockCS.ReleaseAndGetAddressOf());
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
//--- Create compute shader library: BC7 ------------------------------------------
|
||||
|
||||
// Modes 4, 5, 6
|
||||
hr = pDevice->CreateComputeShader(BC7Encode_TryMode456CS, sizeof(BC7Encode_TryMode456CS), nullptr, m_BC7_tryMode456CS.ReleaseAndGetAddressOf());
|
||||
blob = (fl >= D3D_FEATURE_LEVEL_11_0) ? cs5::BC7Encode_TryMode456CS : cs4::BC7Encode_TryMode456CS;
|
||||
blobSize = (fl >= D3D_FEATURE_LEVEL_11_0) ? sizeof(cs5::BC7Encode_TryMode456CS) : sizeof(cs4::BC7Encode_TryMode456CS);
|
||||
hr = pDevice->CreateComputeShader(blob, blobSize, nullptr, m_BC7_tryMode456CS.ReleaseAndGetAddressOf());
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
// Modes 1, 3, 7
|
||||
hr = pDevice->CreateComputeShader(BC7Encode_TryMode137CS, sizeof(BC7Encode_TryMode137CS), nullptr, m_BC7_tryMode137CS.ReleaseAndGetAddressOf());
|
||||
blob = (fl >= D3D_FEATURE_LEVEL_11_0) ? cs5::BC7Encode_TryMode137CS : cs4::BC7Encode_TryMode137CS;
|
||||
blobSize = (fl >= D3D_FEATURE_LEVEL_11_0) ? sizeof(cs5::BC7Encode_TryMode137CS) : sizeof(cs4::BC7Encode_TryMode137CS);
|
||||
hr = pDevice->CreateComputeShader(blob, blobSize, nullptr, m_BC7_tryMode137CS.ReleaseAndGetAddressOf());
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
// Modes 0, 2
|
||||
hr = pDevice->CreateComputeShader(BC7Encode_TryMode02CS, sizeof(BC7Encode_TryMode02CS), nullptr, m_BC7_tryMode02CS.ReleaseAndGetAddressOf());
|
||||
blob = (fl >= D3D_FEATURE_LEVEL_11_0) ? cs5::BC7Encode_TryMode02CS : cs4::BC7Encode_TryMode02CS;
|
||||
blobSize = (fl >= D3D_FEATURE_LEVEL_11_0) ? sizeof(cs5::BC7Encode_TryMode02CS) : sizeof(cs4::BC7Encode_TryMode02CS);
|
||||
hr = pDevice->CreateComputeShader(blob, blobSize, nullptr, m_BC7_tryMode02CS.ReleaseAndGetAddressOf());
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
// Encode
|
||||
hr = pDevice->CreateComputeShader(BC7Encode_EncodeBlockCS, sizeof(BC7Encode_EncodeBlockCS), nullptr, m_BC7_encodeBlockCS.ReleaseAndGetAddressOf());
|
||||
blob = (fl >= D3D_FEATURE_LEVEL_11_0) ? cs5::BC7Encode_EncodeBlockCS : cs4::BC7Encode_EncodeBlockCS;
|
||||
blobSize = (fl >= D3D_FEATURE_LEVEL_11_0) ? sizeof(cs5::BC7Encode_EncodeBlockCS) : sizeof(cs4::BC7Encode_EncodeBlockCS);
|
||||
hr = pDevice->CreateComputeShader(blob, blobSize, nullptr, m_BC7_encodeBlockCS.ReleaseAndGetAddressOf());
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ struct IWICImagingFactory;
|
|||
struct IWICMetadataQueryReader;
|
||||
#endif
|
||||
|
||||
#define DIRECTX_TEX_VERSION 198
|
||||
#define DIRECTX_TEX_VERSION 199
|
||||
|
||||
|
||||
namespace DirectX
|
||||
|
@ -221,6 +221,9 @@ namespace DirectX
|
|||
DDS_FLAGS_FORCE_DX9_LEGACY = 0x40000,
|
||||
// Force use of legacy header for DDS writer (will fail if unable to write as such)
|
||||
|
||||
DDS_FLAGS_FORCE_DXT5_RXGB = 0x80000,
|
||||
// Force use of 'RXGB' instead of 'DXT5' for DDS write of BC3_UNORM data
|
||||
|
||||
DDS_FLAGS_ALLOW_LARGE_FILES = 0x1000000,
|
||||
// Enables the loader to read large dimension .dds files (i.e. greater than known hardware requirements)
|
||||
};
|
||||
|
@ -575,8 +578,9 @@ namespace DirectX
|
|||
TEX_FILTER_RGB_COPY_RED = 0x1000,
|
||||
TEX_FILTER_RGB_COPY_GREEN = 0x2000,
|
||||
TEX_FILTER_RGB_COPY_BLUE = 0x4000,
|
||||
// When converting RGB to R, defaults to using grayscale. These flags indicate copying a specific channel instead
|
||||
// When converting RGB to RG, defaults to copying RED | GREEN. These flags control which channels are selected instead.
|
||||
TEX_FILTER_RGB_COPY_ALPHA = 0x8000,
|
||||
// When converting RGB(A) to R, defaults to using grayscale. These flags indicate copying a specific channel instead
|
||||
// When converting RGB(A) to RG, defaults to copying RED | GREEN. These flags control which channels are selected instead.
|
||||
|
||||
TEX_FILTER_DITHER = 0x10000,
|
||||
// Use ordered 4x4 dithering for any required conversions
|
||||
|
|
|
@ -46,7 +46,7 @@ constexpr TEX_COMPRESS_FLAGS operator|(TEX_FILTER_FLAGS a, TEX_COMPRESS_FLAGS b)
|
|||
_Use_decl_annotations_
|
||||
constexpr bool __cdecl IsValid(DXGI_FORMAT fmt) noexcept
|
||||
{
|
||||
return (static_cast<size_t>(fmt) >= 1 && static_cast<size_t>(fmt) <= 190);
|
||||
return (static_cast<size_t>(fmt) >= 1 && static_cast<size_t>(fmt) <= 191);
|
||||
}
|
||||
|
||||
_Use_decl_annotations_
|
||||
|
@ -117,27 +117,6 @@ inline bool __cdecl IsSRGB(DXGI_FORMAT fmt) noexcept
|
|||
}
|
||||
}
|
||||
|
||||
_Use_decl_annotations_
|
||||
inline bool __cdecl IsBGR(DXGI_FORMAT fmt) noexcept
|
||||
{
|
||||
switch (fmt)
|
||||
{
|
||||
case DXGI_FORMAT_B5G6R5_UNORM:
|
||||
case DXGI_FORMAT_B5G5R5A1_UNORM:
|
||||
case DXGI_FORMAT_B8G8R8A8_UNORM:
|
||||
case DXGI_FORMAT_B8G8R8X8_UNORM:
|
||||
case DXGI_FORMAT_B8G8R8A8_TYPELESS:
|
||||
case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
|
||||
case DXGI_FORMAT_B8G8R8X8_TYPELESS:
|
||||
case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB:
|
||||
case DXGI_FORMAT_B4G4R4A4_UNORM:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=====================================================================================
|
||||
// Image I/O
|
||||
|
|
|
@ -154,9 +154,14 @@ namespace
|
|||
|
||||
assert(srcImage.pixels && destImage.pixels);
|
||||
|
||||
const DXGI_FORMAT format = gpubc->GetSourceFormat();
|
||||
DXGI_FORMAT tformat = gpubc->GetSourceFormat();
|
||||
if (compress & TEX_COMPRESS_SRGB_OUT)
|
||||
{
|
||||
tformat = MakeSRGB(tformat);
|
||||
}
|
||||
const DXGI_FORMAT sformat = (compress & TEX_COMPRESS_SRGB_IN) ? MakeSRGB(srcImage.format) : srcImage.format;
|
||||
|
||||
if (srcImage.format == format)
|
||||
if (sformat == tformat)
|
||||
{
|
||||
// Input is already in our required source format
|
||||
return gpubc->Compress(srcImage, destImage);
|
||||
|
@ -169,7 +174,7 @@ namespace
|
|||
|
||||
auto const srgb = GetSRGBFlags(compress);
|
||||
|
||||
switch (format)
|
||||
switch (tformat)
|
||||
{
|
||||
case DXGI_FORMAT_R8G8B8A8_UNORM:
|
||||
hr = ConvertToRGBA32(srcImage, image, false, srgb);
|
||||
|
|
|
@ -378,14 +378,24 @@ void DirectX::Internal::CopyScanline(
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
case DXGI_FORMAT_B5G5R5A1_UNORM:
|
||||
case DXGI_FORMAT_B4G4R4A4_UNORM:
|
||||
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
|
||||
if (inSize >= 2 && outSize >= 2)
|
||||
{
|
||||
uint16_t alpha;
|
||||
if (format == DXGI_FORMAT_B4G4R4A4_UNORM)
|
||||
alpha = 0xF000;
|
||||
else if (format == WIN11_DXGI_FORMAT_A4B4G4R4_UNORM)
|
||||
alpha = 0x000F;
|
||||
else
|
||||
alpha = 0x8000;
|
||||
|
||||
if (pDestination == pSource)
|
||||
{
|
||||
auto dPtr = static_cast<uint16_t*>(pDestination);
|
||||
for (size_t count = 0; count < (outSize - 1); count += 2)
|
||||
{
|
||||
*(dPtr++) |= 0x8000;
|
||||
*(dPtr++) |= alpha;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -395,7 +405,7 @@ void DirectX::Internal::CopyScanline(
|
|||
const size_t size = std::min<size_t>(outSize, inSize);
|
||||
for (size_t count = 0; count < (size - 1); count += 2)
|
||||
{
|
||||
*(dPtr++) = uint16_t(*(sPtr++) | 0x8000);
|
||||
*(dPtr++) = uint16_t(*(sPtr++) | alpha);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -405,31 +415,6 @@ void DirectX::Internal::CopyScanline(
|
|||
case DXGI_FORMAT_A8_UNORM:
|
||||
memset(pDestination, 0xff, outSize);
|
||||
return;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
case DXGI_FORMAT_B4G4R4A4_UNORM:
|
||||
if (inSize >= 2 && outSize >= 2)
|
||||
{
|
||||
if (pDestination == pSource)
|
||||
{
|
||||
auto dPtr = static_cast<uint16_t*>(pDestination);
|
||||
for (size_t count = 0; count < (outSize - 1); count += 2)
|
||||
{
|
||||
*(dPtr++) |= 0xF000;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const uint16_t * __restrict sPtr = static_cast<const uint16_t*>(pSource);
|
||||
uint16_t * __restrict dPtr = static_cast<uint16_t*>(pDestination);
|
||||
const size_t size = std::min<size_t>(outSize, inSize);
|
||||
for (size_t count = 0; count < (size - 1); count += 2)
|
||||
{
|
||||
*(dPtr++) = uint16_t(*(sPtr++) | 0xF000);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -631,7 +616,7 @@ bool DirectX::Internal::ExpandScanline(
|
|||
assert(IsValid(outFormat) && !IsPlanar(outFormat) && !IsPalettized(outFormat));
|
||||
assert(IsValid(inFormat) && !IsPlanar(inFormat) && !IsPalettized(inFormat));
|
||||
|
||||
switch (inFormat)
|
||||
switch (static_cast<int>(inFormat))
|
||||
{
|
||||
case DXGI_FORMAT_B5G6R5_UNORM:
|
||||
if (outFormat != DXGI_FORMAT_R8G8B8A8_UNORM)
|
||||
|
@ -707,6 +692,31 @@ bool DirectX::Internal::ExpandScanline(
|
|||
}
|
||||
return false;
|
||||
|
||||
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
|
||||
if (outFormat != DXGI_FORMAT_R8G8B8A8_UNORM)
|
||||
return false;
|
||||
|
||||
// DXGI_FORMAT_A4B4G4R4_UNORM -> DXGI_FORMAT_R8G8B8A8_UNORM
|
||||
if (inSize >= 2 && outSize >= 4)
|
||||
{
|
||||
const uint16_t * __restrict sPtr = static_cast<const uint16_t*>(pSource);
|
||||
uint32_t * __restrict dPtr = static_cast<uint32_t*>(pDestination);
|
||||
|
||||
for (size_t ocount = 0, icount = 0; ((icount < (inSize - 1)) && (ocount < (outSize - 3))); icount += 2, ocount += 4)
|
||||
{
|
||||
const uint16_t t = *(sPtr++);
|
||||
|
||||
uint32_t t1 = uint32_t(((t & 0xf000) >> 8) | ((t & 0xf000) >> 12));
|
||||
uint32_t t2 = uint32_t((t & 0x0f00) | ((t & 0x0f00) << 4));
|
||||
uint32_t t3 = uint32_t(((t & 0x00f0) << 16) | ((t & 0x00f0) << 12));
|
||||
uint32_t ta = (tflags & TEXP_SCANLINE_SETALPHA) ? 0xff000000 : uint32_t(((t & 0x000f) << 28) | ((t & 0x000f) << 24));
|
||||
|
||||
*(dPtr++) = t1 | t2 | t3 | ta;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -1506,6 +1516,22 @@ _Use_decl_annotations_ bool DirectX::Internal::LoadScanline(
|
|||
}
|
||||
return false;
|
||||
|
||||
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
|
||||
if (size >= sizeof(XMUNIBBLE4))
|
||||
{
|
||||
static const XMVECTORF32 s_Scale = { { { 1.f / 15.f, 1.f / 15.f, 1.f / 15.f, 1.f / 15.f } } };
|
||||
const XMUNIBBLE4 * __restrict sPtr = static_cast<const XMUNIBBLE4*>(pSource);
|
||||
for (size_t icount = 0; icount < (size - sizeof(XMUNIBBLE4) + 1); icount += sizeof(XMUNIBBLE4))
|
||||
{
|
||||
XMVECTOR v = XMLoadUNibble4(sPtr++);
|
||||
v = XMVectorMultiply(v, s_Scale);
|
||||
if (dPtr >= ePtr) break;
|
||||
*(dPtr++) = XMVectorSwizzle<3, 2, 1, 0>(v);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
case XBOX_DXGI_FORMAT_R10G10B10_7E3_A2_FLOAT:
|
||||
// Xbox One specific 7e3 format
|
||||
if (size >= sizeof(XMUDECN4))
|
||||
|
@ -2382,6 +2408,26 @@ bool DirectX::Internal::StoreScanline(
|
|||
}
|
||||
return false;
|
||||
|
||||
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
|
||||
if (size >= sizeof(XMUNIBBLE4))
|
||||
{
|
||||
static const XMVECTORF32 s_Scale = { { { 15.f, 15.f, 15.f, 15.f } } };
|
||||
XMUNIBBLE4 * __restrict dPtr = static_cast<XMUNIBBLE4*>(pDestination);
|
||||
for (size_t icount = 0; icount < (size - sizeof(XMUNIBBLE4) + 1); icount += sizeof(XMUNIBBLE4))
|
||||
{
|
||||
if (sPtr >= ePtr) break;
|
||||
XMVECTOR v = XMVectorSwizzle<3, 2, 1, 0>(*sPtr++);
|
||||
#if defined(_M_ARM) || defined(_M_ARM64) || defined(_M_HYBRID_X86_ARM64) || defined(_M_ARM64EC) || __arm__ || __aarch64__
|
||||
v = XMVectorMultiplyAdd(v, s_Scale, g_XMOneHalf);
|
||||
#else
|
||||
v = XMVectorMultiply(v, s_Scale);
|
||||
#endif
|
||||
XMStoreUNibble4(dPtr++, v);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
case XBOX_DXGI_FORMAT_R10G10B10_7E3_A2_FLOAT:
|
||||
// Xbox One specific 7e3 format with alpha
|
||||
if (size >= sizeof(XMUDECN4))
|
||||
|
@ -2760,7 +2806,7 @@ bool DirectX::Internal::StoreScanlineLinear(
|
|||
|
||||
assert((reinterpret_cast<uintptr_t>(pSource) & 0xF) == 0);
|
||||
|
||||
switch (format)
|
||||
switch (static_cast<int>(format))
|
||||
{
|
||||
case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
|
||||
case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
|
||||
|
@ -2791,6 +2837,7 @@ bool DirectX::Internal::StoreScanlineLinear(
|
|||
case DXGI_FORMAT_B8G8R8A8_UNORM:
|
||||
case DXGI_FORMAT_B8G8R8X8_UNORM:
|
||||
case DXGI_FORMAT_B4G4R4A4_UNORM:
|
||||
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -2831,7 +2878,7 @@ bool DirectX::Internal::LoadScanlineLinear(
|
|||
DXGI_FORMAT format,
|
||||
TEX_FILTER_FLAGS flags) noexcept
|
||||
{
|
||||
switch (format)
|
||||
switch (static_cast<int>(format))
|
||||
{
|
||||
case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
|
||||
case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
|
||||
|
@ -2862,6 +2909,7 @@ bool DirectX::Internal::LoadScanlineLinear(
|
|||
case DXGI_FORMAT_B8G8R8A8_UNORM:
|
||||
case DXGI_FORMAT_B8G8R8X8_UNORM:
|
||||
case DXGI_FORMAT_B4G4R4A4_UNORM:
|
||||
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -2987,6 +3035,7 @@ namespace
|
|||
{ XBOX_DXGI_FORMAT_R10G10B10_6E4_A2_FLOAT, 10, CONVF_FLOAT | CONVF_POS_ONLY | CONVF_R | CONVF_G | CONVF_B | CONVF_A },
|
||||
{ XBOX_DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM,10, CONVF_SNORM | CONVF_R | CONVF_G | CONVF_B | CONVF_A },
|
||||
{ XBOX_DXGI_FORMAT_R4G4_UNORM, 4, CONVF_UNORM | CONVF_R | CONVF_G },
|
||||
{ WIN11_DXGI_FORMAT_A4B4G4R4_UNORM, 4, CONVF_UNORM | CONVF_BGR | CONVF_R | CONVF_G | CONVF_B | CONVF_A },
|
||||
};
|
||||
|
||||
#pragma prefast( suppress : 25004, "Signature must match bsearch" );
|
||||
|
@ -3231,8 +3280,8 @@ void DirectX::Internal::ConvertScanline(
|
|||
{
|
||||
// !CONVF_DEPTH -> CONVF_DEPTH
|
||||
|
||||
// RGB -> Depth (red channel)
|
||||
switch (flags & (TEX_FILTER_RGB_COPY_RED | TEX_FILTER_RGB_COPY_GREEN | TEX_FILTER_RGB_COPY_BLUE))
|
||||
// RGB -> Depth (red channel or other specified channel)
|
||||
switch (flags & (TEX_FILTER_RGB_COPY_RED | TEX_FILTER_RGB_COPY_GREEN | TEX_FILTER_RGB_COPY_BLUE | TEX_FILTER_RGB_COPY_ALPHA))
|
||||
{
|
||||
case TEX_FILTER_RGB_COPY_GREEN:
|
||||
{
|
||||
|
@ -3258,6 +3307,18 @@ void DirectX::Internal::ConvertScanline(
|
|||
}
|
||||
break;
|
||||
|
||||
case TEX_FILTER_RGB_COPY_ALPHA:
|
||||
{
|
||||
XMVECTOR* ptr = pBuffer;
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
const XMVECTOR v = *ptr;
|
||||
const XMVECTOR v1 = XMVectorSplatW(v);
|
||||
*ptr++ = XMVectorSelect(v, v1, g_XMSelect1000);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if ((in->flags & CONVF_UNORM) && ((in->flags & CONVF_RGB_MASK) == (CONVF_R | CONVF_G | CONVF_B)))
|
||||
{
|
||||
|
@ -3525,6 +3586,7 @@ void DirectX::Internal::ConvertScanline(
|
|||
if (((out->flags & CONVF_RGBA_MASK) == CONVF_A) && !(in->flags & CONVF_A))
|
||||
{
|
||||
// !CONVF_A -> A format
|
||||
// We ignore TEX_FILTER_RGB_COPY_ALPHA since there's no input alpha channel.
|
||||
switch (flags & (TEX_FILTER_RGB_COPY_RED | TEX_FILTER_RGB_COPY_GREEN | TEX_FILTER_RGB_COPY_BLUE))
|
||||
{
|
||||
case TEX_FILTER_RGB_COPY_GREEN:
|
||||
|
@ -3620,8 +3682,8 @@ void DirectX::Internal::ConvertScanline(
|
|||
{
|
||||
if ((out->flags & CONVF_RGB_MASK) == CONVF_R)
|
||||
{
|
||||
// RGB format -> R format
|
||||
switch (flags & (TEX_FILTER_RGB_COPY_RED | TEX_FILTER_RGB_COPY_GREEN | TEX_FILTER_RGB_COPY_BLUE))
|
||||
// RGB(A) format -> R format
|
||||
switch (flags & (TEX_FILTER_RGB_COPY_RED | TEX_FILTER_RGB_COPY_GREEN | TEX_FILTER_RGB_COPY_BLUE | TEX_FILTER_RGB_COPY_ALPHA))
|
||||
{
|
||||
case TEX_FILTER_RGB_COPY_GREEN:
|
||||
{
|
||||
|
@ -3647,6 +3709,18 @@ void DirectX::Internal::ConvertScanline(
|
|||
}
|
||||
break;
|
||||
|
||||
case TEX_FILTER_RGB_COPY_ALPHA:
|
||||
{
|
||||
XMVECTOR* ptr = pBuffer;
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
const XMVECTOR v = *ptr;
|
||||
const XMVECTOR v1 = XMVectorSplatW(v);
|
||||
*ptr++ = XMVectorSelect(v, v1, g_XMSelect1110);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (in->flags & CONVF_UNORM)
|
||||
{
|
||||
|
@ -3675,37 +3749,83 @@ void DirectX::Internal::ConvertScanline(
|
|||
}
|
||||
else if ((out->flags & CONVF_RGB_MASK) == (CONVF_R | CONVF_G))
|
||||
{
|
||||
// RGB format -> RG format
|
||||
switch (static_cast<int>(flags & (TEX_FILTER_RGB_COPY_RED | TEX_FILTER_RGB_COPY_GREEN | TEX_FILTER_RGB_COPY_BLUE)))
|
||||
if ((flags & TEX_FILTER_RGB_COPY_ALPHA) && (in->flags & CONVF_A))
|
||||
{
|
||||
case (static_cast<int>(TEX_FILTER_RGB_COPY_RED) | static_cast<int>(TEX_FILTER_RGB_COPY_BLUE)):
|
||||
// RGBA -> RG format
|
||||
switch (static_cast<int>(flags & (TEX_FILTER_RGB_COPY_RED | TEX_FILTER_RGB_COPY_GREEN | TEX_FILTER_RGB_COPY_BLUE | TEX_FILTER_RGB_COPY_ALPHA)))
|
||||
{
|
||||
XMVECTOR* ptr = pBuffer;
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
case (static_cast<int>(TEX_FILTER_RGB_COPY_RED) | static_cast<int>(TEX_FILTER_RGB_COPY_ALPHA)):
|
||||
default:
|
||||
{
|
||||
const XMVECTOR v = *ptr;
|
||||
const XMVECTOR v1 = XMVectorSwizzle<0, 2, 0, 2>(v);
|
||||
*ptr++ = XMVectorSelect(v, v1, g_XMSelect1100);
|
||||
XMVECTOR* ptr = pBuffer;
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
const XMVECTOR v = *ptr;
|
||||
const XMVECTOR v1 = XMVectorSwizzle<0, 3, 0, 3>(v);
|
||||
*ptr++ = XMVectorSelect(v, v1, g_XMSelect1100);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case (static_cast<int>(TEX_FILTER_RGB_COPY_GREEN) | static_cast<int>(TEX_FILTER_RGB_COPY_BLUE)):
|
||||
case (static_cast<int>(TEX_FILTER_RGB_COPY_GREEN) | static_cast<int>(TEX_FILTER_RGB_COPY_ALPHA)):
|
||||
{
|
||||
XMVECTOR* ptr = pBuffer;
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
const XMVECTOR v = *ptr;
|
||||
const XMVECTOR v1 = XMVectorSwizzle<1, 3, 1, 3>(v);
|
||||
*ptr++ = XMVectorSelect(v, v1, g_XMSelect1100);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case (static_cast<int>(TEX_FILTER_RGB_COPY_BLUE) | static_cast<int>(TEX_FILTER_RGB_COPY_ALPHA)):
|
||||
{
|
||||
XMVECTOR* ptr = pBuffer;
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
const XMVECTOR v = *ptr;
|
||||
const XMVECTOR v1 = XMVectorSwizzle<2, 3, 2, 3>(v);
|
||||
*ptr++ = XMVectorSelect(v, v1, g_XMSelect1100);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// RGB format -> RG format
|
||||
switch (static_cast<int>(flags & (TEX_FILTER_RGB_COPY_RED | TEX_FILTER_RGB_COPY_GREEN | TEX_FILTER_RGB_COPY_BLUE)))
|
||||
{
|
||||
XMVECTOR* ptr = pBuffer;
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
case (static_cast<int>(TEX_FILTER_RGB_COPY_RED) | static_cast<int>(TEX_FILTER_RGB_COPY_BLUE)):
|
||||
{
|
||||
const XMVECTOR v = *ptr;
|
||||
const XMVECTOR v1 = XMVectorSwizzle<1, 2, 3, 0>(v);
|
||||
*ptr++ = XMVectorSelect(v, v1, g_XMSelect1100);
|
||||
XMVECTOR* ptr = pBuffer;
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
const XMVECTOR v = *ptr;
|
||||
const XMVECTOR v1 = XMVectorSwizzle<0, 2, 0, 2>(v);
|
||||
*ptr++ = XMVectorSelect(v, v1, g_XMSelect1100);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case (static_cast<int>(TEX_FILTER_RGB_COPY_RED) | static_cast<int>(TEX_FILTER_RGB_COPY_GREEN)):
|
||||
default:
|
||||
// Leave data unchanged and the store will handle this...
|
||||
break;
|
||||
case (static_cast<int>(TEX_FILTER_RGB_COPY_GREEN) | static_cast<int>(TEX_FILTER_RGB_COPY_BLUE)):
|
||||
{
|
||||
XMVECTOR* ptr = pBuffer;
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
const XMVECTOR v = *ptr;
|
||||
const XMVECTOR v1 = XMVectorSwizzle<1, 2, 3, 0>(v);
|
||||
*ptr++ = XMVectorSelect(v, v1, g_XMSelect1100);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case (static_cast<int>(TEX_FILTER_RGB_COPY_RED) | static_cast<int>(TEX_FILTER_RGB_COPY_GREEN)):
|
||||
default:
|
||||
// Leave data unchanged and the store will handle this...
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4328,6 +4448,56 @@ bool DirectX::Internal::StoreScanlineDither(
|
|||
case DXGI_FORMAT_B4G4R4A4_UNORM:
|
||||
STORE_SCANLINE(XMUNIBBLE4, g_Scale4pc, true, true, uint8_t, 0xF, y, true)
|
||||
|
||||
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
|
||||
if (size >= sizeof(XMUNIBBLE4))
|
||||
{
|
||||
XMUNIBBLE4 * __restrict dest = static_cast<XMUNIBBLE4*>(pDestination);
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
auto index = static_cast<ptrdiff_t>((y & 1) ? (count - i - 1) : i);
|
||||
ptrdiff_t delta = (y & 1) ? -2 : 0;
|
||||
|
||||
XMVECTOR v = XMVectorSaturate(sPtr[index]);
|
||||
v = XMVectorSwizzle<3, 2, 1, 0>(v);
|
||||
v = XMVectorAdd(v, vError);
|
||||
v = XMVectorMultiply(v, g_Scale4pc);
|
||||
|
||||
XMVECTOR target;
|
||||
if (pDiffusionErrors)
|
||||
{
|
||||
target = XMVectorRound(v);
|
||||
vError = XMVectorSubtract(v, target);
|
||||
vError = XMVectorDivide(vError, g_Scale4pc);
|
||||
|
||||
// Distribute error to next scanline and next pixel
|
||||
pDiffusionErrors[index - delta] = XMVectorMultiplyAdd(g_ErrorWeight3, vError, pDiffusionErrors[index - delta]);
|
||||
pDiffusionErrors[index + 1] = XMVectorMultiplyAdd(g_ErrorWeight5, vError, pDiffusionErrors[index + 1]);
|
||||
pDiffusionErrors[index + 2 + delta] = XMVectorMultiplyAdd(g_ErrorWeight1, vError, pDiffusionErrors[index + 2 + delta]);
|
||||
vError = XMVectorMultiply(vError, g_ErrorWeight7);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Applied ordered dither
|
||||
target = XMVectorAdd(v, ordered[index & 3]);
|
||||
target = XMVectorRound(target);
|
||||
}
|
||||
|
||||
target = XMVectorClamp(target, g_XMZero, g_Scale4pc);
|
||||
|
||||
XMFLOAT4A tmp;
|
||||
XMStoreFloat4A(&tmp, target);
|
||||
|
||||
auto dPtr = &dest[index];
|
||||
if (dPtr >= ePtr) break;
|
||||
dPtr->x = uint8_t(static_cast<uint8_t>(tmp.x) & 0xF);
|
||||
dPtr->y = uint8_t(static_cast<uint8_t>(tmp.y) & 0xF);
|
||||
dPtr->z = uint8_t(static_cast<uint8_t>(tmp.z) & 0xF);
|
||||
dPtr->w = uint8_t(static_cast<uint8_t>(tmp.w) & 0xF);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
case XBOX_DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM:
|
||||
STORE_SCANLINE(XMXDECN4, g_Scale9pc, false, true, uint16_t, 0x3FF, y, false)
|
||||
|
||||
|
|
|
@ -30,23 +30,24 @@ namespace
|
|||
enum CONVERSION_FLAGS : uint32_t
|
||||
{
|
||||
CONV_FLAGS_NONE = 0x0,
|
||||
CONV_FLAGS_EXPAND = 0x1, // Conversion requires expanded pixel size
|
||||
CONV_FLAGS_NOALPHA = 0x2, // Conversion requires setting alpha to known value
|
||||
CONV_FLAGS_SWIZZLE = 0x4, // BGR/RGB order swizzling required
|
||||
CONV_FLAGS_PAL8 = 0x8, // Has an 8-bit palette
|
||||
CONV_FLAGS_888 = 0x10, // Source is an 8:8:8 (24bpp) format
|
||||
CONV_FLAGS_565 = 0x20, // Source is a 5:6:5 (16bpp) format
|
||||
CONV_FLAGS_5551 = 0x40, // Source is a 5:5:5:1 (16bpp) format
|
||||
CONV_FLAGS_4444 = 0x80, // Source is a 4:4:4:4 (16bpp) format
|
||||
CONV_FLAGS_44 = 0x100, // Source is a 4:4 (8bpp) format
|
||||
CONV_FLAGS_332 = 0x200, // Source is a 3:3:2 (8bpp) format
|
||||
CONV_FLAGS_8332 = 0x400, // Source is a 8:3:3:2 (16bpp) format
|
||||
CONV_FLAGS_A8P8 = 0x800, // Has an 8-bit palette with an alpha channel
|
||||
CONV_FLAGS_DX10 = 0x10000, // Has the 'DX10' extension header
|
||||
CONV_FLAGS_PMALPHA = 0x20000, // Contains premultiplied alpha data
|
||||
CONV_FLAGS_L8 = 0x40000, // Source is a 8 luminance format
|
||||
CONV_FLAGS_L16 = 0x80000, // Source is a 16 luminance format
|
||||
CONV_FLAGS_A8L8 = 0x100000, // Source is a 8:8 luminance format
|
||||
CONV_FLAGS_EXPAND = 0x1, // Conversion requires expanded pixel size
|
||||
CONV_FLAGS_NOALPHA = 0x2, // Conversion requires setting alpha to known value
|
||||
CONV_FLAGS_SWIZZLE = 0x4, // BGR/RGB order swizzling required
|
||||
CONV_FLAGS_PAL8 = 0x8, // Has an 8-bit palette
|
||||
CONV_FLAGS_888 = 0x10, // Source is an 8:8:8 (24bpp) format
|
||||
CONV_FLAGS_565 = 0x20, // Source is a 5:6:5 (16bpp) format
|
||||
CONV_FLAGS_5551 = 0x40, // Source is a 5:5:5:1 (16bpp) format
|
||||
CONV_FLAGS_4444 = 0x80, // Source is a 4:4:4:4 (16bpp) format
|
||||
CONV_FLAGS_44 = 0x100, // Source is a 4:4 (8bpp) format
|
||||
CONV_FLAGS_332 = 0x200, // Source is a 3:3:2 (8bpp) format
|
||||
CONV_FLAGS_8332 = 0x400, // Source is a 8:3:3:2 (16bpp) format
|
||||
CONV_FLAGS_A8P8 = 0x800, // Has an 8-bit palette with an alpha channel
|
||||
CONF_FLAGS_11ON12 = 0x1000, // D3D11on12 format
|
||||
CONV_FLAGS_DX10 = 0x10000, // Has the 'DX10' extension header
|
||||
CONV_FLAGS_PMALPHA = 0x20000, // Contains premultiplied alpha data
|
||||
CONV_FLAGS_L8 = 0x40000, // Source is a 8 luminance format
|
||||
CONV_FLAGS_L16 = 0x80000, // Source is a 16 luminance format
|
||||
CONV_FLAGS_A8L8 = 0x100000, // Source is a 8:8 luminance format
|
||||
};
|
||||
|
||||
struct LegacyDDS
|
||||
|
@ -65,6 +66,19 @@ namespace
|
|||
{ DXGI_FORMAT_BC2_UNORM, CONV_FLAGS_PMALPHA, DDSPF_DXT2 }, // D3DFMT_DXT2
|
||||
{ DXGI_FORMAT_BC3_UNORM, CONV_FLAGS_PMALPHA, DDSPF_DXT4 }, // D3DFMT_DXT4
|
||||
|
||||
// These DXT5 variants have various swizzled channels. They are returned 'as is' to the client as BC3.
|
||||
{ DXGI_FORMAT_BC3_UNORM, CONV_FLAGS_NONE, { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('A', '2', 'D', '5'), 0, 0, 0, 0, 0 } },
|
||||
{ DXGI_FORMAT_BC3_UNORM, CONV_FLAGS_NONE, { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('x', 'G', 'B', 'R'), 0, 0, 0, 0, 0 } },
|
||||
{ DXGI_FORMAT_BC3_UNORM, CONV_FLAGS_NONE, { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('R', 'x', 'B', 'G'), 0, 0, 0, 0, 0 } },
|
||||
{ DXGI_FORMAT_BC3_UNORM, CONV_FLAGS_NONE, { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('R', 'B', 'x', 'G'), 0, 0, 0, 0, 0 } },
|
||||
{ DXGI_FORMAT_BC3_UNORM, CONV_FLAGS_NONE, { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('x', 'R', 'B', 'G'), 0, 0, 0, 0, 0 } },
|
||||
{ DXGI_FORMAT_BC3_UNORM, CONV_FLAGS_NONE, { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('R', 'G', 'x', 'B'), 0, 0, 0, 0, 0 } },
|
||||
{ DXGI_FORMAT_BC3_UNORM, CONV_FLAGS_NONE, { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('x', 'G', 'x', 'R'), 0, 0, 0, 0, 0 } },
|
||||
{ DXGI_FORMAT_BC3_UNORM, CONV_FLAGS_NONE, { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('G', 'X', 'R', 'B'), 0, 0, 0, 0, 0 } },
|
||||
{ DXGI_FORMAT_BC3_UNORM, CONV_FLAGS_NONE, { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('G', 'R', 'X', 'B'), 0, 0, 0, 0, 0 } },
|
||||
{ DXGI_FORMAT_BC3_UNORM, CONV_FLAGS_NONE, { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('R', 'X', 'G', 'B'), 0, 0, 0, 0, 0 } },
|
||||
{ DXGI_FORMAT_BC3_UNORM, CONV_FLAGS_NONE, { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('B', 'R', 'G', 'X'), 0, 0, 0, 0, 0 } },
|
||||
|
||||
{ DXGI_FORMAT_BC4_UNORM, CONV_FLAGS_NONE, DDSPF_BC4_UNORM },
|
||||
{ DXGI_FORMAT_BC4_SNORM, CONV_FLAGS_NONE, DDSPF_BC4_SNORM },
|
||||
{ DXGI_FORMAT_BC5_UNORM, CONV_FLAGS_NONE, DDSPF_BC5_UNORM },
|
||||
|
@ -72,6 +86,7 @@ namespace
|
|||
|
||||
{ DXGI_FORMAT_BC4_UNORM, CONV_FLAGS_NONE, { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('A', 'T', 'I', '1'), 0, 0, 0, 0, 0 } },
|
||||
{ DXGI_FORMAT_BC5_UNORM, CONV_FLAGS_NONE, { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('A', 'T', 'I', '2'), 0, 0, 0, 0, 0 } },
|
||||
{ DXGI_FORMAT_BC5_UNORM, CONV_FLAGS_NONE, { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('A', '2', 'X', 'Y'), 0, 0, 0, 0, 0 } },
|
||||
|
||||
{ DXGI_FORMAT_BC6H_UF16, CONV_FLAGS_NONE, { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('B', 'C', '6', 'H'), 0, 0, 0, 0, 0 } },
|
||||
{ DXGI_FORMAT_BC7_UNORM, CONV_FLAGS_NONE, { sizeof(DDS_PIXELFORMAT), DDS_FOURCC, MAKEFOURCC('B', 'C', '7', 'L'), 0, 0, 0, 0, 0 } },
|
||||
|
@ -507,13 +522,20 @@ namespace
|
|||
// Special flag for handling 16bpp formats
|
||||
if (flags & DDS_FLAGS_NO_16BPP)
|
||||
{
|
||||
switch (metadata.format)
|
||||
switch (static_cast<int>(metadata.format))
|
||||
{
|
||||
case DXGI_FORMAT_B5G6R5_UNORM:
|
||||
case DXGI_FORMAT_B5G5R5A1_UNORM:
|
||||
case DXGI_FORMAT_B4G4R4A4_UNORM:
|
||||
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
|
||||
if (metadata.format == DXGI_FORMAT_B5G6R5_UNORM)
|
||||
{
|
||||
convFlags |= CONV_FLAGS_NOALPHA;
|
||||
}
|
||||
if (metadata.format == WIN11_DXGI_FORMAT_A4B4G4R4_UNORM)
|
||||
{
|
||||
convFlags |= CONV_FLAGS_4444 | CONF_FLAGS_11ON12;
|
||||
}
|
||||
metadata.format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
convFlags |= CONV_FLAGS_EXPAND;
|
||||
break;
|
||||
|
@ -606,7 +628,6 @@ HRESULT DirectX::EncodeDDSHeader(
|
|||
case DXGI_FORMAT_G8R8_G8B8_UNORM: memcpy(&ddpf, &DDSPF_G8R8_G8B8, sizeof(DDS_PIXELFORMAT)); break;
|
||||
case DXGI_FORMAT_BC1_UNORM: memcpy(&ddpf, &DDSPF_DXT1, sizeof(DDS_PIXELFORMAT)); break;
|
||||
case DXGI_FORMAT_BC2_UNORM: memcpy(&ddpf, metadata.IsPMAlpha() ? (&DDSPF_DXT2) : (&DDSPF_DXT3), sizeof(DDS_PIXELFORMAT)); break;
|
||||
case DXGI_FORMAT_BC3_UNORM: memcpy(&ddpf, metadata.IsPMAlpha() ? (&DDSPF_DXT4) : (&DDSPF_DXT5), sizeof(DDS_PIXELFORMAT)); break;
|
||||
case DXGI_FORMAT_BC4_SNORM: memcpy(&ddpf, &DDSPF_BC4_SNORM, sizeof(DDS_PIXELFORMAT)); break;
|
||||
case DXGI_FORMAT_BC5_SNORM: memcpy(&ddpf, &DDSPF_BC5_SNORM, sizeof(DDS_PIXELFORMAT)); break;
|
||||
case DXGI_FORMAT_B5G6R5_UNORM: memcpy(&ddpf, &DDSPF_R5G6B5, sizeof(DDS_PIXELFORMAT)); break;
|
||||
|
@ -619,6 +640,14 @@ HRESULT DirectX::EncodeDDSHeader(
|
|||
case DXGI_FORMAT_B4G4R4A4_UNORM: memcpy(&ddpf, &DDSPF_A4R4G4B4, sizeof(DDS_PIXELFORMAT)); break; // DXGI 1.2
|
||||
case DXGI_FORMAT_YUY2: memcpy(&ddpf, &DDSPF_YUY2, sizeof(DDS_PIXELFORMAT)); break; // DXGI 1.2
|
||||
|
||||
case DXGI_FORMAT_BC3_UNORM:
|
||||
memcpy(&ddpf, metadata.IsPMAlpha() ? (&DDSPF_DXT4) : (&DDSPF_DXT5), sizeof(DDS_PIXELFORMAT));
|
||||
if (flags & DDS_FLAGS_FORCE_DXT5_RXGB)
|
||||
{
|
||||
ddpf.fourCC = MAKEFOURCC('R', 'X', 'G', 'B');
|
||||
}
|
||||
break;
|
||||
|
||||
// Legacy D3DX formats using D3DFMT enum value as FourCC
|
||||
case DXGI_FORMAT_R32G32B32A32_FLOAT:
|
||||
ddpf.size = sizeof(DDS_PIXELFORMAT); ddpf.flags = DDS_FOURCC; ddpf.fourCC = 116; // D3DFMT_A32B32G32R32F
|
||||
|
@ -1368,7 +1397,15 @@ namespace
|
|||
{
|
||||
if (convFlags & CONV_FLAGS_EXPAND)
|
||||
{
|
||||
if (convFlags & (CONV_FLAGS_565 | CONV_FLAGS_5551 | CONV_FLAGS_4444))
|
||||
if (convFlags & CONV_FLAGS_4444)
|
||||
{
|
||||
if (!ExpandScanline(pDest, dpitch, DXGI_FORMAT_R8G8B8A8_UNORM,
|
||||
pSrc, spitch,
|
||||
(convFlags & CONF_FLAGS_11ON12) ? WIN11_DXGI_FORMAT_A4B4G4R4_UNORM : DXGI_FORMAT_B4G4R4A4_UNORM,
|
||||
tflags))
|
||||
return E_FAIL;
|
||||
}
|
||||
else if (convFlags & (CONV_FLAGS_565 | CONV_FLAGS_5551))
|
||||
{
|
||||
if (!ExpandScanline(pDest, dpitch, DXGI_FORMAT_R8G8B8A8_UNORM,
|
||||
pSrc, spitch,
|
||||
|
@ -1461,7 +1498,15 @@ namespace
|
|||
{
|
||||
if (convFlags & CONV_FLAGS_EXPAND)
|
||||
{
|
||||
if (convFlags & (CONV_FLAGS_565 | CONV_FLAGS_5551 | CONV_FLAGS_4444))
|
||||
if (convFlags & CONV_FLAGS_4444)
|
||||
{
|
||||
if (!ExpandScanline(pDest, dpitch, DXGI_FORMAT_R8G8B8A8_UNORM,
|
||||
pSrc, spitch,
|
||||
(convFlags & CONF_FLAGS_11ON12) ? WIN11_DXGI_FORMAT_A4B4G4R4_UNORM : DXGI_FORMAT_B4G4R4A4_UNORM,
|
||||
tflags))
|
||||
return E_FAIL;
|
||||
}
|
||||
else if (convFlags & (CONV_FLAGS_565 | CONV_FLAGS_5551))
|
||||
{
|
||||
if (!ExpandScanline(pDest, dpitch, DXGI_FORMAT_R8G8B8A8_UNORM,
|
||||
pSrc, spitch,
|
||||
|
|
|
@ -187,6 +187,8 @@ using WICPixelFormatGUID = GUID;
|
|||
|
||||
#define XBOX_DXGI_FORMAT_R4G4_UNORM DXGI_FORMAT(190)
|
||||
|
||||
#define WIN11_DXGI_FORMAT_A4B4G4R4_UNORM DXGI_FORMAT(191)
|
||||
|
||||
#if defined(__MINGW32__) && !defined(E_BOUNDS)
|
||||
#define E_BOUNDS static_cast<HRESULT>(0x8000000BL)
|
||||
#endif
|
||||
|
|
|
@ -454,6 +454,30 @@ bool DirectX::IsDepthStencil(DXGI_FORMAT fmt) noexcept
|
|||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
_Use_decl_annotations_
|
||||
bool DirectX::IsBGR(DXGI_FORMAT fmt) noexcept
|
||||
{
|
||||
switch (static_cast<int>(fmt))
|
||||
{
|
||||
case DXGI_FORMAT_B5G6R5_UNORM:
|
||||
case DXGI_FORMAT_B5G5R5A1_UNORM:
|
||||
case DXGI_FORMAT_B8G8R8A8_UNORM:
|
||||
case DXGI_FORMAT_B8G8R8X8_UNORM:
|
||||
case DXGI_FORMAT_B8G8R8A8_TYPELESS:
|
||||
case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
|
||||
case DXGI_FORMAT_B8G8R8X8_TYPELESS:
|
||||
case DXGI_FORMAT_B8G8R8X8_UNORM_SRGB:
|
||||
case DXGI_FORMAT_B4G4R4A4_UNORM:
|
||||
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
_Use_decl_annotations_
|
||||
bool DirectX::IsTypeless(DXGI_FORMAT fmt, bool partialTypeless) noexcept
|
||||
|
@ -551,6 +575,7 @@ bool DirectX::HasAlpha(DXGI_FORMAT fmt) noexcept
|
|||
case XBOX_DXGI_FORMAT_R10G10B10_7E3_A2_FLOAT:
|
||||
case XBOX_DXGI_FORMAT_R10G10B10_6E4_A2_FLOAT:
|
||||
case XBOX_DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM:
|
||||
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
|
||||
return true;
|
||||
|
||||
default:
|
||||
|
@ -667,6 +692,7 @@ size_t DirectX::BitsPerPixel(DXGI_FORMAT fmt) noexcept
|
|||
case DXGI_FORMAT_B4G4R4A4_UNORM:
|
||||
case WIN10_DXGI_FORMAT_P208:
|
||||
case WIN10_DXGI_FORMAT_V208:
|
||||
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
|
||||
return 16;
|
||||
|
||||
case DXGI_FORMAT_NV12:
|
||||
|
@ -867,6 +893,7 @@ size_t DirectX::BitsPerColor(DXGI_FORMAT fmt) noexcept
|
|||
|
||||
case DXGI_FORMAT_B4G4R4A4_UNORM:
|
||||
case XBOX_DXGI_FORMAT_R4G4_UNORM:
|
||||
case WIN11_DXGI_FORMAT_A4B4G4R4_UNORM:
|
||||
return 4;
|
||||
|
||||
case DXGI_FORMAT_R1_UNORM:
|
||||
|
|
|
@ -6,7 +6,7 @@ http://go.microsoft.com/fwlink/?LinkId=248926
|
|||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
**January 31, 2023**
|
||||
**June 13, 2023**
|
||||
|
||||
This package contains DirectXTex, a shared source library for reading and writing ``.DDS`` files, and performing various texture content processing operations including resizing, format conversion, mip-map generation, block compression for Direct3D runtime texture resources, and height-map to normal-map conversion. This library makes use of the Windows Image Component (WIC) APIs. It also includes ``.TGA`` and ``.HDR`` readers and writers since these image file formats are commonly used for texture content processing pipelines, but are not currently supported by a built-in WIC codec.
|
||||
|
||||
|
@ -99,7 +99,7 @@ For the latest version of DirectXTex, bug reports, etc. please visit the project
|
|||
|
||||
* The UWP projects and the Win10 classic desktop project include configurations for the ARM64 platform. Building these requires installing the ARM64 toolset.
|
||||
|
||||
* When using clang/LLVM for the ARM64 platform, the Windows 11 SDK ([22000](https://walbourn.github.io/windows-sdk-for-windows-11/)) is required.
|
||||
* When using clang/LLVM for the ARM64 platform, the Windows 11 SDK ([22000](https://walbourn.github.io/windows-sdk-for-windows-11/)) or later is required.
|
||||
|
||||
* The ``CompileShaders.cmd`` script must have Windows-style (CRLF) line-endings. If it is changed to Linux-style (LF) line-endings, it can fail to build all the required shaders.
|
||||
|
||||
|
@ -115,6 +115,8 @@ This project welcomes contributions and suggestions. Most contributions require
|
|||
|
||||
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||
|
||||
## Trademarks
|
||||
|
@ -126,3 +128,5 @@ This project may contain trademarks or logos for projects, products, or services
|
|||
The DirectXTex library is the work of Chuck Walbourn, with contributions from Matt Lee, Xin Huang, Craig Peeper, and the numerous other Microsoft engineers who developed the D3DX utility library over the years.
|
||||
|
||||
Thanks to Paul Penson for his help with the implementation of ``MemoryStreamOnBlob``.
|
||||
|
||||
Thanks to Andrew Farrier and Scott Matloff for their on-going help with code reviews.
|
|
@ -173,6 +173,7 @@ void TryModeG10CS(uint GI : SV_GroupIndex, uint3 groupID : SV_GroupID)
|
|||
if (threadInBlock < 16)
|
||||
{
|
||||
shared_temp[GI].pixel = g_Input.Load(uint3(base_x + threadInBlock % 4, base_y + threadInBlock / 4, 0)).rgb;
|
||||
shared_temp[GI].pixel = max(shared_temp[GI].pixel, float3(0,0,0));
|
||||
uint3 pixel_h = float2half(shared_temp[GI].pixel);
|
||||
shared_temp[GI].pixel_hr = half2float(pixel_h);
|
||||
shared_temp[GI].pixel_lum = dot(shared_temp[GI].pixel_hr, RGB2LUM);
|
||||
|
@ -379,6 +380,7 @@ void TryModeLE10CS(uint GI : SV_GroupIndex, uint3 groupID : SV_GroupID)
|
|||
if (threadInBlock < 16)
|
||||
{
|
||||
shared_temp[GI].pixel = g_Input.Load(uint3(base_x + threadInBlock % 4, base_y + threadInBlock / 4, 0)).rgb;
|
||||
shared_temp[GI].pixel = max(shared_temp[GI].pixel, float3(0,0,0));
|
||||
uint3 pixel_h = float2half(shared_temp[GI].pixel);
|
||||
shared_temp[GI].pixel_hr = half2float(pixel_h);
|
||||
shared_temp[GI].pixel_lum = dot(shared_temp[GI].pixel_hr, RGB2LUM);
|
||||
|
@ -603,6 +605,7 @@ void EncodeBlockCS(uint GI : SV_GroupIndex, uint3 groupID : SV_GroupID)
|
|||
if (threadInBlock < 16)
|
||||
{
|
||||
shared_temp[GI].pixel = g_Input.Load(uint3(base_x + threadInBlock % 4, base_y + threadInBlock / 4, 0)).rgb;
|
||||
shared_temp[GI].pixel = max(shared_temp[GI].pixel, float3(0,0,0));
|
||||
shared_temp[GI].pixel_lum = dot(shared_temp[GI].pixel, RGB2LUM);
|
||||
uint3 pixel_h = float2half(shared_temp[GI].pixel);
|
||||
shared_temp[GI].pixel_ph = start_quantize(pixel_h);
|
||||
|
@ -979,6 +982,7 @@ void EncodeBlockCS(uint GI : SV_GroupIndex, uint3 groupID : SV_GroupID)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef EMULATE_F16C
|
||||
uint float2half1(float f)
|
||||
{
|
||||
uint Result;
|
||||
|
@ -1011,23 +1015,15 @@ uint float2half1(float f)
|
|||
}
|
||||
return (Result|Sign);
|
||||
}
|
||||
#endif
|
||||
|
||||
uint3 float2half(float3 endPoint_f)
|
||||
{
|
||||
//uint3 sign = asuint(endPoint_f) & 0x80000000;
|
||||
//uint3 expo = asuint(endPoint_f) & 0x7F800000;
|
||||
//uint3 base = asuint(endPoint_f) & 0x007FFFFF;
|
||||
//return ( expo < 0x33800000 ) ? 0
|
||||
// //0x33800000 indicating 2^-24, which is minimal denormalized number that half can present
|
||||
// : ( ( expo < 0x38800000 ) ? ( sign >> 16 ) | ( ( base + 0x00800000 ) >> ( 23 - ( ( expo - 0x33800000 ) >> 23 ) ) )//fixed a bug in v0.2
|
||||
// //0x38800000 indicating 2^-14, which is minimal normalized number that half can present, so need to use denormalized half presentation
|
||||
// : ( ( expo == 0x7F800000 || expo > 0x47000000 ) ? ( ( sign >> 16 ) | 0x7bff )
|
||||
// // treat NaN as INF, treat INF (including NaN) as the maximum/minimum number that half can present
|
||||
// // 0x47000000 indicating 2^15, which is maximum exponent that half can present, so cut to 0x7bff which is the maximum half number
|
||||
// : ( ( sign >> 16 ) | ( ( ( expo - 0x38000000 ) | base ) >> 13 ) ) ) );
|
||||
|
||||
|
||||
#ifdef EMULATE_F16C
|
||||
return uint3(float2half1(endPoint_f.x), float2half1(endPoint_f.y), float2half1(endPoint_f.z));
|
||||
#else
|
||||
return uint3(f32tof16(endPoint_f.x), f32tof16(endPoint_f.y), f32tof16(endPoint_f.z));
|
||||
#endif
|
||||
}
|
||||
int3 start_quantize(uint3 pixel_h)
|
||||
{
|
||||
|
@ -1204,6 +1200,7 @@ void generate_palette_unquantized16(out uint3 palette, int3 low, int3 high, int
|
|||
palette = finish_unquantize(tmp);
|
||||
}
|
||||
|
||||
#ifdef EMULATE_F16C
|
||||
float half2float1(uint Value)
|
||||
{
|
||||
uint Mantissa = (uint)(Value & 0x03FF);
|
||||
|
@ -1237,16 +1234,15 @@ float half2float1(uint Value)
|
|||
|
||||
return asfloat(Result);
|
||||
}
|
||||
#endif
|
||||
|
||||
float3 half2float(uint3 color_h)
|
||||
{
|
||||
//uint3 sign = color_h & 0x8000;
|
||||
//uint3 expo = color_h & 0x7C00;
|
||||
//uint3 base = color_h & 0x03FF;
|
||||
//return ( expo == 0 ) ? asfloat( ( sign << 16 ) | asuint( float3(base) / 16777216 ) ) //16777216 = 2^24
|
||||
// : asfloat( ( sign << 16 ) | ( ( ( expo + 0x1C000 ) | base ) << 13 ) ); //0x1C000 = 0x1FC00 - 0x3C00
|
||||
|
||||
#ifdef EMULATE_F16C
|
||||
return float3(half2float1(color_h.x), half2float1(color_h.y), half2float1(color_h.z));
|
||||
#else
|
||||
return float3(f16tof32(color_h.x), f16tof32(color_h.y), f16tof32(color_h.z));
|
||||
#endif
|
||||
}
|
||||
|
||||
void block_package(inout uint4 block, int2x3 endPoint[2], uint mode_type, uint partition_index) // for mode 1 - 10
|
||||
|
|
|
@ -5,13 +5,15 @@ rem Licensed under the MIT License.
|
|||
setlocal
|
||||
set error=0
|
||||
|
||||
if %PROCESSOR_ARCHITECTURE%.==ARM64. (set FXCARCH=arm64) else (if %PROCESSOR_ARCHITECTURE%.==AMD64. (set FXCARCH=x64) else (set FXCARCH=x86))
|
||||
|
||||
set FXCOPTS=/nologo /WX /Ges /Zi /Zpc /Qstrip_reflect /Qstrip_debug
|
||||
|
||||
set PCFXC="%WindowsSdkVerBinPath%x86\fxc.exe"
|
||||
set PCFXC="%WindowsSdkVerBinPath%%FXCARCH%\fxc.exe"
|
||||
if exist %PCFXC% goto continue
|
||||
set PCFXC="%WindowsSdkBinPath%%WindowsSDKVersion%\x86\fxc.exe"
|
||||
set PCFXC="%WindowsSdkBinPath%%WindowsSDKVersion%\%FXCARCH%\fxc.exe"
|
||||
if exist %PCFXC% goto continue
|
||||
set PCFXC="%WindowsSdkDir%bin\%WindowsSDKVersion%\x86\fxc.exe"
|
||||
set PCFXC="%WindowsSdkDir%bin\%WindowsSDKVersion%\%FXCARCH%\fxc.exe"
|
||||
if exist %PCFXC% goto continue
|
||||
|
||||
set PCFXC=fxc.exe
|
||||
|
@ -44,8 +46,11 @@ endlocal
|
|||
exit /b 0
|
||||
|
||||
:CompileShader
|
||||
set fxc=%PCFXC% "%1.hlsl" %FXCOPTS% /Tcs_4_0 /E%2 "/Fh%CompileShadersOutput%\%1_%2.inc" "/Fd%CompileShadersOutput%\%1_%2.pdb" /Vn%1_%2
|
||||
set fxc=%PCFXC% "%1.hlsl" %FXCOPTS% /Tcs_5_0 /E%2 "/Fh%CompileShadersOutput%\%1_%2.inc" "/Fd%CompileShadersOutput%\%1_%2.pdb" /Vn%1_%2
|
||||
set fxc4=%PCFXC% "%1.hlsl" %FXCOPTS% /Tcs_4_0 /DEMULATE_F16C /E%2 "/Fh%CompileShadersOutput%\%1_%2_cs40.inc" "/Fd%CompileShadersOutput%\%1_%2_cs40.pdb" /Vn%1_%2
|
||||
echo.
|
||||
echo %fxc%
|
||||
%fxc% || set error=1
|
||||
echo %fxc4%
|
||||
%fxc4% || set error=1
|
||||
exit /b
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -176,7 +176,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -204,7 +204,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -230,7 +230,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -258,7 +258,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -284,7 +284,7 @@
|
|||
<ForcedUsingFiles />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -309,7 +309,7 @@
|
|||
</ForcedUsingFiles>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -412,7 +412,4 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<None Include="media\image1.png" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -75,8 +75,6 @@ void DeviceResources::CreateDeviceResources()
|
|||
#endif
|
||||
|
||||
params.GraphicsCommandQueueRingSizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.GraphicsScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.ComputeScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.DisableGeometryShaderAllocations = TRUE;
|
||||
params.DisableTessellationShaderAllocations = TRUE;
|
||||
|
||||
|
|
|
@ -92,6 +92,9 @@
|
|||
#include "PrimitiveBatch.h"
|
||||
#include "VertexTypes.h"
|
||||
|
||||
// To opt-out of telemetry uncomment the following line
|
||||
//#define ATG_DISABLE_TELEMETRY
|
||||
|
||||
namespace DX
|
||||
{
|
||||
// Helper class for COM exceptions
|
||||
|
|
|
@ -96,8 +96,6 @@ void DeviceResources::CreateDeviceResources()
|
|||
#endif
|
||||
|
||||
params.GraphicsCommandQueueRingSizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.GraphicsScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.ComputeScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.DisableGeometryShaderAllocations = TRUE;
|
||||
params.DisableTessellationShaderAllocations = TRUE;
|
||||
|
||||
|
|
|
@ -223,7 +223,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -248,7 +248,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -273,7 +273,7 @@
|
|||
<ForcedUsingFiles />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
|
@ -296,7 +296,7 @@
|
|||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\..\..\Kits\LiveTK;..\..\..\Kits\DirectXTK12\Inc;..\..\..\Kits\ATGTK;..\..\..\Kits\ATGTelemetry\GDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -327,7 +327,7 @@
|
|||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\..\..\Kits\LiveTK;..\..\..\Kits\DirectXTK12\Inc;..\..\..\Kits\ATGTK;..\..\..\Kits\ATGTelemetry\GDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -356,7 +356,7 @@
|
|||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\..\..\Kits\LiveTK;..\..\..\Kits\DirectXTK12\Inc;..\..\..\Kits\ATGTK;..\..\..\Kits\ATGTelemetry\GDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;__WRL_NO_DEFAULT_LIB__;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -387,7 +387,7 @@
|
|||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\..\..\Kits\LiveTK;..\..\..\Kits\DirectXTK12\Inc;..\..\..\Kits\ATGTK;..\..\..\Kits\ATGTelemetry\GDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;__WRL_NO_DEFAULT_LIB__;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -416,7 +416,7 @@
|
|||
<AdditionalIncludeDirectories>$(ProjectDir);..\..\..\Kits\LiveTK;..\..\..\Kits\DirectXTK12\Inc;..\..\..\Kits\ATGTK;..\..\..\Kits\ATGTelemetry\GDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
|
@ -444,7 +444,7 @@
|
|||
<AdditionalIncludeDirectories>$(ProjectDir);..\..\..\Kits\LiveTK;..\..\..\Kits\DirectXTK12\Inc;..\..\..\Kits\ATGTK;..\..\..\Kits\ATGTelemetry\GDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
|
@ -589,10 +589,4 @@
|
|||
<ReferenceCopyLocalPaths Include="$(GRDKLatest)ExtensionLibraries\PlayFab.Party.Cpp\Redist\CommonConfiguration\neutral\Party.dll" />
|
||||
<ReferenceCopyLocalPaths Include="$(GRDKLatest)ExtensionLibraries\PlayFab.PartyXboxLive.Cpp\Redist\CommonConfiguration\neutral\PartyXboxLive.dll" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="media\image1.png" />
|
||||
<None Include="media\image3.png" />
|
||||
<None Include="media\image4.png" />
|
||||
<None Include="media\image5.png" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -14,9 +14,7 @@
|
|||
#include <XGameRuntimeInit.h>
|
||||
#include <XGameErr.h>
|
||||
|
||||
#ifdef ATG_ENABLE_TELEMETRY
|
||||
#include "ATGTelemetry.h"
|
||||
#endif
|
||||
|
||||
using namespace DirectX;
|
||||
|
||||
|
@ -132,9 +130,7 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE, _In_ LPWSTR lp
|
|||
// Sample Usage Telemetry
|
||||
//
|
||||
// Disable or remove this code block to opt-out of sample usage telemetry
|
||||
#ifdef ATG_ENABLE_TELEMETRY
|
||||
ATG::SendLaunchTelemetry();
|
||||
#endif
|
||||
|
||||
GetClientRect(hwnd, &rc);
|
||||
|
||||
|
|
|
@ -130,6 +130,8 @@
|
|||
#include "Mouse.h"
|
||||
#include "RenderTargetState.h"
|
||||
|
||||
// To opt-out of telemetry uncomment the following line
|
||||
//#define ATG_DISABLE_TELEMETRY
|
||||
|
||||
namespace DX
|
||||
{
|
||||
|
|
|
@ -75,8 +75,6 @@ void DeviceResources::CreateDeviceResources()
|
|||
#endif
|
||||
|
||||
params.GraphicsCommandQueueRingSizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.GraphicsScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.ComputeScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.DisableGeometryShaderAllocations = TRUE;
|
||||
params.DisableTessellationShaderAllocations = TRUE;
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -199,7 +199,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -222,7 +222,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -245,7 +245,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -268,7 +268,7 @@
|
|||
<ForcedUsingFiles />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
|
@ -288,7 +288,7 @@
|
|||
<ForcedUsingFiles />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
|
|
|
@ -89,6 +89,9 @@
|
|||
|
||||
#include <xaudio2.h>
|
||||
|
||||
// To opt-out of telemetry uncomment the following line
|
||||
//#define ATG_DISABLE_TELEMETRY
|
||||
|
||||
namespace DX
|
||||
{
|
||||
// Helper class for COM exceptions
|
||||
|
|
|
@ -75,8 +75,6 @@ void DeviceResources::CreateDeviceResources()
|
|||
#endif
|
||||
|
||||
params.GraphicsCommandQueueRingSizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.GraphicsScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.ComputeScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.DisableGeometryShaderAllocations = TRUE;
|
||||
params.DisableTessellationShaderAllocations = TRUE;
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -204,7 +204,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -230,7 +230,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -258,7 +258,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -284,7 +284,7 @@
|
|||
<ForcedUsingFiles />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -309,7 +309,7 @@
|
|||
</ForcedUsingFiles>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -390,7 +390,4 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<None Include="media\image1.png" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -96,6 +96,9 @@
|
|||
#include <x3daudio.h>
|
||||
#include <xaudio2fx.h>
|
||||
|
||||
// To opt-out of telemetry uncomment the following line
|
||||
//#define ATG_DISABLE_TELEMETRY
|
||||
|
||||
namespace DX
|
||||
{
|
||||
// Helper class for COM exceptions
|
||||
|
|
|
@ -75,8 +75,6 @@ void DeviceResources::CreateDeviceResources()
|
|||
#endif
|
||||
|
||||
params.GraphicsCommandQueueRingSizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.GraphicsScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.ComputeScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.DisableGeometryShaderAllocations = TRUE;
|
||||
params.DisableTessellationShaderAllocations = TRUE;
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -204,7 +204,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -230,7 +230,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -258,7 +258,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -284,7 +284,7 @@
|
|||
<ForcedUsingFiles />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -309,7 +309,7 @@
|
|||
</ForcedUsingFiles>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -385,7 +385,4 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<None Include="media\image1.png" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -95,6 +95,9 @@
|
|||
#include <shapexmacontext.h>
|
||||
#include <xma2defs.h>
|
||||
|
||||
// To opt-out of telemetry uncomment the following line
|
||||
//#define ATG_DISABLE_TELEMETRY
|
||||
|
||||
namespace DX
|
||||
{
|
||||
// Helper class for COM exceptions
|
||||
|
|
|
@ -75,8 +75,6 @@ void DeviceResources::CreateDeviceResources()
|
|||
#endif
|
||||
|
||||
params.GraphicsCommandQueueRingSizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.GraphicsScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.ComputeScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.DisableGeometryShaderAllocations = TRUE;
|
||||
params.DisableTessellationShaderAllocations = TRUE;
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -204,7 +204,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -230,7 +230,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -258,7 +258,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -284,7 +284,7 @@
|
|||
<ForcedUsingFiles />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -309,7 +309,7 @@
|
|||
</ForcedUsingFiles>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -382,7 +382,4 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<None Include="media\image1.png" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -91,6 +91,9 @@
|
|||
|
||||
#include <xaudio2.h>
|
||||
|
||||
// To opt-out of telemetry uncomment the following line
|
||||
//#define ATG_DISABLE_TELEMETRY
|
||||
|
||||
namespace DX
|
||||
{
|
||||
// Helper class for COM exceptions
|
||||
|
|
|
@ -75,8 +75,6 @@ void DeviceResources::CreateDeviceResources()
|
|||
#endif
|
||||
|
||||
params.GraphicsCommandQueueRingSizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.GraphicsScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.ComputeScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.DisableGeometryShaderAllocations = TRUE;
|
||||
params.DisableTessellationShaderAllocations = TRUE;
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -204,7 +204,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -230,7 +230,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -258,7 +258,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -284,7 +284,7 @@
|
|||
<ForcedUsingFiles />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -309,7 +309,7 @@
|
|||
</ForcedUsingFiles>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -390,7 +390,4 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<None Include="media\image1.png" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -89,6 +89,9 @@
|
|||
#include "SpriteBatch.h"
|
||||
#include "SpriteFont.h"
|
||||
|
||||
// To opt-out of telemetry uncomment the following line
|
||||
//#define ATG_DISABLE_TELEMETRY
|
||||
|
||||
namespace DX
|
||||
{
|
||||
// Helper class for COM exceptions
|
||||
|
|
|
@ -75,8 +75,6 @@ void DeviceResources::CreateDeviceResources()
|
|||
#endif
|
||||
|
||||
params.GraphicsCommandQueueRingSizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.GraphicsScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.ComputeScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.DisableGeometryShaderAllocations = TRUE;
|
||||
params.DisableTessellationShaderAllocations = TRUE;
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -204,7 +204,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -230,7 +230,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -258,7 +258,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -284,7 +284,7 @@
|
|||
<ForcedUsingFiles />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -309,7 +309,7 @@
|
|||
</ForcedUsingFiles>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -395,7 +395,4 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<None Include="media\image1.png" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -96,6 +96,9 @@
|
|||
#include <mmdeviceapi.h>
|
||||
#include <wrl\implements.h>
|
||||
|
||||
// To opt-out of telemetry uncomment the following line
|
||||
//#define ATG_DISABLE_TELEMETRY
|
||||
|
||||
namespace DX
|
||||
{
|
||||
// Helper class for COM exceptions
|
||||
|
|
|
@ -75,8 +75,6 @@ void DeviceResources::CreateDeviceResources()
|
|||
#endif
|
||||
|
||||
params.GraphicsCommandQueueRingSizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.GraphicsScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.ComputeScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.DisableGeometryShaderAllocations = TRUE;
|
||||
params.DisableTessellationShaderAllocations = TRUE;
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -204,7 +204,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -230,7 +230,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -258,7 +258,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -284,7 +284,7 @@
|
|||
<ForcedUsingFiles />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -309,7 +309,7 @@
|
|||
</ForcedUsingFiles>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -389,7 +389,4 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<None Include="media\image1.png" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -95,6 +95,9 @@
|
|||
#include <mmdeviceapi.h>
|
||||
#include <wrl\implements.h>
|
||||
|
||||
// To opt-out of telemetry uncomment the following line
|
||||
//#define ATG_DISABLE_TELEMETRY
|
||||
|
||||
namespace DX
|
||||
{
|
||||
// Helper class for COM exceptions
|
||||
|
|
|
@ -176,7 +176,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -202,7 +202,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -226,7 +226,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -252,7 +252,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -276,7 +276,7 @@
|
|||
<ForcedUsingFiles />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
|
@ -299,7 +299,7 @@
|
|||
</ForcedUsingFiles>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
|
@ -435,12 +435,4 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<None Include="media\image1.png" />
|
||||
<None Include="media\image2.jpeg" />
|
||||
<None Include="media\image3.jpeg" />
|
||||
<None Include="media\image3.png" />
|
||||
<None Include="media\image4.png" />
|
||||
<None Include="media\image5.png" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -79,8 +79,6 @@ void DeviceResources::CreateDeviceResources()
|
|||
#endif
|
||||
|
||||
params.GraphicsCommandQueueRingSizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.GraphicsScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.ComputeScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.DisableGeometryShaderAllocations = (m_options & c_GeometryShaders) ? FALSE : TRUE;
|
||||
params.DisableTessellationShaderAllocations = (m_options & c_TessellationShaders) ? FALSE : TRUE;
|
||||
|
||||
|
|
|
@ -105,6 +105,9 @@
|
|||
|
||||
#include "SharedDefinitions.h"
|
||||
|
||||
// To opt-out of telemetry uncomment the following line
|
||||
//#define ATG_DISABLE_TELEMETRY
|
||||
|
||||
namespace DX
|
||||
{
|
||||
// Helper class for COM exceptions
|
||||
|
|
|
@ -236,7 +236,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -262,7 +262,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -286,7 +286,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -312,7 +312,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -336,7 +336,7 @@
|
|||
<ForcedUsingFiles />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
|
||||
|
@ -359,7 +359,7 @@
|
|||
</ForcedUsingFiles>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
|
||||
|
@ -381,7 +381,7 @@
|
|||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\..\..\Kits\DirectXTK12\Inc;..\..\..\Kits\ATGTK;..\..\..\Kits\ATGTelemetry\GDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -414,7 +414,7 @@
|
|||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\..\..\Kits\DirectXTK12\Inc;..\..\..\Kits\ATGTK;..\..\..\Kits\ATGTelemetry\GDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;__WRL_NO_DEFAULT_LIB__;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -447,7 +447,7 @@
|
|||
<AdditionalIncludeDirectories>$(ProjectDir);..\..\..\Kits\DirectXTK12\Inc;..\..\..\Kits\ATGTK;..\..\..\Kits\ATGTelemetry\GDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
|
||||
|
@ -870,10 +870,6 @@
|
|||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\packages\WinPixEventRuntime.1.0.230302001\build\WinPixEventRuntime.targets" Condition="Exists('..\..\packages\WinPixEventRuntime.1.0.230302001\build\WinPixEventRuntime.targets')" />
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<None Include="media\image1.png" />
|
||||
<None Include="media\image2.png" />
|
||||
</ItemGroup>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
|
|
|
@ -112,8 +112,6 @@ void DeviceResources::CreateDeviceResources()
|
|||
#endif
|
||||
|
||||
params.GraphicsCommandQueueRingSizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.GraphicsScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.ComputeScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.DisableGeometryShaderAllocations = TRUE;
|
||||
params.DisableTessellationShaderAllocations = TRUE;
|
||||
|
||||
|
|
|
@ -14,9 +14,7 @@
|
|||
#include <XGameRuntimeInit.h>
|
||||
#include <XGameErr.h>
|
||||
|
||||
#ifdef ATG_ENABLE_TELEMETRY
|
||||
#include "ATGTelemetry.h"
|
||||
#endif
|
||||
|
||||
using namespace DirectX;
|
||||
|
||||
|
@ -132,9 +130,7 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE, _In_ LPWSTR lp
|
|||
// Sample Usage Telemetry
|
||||
//
|
||||
// Disable or remove this code block to opt-out of sample usage telemetry
|
||||
#ifdef ATG_ENABLE_TELEMETRY
|
||||
ATG::SendLaunchTelemetry();
|
||||
#endif
|
||||
|
||||
GetClientRect(hwnd, &rc);
|
||||
|
||||
|
|
|
@ -115,6 +115,8 @@
|
|||
#include "ReadCompressedData.h"
|
||||
#include "ReadData.h"
|
||||
|
||||
// To opt-out of telemetry uncomment the following line
|
||||
//#define ATG_DISABLE_TELEMETRY
|
||||
|
||||
namespace DX
|
||||
{
|
||||
|
|
|
@ -176,7 +176,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -206,7 +206,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -234,7 +234,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -264,7 +264,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -292,7 +292,7 @@
|
|||
<ForcedUsingFiles />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
|
@ -319,7 +319,7 @@
|
|||
</ForcedUsingFiles>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
|
@ -602,9 +602,4 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<None Include="media\image1.png" />
|
||||
<None Include="media\image2.jpeg" />
|
||||
<None Include="media\image3.jpeg" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -91,8 +91,6 @@ void DeviceResources::CreateDeviceResources()
|
|||
#endif
|
||||
|
||||
params.GraphicsCommandQueueRingSizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.GraphicsScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.ComputeScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.DisableGeometryShaderAllocations = TRUE;
|
||||
params.DisableTessellationShaderAllocations = TRUE;
|
||||
|
||||
|
|
|
@ -92,6 +92,9 @@
|
|||
#include "SpriteFont.h"
|
||||
#include "VertexTypes.h"
|
||||
|
||||
// To opt-out of telemetry uncomment the following line
|
||||
//#define ATG_DISABLE_TELEMETRY
|
||||
|
||||
namespace DX
|
||||
{
|
||||
// Helper class for COM exceptions
|
||||
|
|
|
@ -176,7 +176,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -204,7 +204,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -230,7 +230,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -258,7 +258,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -284,7 +284,7 @@
|
|||
<ForcedUsingFiles />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -309,7 +309,7 @@
|
|||
</ForcedUsingFiles>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -500,8 +500,4 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<None Include="media\image1.png" />
|
||||
<None Include="media\image3.png" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -79,8 +79,6 @@ void DeviceResources::CreateDeviceResources()
|
|||
#endif
|
||||
|
||||
params.GraphicsCommandQueueRingSizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.GraphicsScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.ComputeScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.DisableGeometryShaderAllocations = (m_options & c_GeometryShaders) ? FALSE : TRUE;
|
||||
params.DisableTessellationShaderAllocations = (m_options & c_TessellationShaders) ? FALSE : TRUE;
|
||||
|
||||
|
|
|
@ -94,6 +94,9 @@
|
|||
#include "ControllerFont.h"
|
||||
#include "ReadData.h"
|
||||
|
||||
// To opt-out of telemetry uncomment the following line
|
||||
//#define ATG_DISABLE_TELEMETRY
|
||||
|
||||
namespace DX
|
||||
{
|
||||
// Helper class for COM exceptions
|
||||
|
|
|
@ -166,7 +166,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -191,7 +191,7 @@
|
|||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(IntDir);$(ProjectDir);..\..\..\..\Kits\DirectXTK12\Inc;..\..\..\..\Kits\ATGTK;..\..\..\..\Kits\ATGTelemetry\GDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -222,7 +222,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -247,7 +247,7 @@
|
|||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(IntDir);$(ProjectDir);..\..\..\..\Kits\DirectXTK12\Inc;..\..\..\..\Kits\ATGTK;..\..\..\..\Kits\ATGTelemetry\GDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;__WRL_NO_DEFAULT_LIB__;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -278,7 +278,7 @@
|
|||
</ForcedUsingFiles>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
|
@ -304,7 +304,7 @@
|
|||
</ForcedUsingFiles>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
|
@ -471,10 +471,6 @@
|
|||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\..\packages\WinPixEventRuntime.1.0.230302001\build\WinPixEventRuntime.targets" Condition="Exists('..\..\..\packages\WinPixEventRuntime.1.0.230302001\build\WinPixEventRuntime.targets')" />
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<None Include="media\image1.png" />
|
||||
<None Include="media\image3.png" />
|
||||
</ItemGroup>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
|
|
|
@ -98,8 +98,6 @@ void DeviceResources::CreateDeviceResources()
|
|||
#endif
|
||||
|
||||
params.GraphicsCommandQueueRingSizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.GraphicsScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.ComputeScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.DisableGeometryShaderAllocations = (m_options & c_GeometryShaders) ? FALSE : TRUE;
|
||||
params.DisableTessellationShaderAllocations = (m_options & c_TessellationShaders) ? FALSE : TRUE;
|
||||
params.DisableDXR = (m_options & c_EnableDXR) ? FALSE : TRUE;
|
||||
|
|
|
@ -15,9 +15,7 @@
|
|||
#include <XGameErr.h>
|
||||
#include <XSystem.h>
|
||||
|
||||
#ifdef ATG_ENABLE_TELEMETRY
|
||||
#include "ATGTelemetry.h"
|
||||
#endif
|
||||
|
||||
using namespace DirectX;
|
||||
|
||||
|
@ -162,9 +160,7 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE, _In_ LPWSTR lp
|
|||
// Sample Usage Telemetry
|
||||
//
|
||||
// Disable or remove this code block to opt-out of sample usage telemetry
|
||||
#ifdef ATG_ENABLE_TELEMETRY
|
||||
ATG::SendLaunchTelemetry();
|
||||
#endif
|
||||
|
||||
GetClientRect(hwnd, &rc);
|
||||
|
||||
|
|
|
@ -101,6 +101,9 @@
|
|||
#include "SpriteBatch.h"
|
||||
#include "SpriteFont.h"
|
||||
|
||||
// To opt-out of telemetry uncomment the following line
|
||||
//#define ATG_DISABLE_TELEMETRY
|
||||
|
||||
namespace DX
|
||||
{
|
||||
// Helper class for COM exceptions
|
||||
|
|
|
@ -176,7 +176,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -204,7 +204,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -230,7 +230,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -258,7 +258,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -284,7 +284,7 @@
|
|||
<ForcedUsingFiles />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -309,7 +309,7 @@
|
|||
</ForcedUsingFiles>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -503,9 +503,4 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<None Include="media\image1.png" />
|
||||
<None Include="media\image2.jpeg" />
|
||||
<None Include="media\image3.jpeg" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -79,8 +79,6 @@ void DeviceResources::CreateDeviceResources()
|
|||
#endif
|
||||
|
||||
params.GraphicsCommandQueueRingSizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.GraphicsScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.ComputeScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.DisableGeometryShaderAllocations = (m_options & c_GeometryShaders) ? FALSE : TRUE;
|
||||
params.DisableTessellationShaderAllocations = (m_options & c_TessellationShaders) ? FALSE : TRUE;
|
||||
|
||||
|
|
|
@ -95,6 +95,9 @@
|
|||
#include "ControllerFont.h"
|
||||
#include "ReadData.h"
|
||||
|
||||
// To opt-out of telemetry uncomment the following line
|
||||
//#define ATG_DISABLE_TELEMETRY
|
||||
|
||||
namespace DX
|
||||
{
|
||||
// Helper class for COM exceptions
|
||||
|
|
|
@ -79,8 +79,6 @@ void DeviceResources::CreateDeviceResources()
|
|||
#endif
|
||||
|
||||
params.GraphicsCommandQueueRingSizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.GraphicsScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.ComputeScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.DisableGeometryShaderAllocations = (m_options & c_GeometryShaders) ? FALSE : TRUE;
|
||||
params.DisableTessellationShaderAllocations = TRUE;
|
||||
|
||||
|
|
|
@ -245,6 +245,7 @@ Sample::Sample() noexcept(false) :
|
|||
2,
|
||||
DX::DeviceResources::c_Enable4K_UHD | DX::DeviceResources::c_EnableQHD
|
||||
| DX::DeviceResources::c_GeometryShaders | DX::DeviceResources::c_AmplificationShaders
|
||||
| DX::DeviceResources::c_ReverseDepth
|
||||
);
|
||||
m_deviceResources->SetClearColor(ATG::ColorsLinear::Background);
|
||||
}
|
||||
|
@ -287,7 +288,7 @@ void Sample::Initialize(HWND window)
|
|||
m_amCubeMapViewAdjust[5] = XMMatrixLookAtLH(c_eyePoint, lookDir, upDir);
|
||||
|
||||
// Create the projection matrices
|
||||
m_projCBM = XMMatrixPerspectiveFovLH(XM_PI * 0.5f, 1.0f, .5f, 1000.f);
|
||||
m_projCBM = XMMatrixPerspectiveFovLH(XM_PI * 0.5f, 1.0f, 1000.f, .5f);
|
||||
|
||||
m_deviceResources->SetWindow(window);
|
||||
|
||||
|
@ -560,7 +561,7 @@ void Sample::RenderSceneIntoCubeMap()
|
|||
auto const rtvHandle(m_rtvHeap->GetCpuHandle(RTVIndex::Array));
|
||||
auto const dsvHandle(m_dsvHeap->GetCpuHandle(DSVIndex::Array));
|
||||
commandList->ClearRenderTargetView(rtvHandle, ATG::ColorsLinear::Background, 0, nullptr);
|
||||
commandList->ClearDepthStencilView(dsvHandle, D3D12_CLEAR_FLAG_DEPTH, 1.0f, 0, 0, nullptr);
|
||||
commandList->ClearDepthStencilView(dsvHandle, D3D12_CLEAR_FLAG_DEPTH, 0.0f, 0, 0, nullptr);
|
||||
|
||||
commandList->OMSetRenderTargets(1, &rtvHandle, TRUE, &dsvHandle);
|
||||
|
||||
|
@ -610,7 +611,7 @@ void Sample::RenderSceneIntoCubeMap()
|
|||
auto const rtvHandle(m_rtvHeap->GetCpuHandle(view + RTVIndex::Face0));
|
||||
auto const dsvHandle(m_dsvHeap->GetCpuHandle(DSVIndex::Single));
|
||||
commandList->ClearRenderTargetView(rtvHandle, ATG::ColorsLinear::Background, 0, nullptr);
|
||||
commandList->ClearDepthStencilView(dsvHandle, D3D12_CLEAR_FLAG_DEPTH, 1.0f, 0, 0, nullptr);
|
||||
commandList->ClearDepthStencilView(dsvHandle, D3D12_CLEAR_FLAG_DEPTH, 0.0f, 0, 0, nullptr);
|
||||
|
||||
commandList->OMSetRenderTargets(1, &rtvHandle, TRUE, &dsvHandle);
|
||||
|
||||
|
@ -818,7 +819,7 @@ void Sample::Clear()
|
|||
auto const rtvDescriptor = m_deviceResources->GetRenderTargetView();
|
||||
auto const dsvDescriptor = m_deviceResources->GetDepthStencilView();
|
||||
commandList->ClearRenderTargetView(rtvDescriptor, ATG::ColorsLinear::Background, 0, nullptr);
|
||||
commandList->ClearDepthStencilView(dsvDescriptor, D3D12_CLEAR_FLAG_DEPTH, 1.0f, 0, 0, nullptr);
|
||||
commandList->ClearDepthStencilView(dsvDescriptor, D3D12_CLEAR_FLAG_DEPTH, 0.0f, 0, 0, nullptr);
|
||||
|
||||
PIXEndEvent(commandList);
|
||||
}
|
||||
|
@ -1011,7 +1012,7 @@ void Sample::CreateDeviceDependentResources()
|
|||
psoDesc.PS = { pixelShaderBlob.data(), pixelShaderBlob.size() };
|
||||
psoDesc.RasterizerState = CD3DX12_RASTERIZER_DESC(D3D12_DEFAULT);
|
||||
psoDesc.BlendState = CD3DX12_BLEND_DESC(D3D12_DEFAULT);
|
||||
psoDesc.DepthStencilState = CommonStates::DepthDefault;
|
||||
psoDesc.DepthStencilState = CommonStates::DepthReverseZ;
|
||||
psoDesc.DSVFormat = m_deviceResources->GetDepthBufferFormat();
|
||||
psoDesc.SampleMask = UINT_MAX;
|
||||
psoDesc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
|
||||
|
@ -1047,7 +1048,7 @@ void Sample::CreateDeviceDependentResources()
|
|||
psoDesc.PS = { pixelShaderBlob.data(), pixelShaderBlob.size() };
|
||||
psoDesc.RasterizerState = CD3DX12_RASTERIZER_DESC(D3D12_DEFAULT);
|
||||
psoDesc.BlendState = CD3DX12_BLEND_DESC(D3D12_DEFAULT);
|
||||
psoDesc.DepthStencilState = CommonStates::DepthDefault;
|
||||
psoDesc.DepthStencilState = CommonStates::DepthReverseZ;
|
||||
psoDesc.DSVFormat = m_deviceResources->GetDepthBufferFormat();
|
||||
psoDesc.SampleMask = UINT_MAX;
|
||||
psoDesc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
|
||||
|
@ -1080,7 +1081,7 @@ void Sample::CreateDeviceDependentResources()
|
|||
psoDesc.PS = { pixelShaderBlob.data(), pixelShaderBlob.size() };
|
||||
psoDesc.RasterizerState = CD3DX12_RASTERIZER_DESC(D3D12_DEFAULT);
|
||||
psoDesc.BlendState = CD3DX12_BLEND_DESC(D3D12_DEFAULT);
|
||||
psoDesc.DepthStencilState = CommonStates::DepthDefault;
|
||||
psoDesc.DepthStencilState = CommonStates::DepthReverseZ;
|
||||
psoDesc.DSVFormat = m_deviceResources->GetDepthBufferFormat();
|
||||
psoDesc.SampleMask = UINT_MAX;
|
||||
psoDesc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
|
||||
|
@ -1117,7 +1118,7 @@ void Sample::CreateDeviceDependentResources()
|
|||
psoDesc.DSVFormat = m_deviceResources->GetDepthBufferFormat();
|
||||
psoDesc.RasterizerState = CD3DX12_RASTERIZER_DESC(D3D12_DEFAULT);
|
||||
psoDesc.BlendState = CD3DX12_BLEND_DESC(D3D12_DEFAULT);
|
||||
psoDesc.DepthStencilState = CommonStates::DepthDefault;
|
||||
psoDesc.DepthStencilState = CommonStates::DepthReverseZ;
|
||||
psoDesc.SampleMask = UINT_MAX;
|
||||
psoDesc.SampleDesc = DefaultSampleDesc();
|
||||
|
||||
|
@ -1162,7 +1163,7 @@ void Sample::CreateDeviceDependentResources()
|
|||
1, // mipLevels
|
||||
1, 0, // sampleCount, sampleQuality
|
||||
D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL); // miscFlags
|
||||
D3D12_CLEAR_VALUE envMapDepthClearValue = CD3DX12_CLEAR_VALUE(descTex.Format, 1.0f, 0);
|
||||
D3D12_CLEAR_VALUE envMapDepthClearValue = CD3DX12_CLEAR_VALUE(descTex.Format, 0.0f, 0);
|
||||
|
||||
DX::ThrowIfFailed(device->CreateCommittedResource(
|
||||
&defaultHeap,
|
||||
|
@ -1283,7 +1284,7 @@ void Sample::CreateWindowSizeDependentResources()
|
|||
auto displayHeight = static_cast<int>(size.bottom - size.top);
|
||||
|
||||
m_camera.SetWindow(displayWidth, displayHeight);
|
||||
m_camera.SetProjectionParameters(s_fovy, 1.0f, 10000.0f, true);
|
||||
m_camera.SetProjectionParameters(s_fovy, 10000.0f, 1.0f, true);
|
||||
|
||||
m_camera.SetLookAt(Vector3(-70.0f, 150.0f, 240.0f), Vector3::Down * 15.0f);
|
||||
m_camera.SetSensitivity(500.0f, 100.0f, 1000.0f, 10.0f);
|
||||
|
|
|
@ -176,7 +176,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -204,7 +204,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -230,7 +230,7 @@
|
|||
<AdditionalUsingDirectories />
|
||||
<ForcedUsingFiles />
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -258,7 +258,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -284,7 +284,7 @@
|
|||
<ForcedUsingFiles />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
|
@ -309,7 +309,7 @@
|
|||
</ForcedUsingFiles>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalOptions>/Zc:__cplusplus /ZH:SHA_256 %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
|
@ -605,8 +605,4 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<None Include="media\image1.png" />
|
||||
<None Include="media\image2.jpeg" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -91,6 +91,9 @@
|
|||
#include "FlyCamera.h"
|
||||
#include "Meshlet.h"
|
||||
|
||||
// To opt-out of telemetry uncomment the following line
|
||||
//#define ATG_DISABLE_TELEMETRY
|
||||
|
||||
namespace DX
|
||||
{
|
||||
// Helper class for COM exceptions
|
||||
|
|
|
@ -98,8 +98,6 @@ void DeviceResources::CreateDeviceResources()
|
|||
#endif
|
||||
|
||||
params.GraphicsCommandQueueRingSizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.GraphicsScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.ComputeScratchMemorySizeBytes = static_cast<UINT>(D3D12XBOX_DEFAULT_SIZE_BYTES);
|
||||
params.DisableGeometryShaderAllocations = (m_options & c_GeometryShaders) ? FALSE : TRUE;
|
||||
params.DisableTessellationShaderAllocations = (m_options & c_TessellationShaders) ? FALSE : TRUE;
|
||||
params.DisableDXR = TRUE;
|
||||
|
|
|
@ -163,7 +163,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -188,7 +188,7 @@
|
|||
<ForcedUsingFiles>
|
||||
</ForcedUsingFiles>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;__WRL_NO_DEFAULT_LIB__;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -213,7 +213,7 @@
|
|||
</ForcedUsingFiles>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -234,7 +234,7 @@
|
|||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\..\..\Kits\DirectXTK12\Inc;..\..\..\Kits\ATGTK;..\..\..\Kits\ATGTelemetry\GDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -263,7 +263,7 @@
|
|||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);..\..\..\Kits\DirectXTK12\Inc;..\..\..\Kits\ATGTK;..\..\..\Kits\ATGTelemetry\GDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;NDEBUG;__WRL_NO_DEFAULT_LIB__;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;__WRL_NO_DEFAULT_LIB__;PROFILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
|
@ -292,7 +292,7 @@
|
|||
<AdditionalIncludeDirectories>$(ProjectDir);..\..\..\Kits\DirectXTK12\Inc;..\..\..\Kits\ATGTK;..\..\..\Kits\ATGTelemetry\GDK;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ATG_ENABLE_TELEMETRY;_DEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;__WRL_NO_DEFAULT_LIB__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>5204</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
|
@ -584,12 +584,6 @@
|
|||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\packages\WinPixEventRuntime.1.0.230302001\build\WinPixEventRuntime.targets" Condition="Exists('..\..\packages\WinPixEventRuntime.1.0.230302001\build\WinPixEventRuntime.targets')" />
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<None Include="media\image1.png" />
|
||||
<None Include="media\image3.png" />
|
||||
<None Include="media\image4.png" />
|
||||
<None Include="media\image5.png" />
|
||||
</ItemGroup>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
|
|
|
@ -14,9 +14,7 @@
|
|||
#include <XGameRuntimeInit.h>
|
||||
#include <XGameErr.h>
|
||||
|
||||
#ifdef ATG_ENABLE_TELEMETRY
|
||||
#include "ATGTelemetry.h"
|
||||
#endif
|
||||
|
||||
using namespace DirectX;
|
||||
|
||||
|
@ -116,9 +114,7 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE, _In_ LPWSTR lp
|
|||
// Sample Usage Telemetry
|
||||
//
|
||||
// Disable or remove this code block to opt-out of sample usage telemetry
|
||||
#ifdef ATG_ENABLE_TELEMETRY
|
||||
ATG::SendLaunchTelemetry();
|
||||
#endif
|
||||
|
||||
GetClientRect(hwnd, &rc);
|
||||
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче