5#include <DirectXMath.h>
9#include <condition_variable>
34 void SyncPlacement(
unsigned slot, uint64_t entity,
const std::string& creative);
37 Geometry11& geometry,
unsigned first,
unsigned count,
unsigned material,
38 const DirectX::XMFLOAT4X4& world,
const DirectX::XMFLOAT4X4& view,
39 const DirectX::XMFLOAT4X4& projection,
float distanceKm);
44 Geometry11& geometry,
unsigned first,
unsigned count,
unsigned material,
45 const DirectX::XMFLOAT4X4& world,
const DirectX::XMFLOAT4X4& view,
46 const DirectX::XMFLOAT4X4& projection,
float distanceKm);
55 void FinishScene(
RenderDevice& device,
bool weatherMeasured,
const std::vector<DirectX::XMFLOAT4>& uiRects,
const char* uiBlocker =
nullptr);
58 std::vector<RECT>* drawnBounds =
nullptr);
65 using Query = Microsoft::WRL::ComPtr<ID3D11Query>;
86 std::vector<std::shared_ptr<Patch>>
patches;
113 Microsoft::WRL::ComPtr<ID3D11Buffer>
buffer;
114 Microsoft::WRL::ComPtr<ID3D11RasterizerState>
raster;
124 unsigned slot,
const CreativeMetadata* metadata,
const std::weak_ptr<void>& lifetime,
126 Geometry11& geometry,
unsigned first,
unsigned count,
unsigned program,
127 const DirectX::XMFLOAT4X4& world,
const DirectX::XMFLOAT4X4& view,
128 const DirectX::XMFLOAT4X4& projection,
float distanceKm);
129 std::vector<std::shared_ptr<Patch>>&
Mesh(
RenderDevice& device,
Geometry11& geometry,
unsigned first,
unsigned count,
const DirectX::XMFLOAT4& bounds,
unsigned frontConvention=0);
132 Microsoft::WRL::ComPtr<ID3D11ShaderResourceView>
view;
133 Microsoft::WRL::ComPtr<ID3D11Texture2D>
staging;
143 void Checkpoint(
double now,
bool force =
false);
152 std::array<Frame, RingSize>
ring;
158 Microsoft::WRL::ComPtr<ID3D11Device>
native;
159 Microsoft::WRL::ComPtr<ID3DDeviceContextState>
passState;
163 Microsoft::WRL::ComPtr<ID3D11RasterizerState>
raster;
171 Microsoft::WRL::ComPtr<ID3D11ShaderResourceView>
glassView;
HRESULT(WINAPI *CUniBuffer::_ScriptApplyDigitSubstitution)(const SCRIPT_DIGITSUBSTITUTE *
void RegisterSignDraw(RenderDevice &device, const AdViewability::Placement &placement, const CreativeMetadata *metadata, const std::weak_ptr< void > &lifetime, unsigned animationFrame, unsigned animationFrames, const AnimatedAdMetadata::Summary &average, Geometry11 &geometry, unsigned first, unsigned count, unsigned material, const DirectX::XMFLOAT4X4 &world, const DirectX::XMFLOAT4X4 &view, const DirectX::XMFLOAT4X4 &projection, float distanceKm)
AdViewability::Tracker tracker
AdDiagnostics11()=default
const AdViewability::Tracker & Results() const
void SetAnimatedInventory(bool value)
static constexpr unsigned MaximumCreativePixels
uint64_t eligibilityGeneration
uint64_t sessionAnchorUnixMs
std::vector< Candidate > candidates
Microsoft::WRL::ComPtr< ID3D11Device > metadataDevice
std::deque< Snapshot > snapshots
std::vector< VehicleIdentity > vehicles
Microsoft::WRL::ComPtr< ID3D11ShaderResourceView > opacityView
void DrawOverlay(RenderFont *font, RenderSprite *sprite, unsigned width, unsigned height, std::vector< RECT > *drawnBounds=nullptr)
void SyncPlacement(unsigned slot, uint64_t entity, const std::string &creative)
void SetEnabled(bool value)
Microsoft::WRL::ComPtr< ID3D11Device > native
static constexpr unsigned MaximumReplayDraws
std::string overlayFailure
Microsoft::WRL::ComPtr< ID3D11BlendState > opacityBlend
Microsoft::WRL::ComPtr< ID3D11Texture2D > opacityTexture
Microsoft::WRL::ComPtr< ID3D11DepthStencilState > visibleDepth
Microsoft::WRL::ComPtr< ID3D11RenderTargetView > sceneTarget
void RegisterDraw(RenderDevice &device, const AdViewability::Placement &placement, unsigned slot, Geometry11 &geometry, unsigned first, unsigned count, unsigned material, const DirectX::XMFLOAT4X4 &world, const DirectX::XMFLOAT4X4 &view, const DirectX::XMFLOAT4X4 &projection, float distanceKm)
void WetGlassResult(HRESULT result)
std::vector< std::shared_ptr< Patch > > & Mesh(RenderDevice &device, Geometry11 &geometry, unsigned first, unsigned count, const DirectX::XMFLOAT4 &bounds, unsigned frontConvention=0)
const std::string & Blocker() const
std::deque< CachedCreative > creatives
HRESULT Initialize(RenderDevice &device)
void BeginFrame(RenderDevice &device, double now, bool eligible, const char *blocker=nullptr)
const std::string & Status() const
void RegisterOverlayDraw(RenderDevice &device, Geometry11 &geometry, unsigned first, unsigned count, unsigned material)
uint64_t checkpointSequence
void Checkpoint(double now, bool force=false)
bool initializationFailed
Microsoft::WRL::ComPtr< ID3D11RasterizerState > raster
Microsoft::WRL::ComPtr< ID3D11DepthStencilState > referenceDepth
void SetOverlayVisible(bool value)
std::condition_variable logReady
Microsoft::WRL::ComPtr< ID3D11RenderTargetView > glassTarget
ID3D11RenderTargetView * CloudOpacityTarget() const
std::array< std::array< Program11, 4 >, 4 > programs
static constexpr unsigned RingSize
AdCreativeMetadata CreativeMetadata
double nextOverlayRefresh
ID3D11RenderTargetView * WetGlassExclusionTarget() const
std::array< Frame, RingSize > ring
void RegisterPreparedDraw(RenderDevice &device, const AdViewability::Placement &placement, unsigned slot, const CreativeMetadata *metadata, const std::weak_ptr< void > &lifetime, unsigned animationFrame, unsigned animationFrames, const AnimatedAdMetadata::Summary &average, Geometry11 &geometry, unsigned first, unsigned count, unsigned program, const DirectX::XMFLOAT4X4 &world, const DirectX::XMFLOAT4X4 &view, const DirectX::XMFLOAT4X4 &projection, float distanceKm)
static constexpr unsigned MaximumCandidates
Microsoft::WRL::ComPtr< ID3D11Texture2D > glassTexture
const std::string & LogPath() const
std::deque< CachedMesh > meshes
std::array< Program11, 3 > overlayPrograms
void Poll(RenderDevice &device, double now)
void FinishScene(RenderDevice &device, bool weatherMeasured, const std::vector< DirectX::XMFLOAT4 > &uiRects, const char *uiBlocker=nullptr)
const CreativeMetadata * PrepareCreative(RenderDevice &device, ID3D11ShaderResourceView *view)
Microsoft::WRL::ComPtr< ID3D11ShaderResourceView > glassView
std::atomic< bool > logFailed
HRESULT CaptureScene(RenderDevice &device)
Microsoft::WRL::ComPtr< ID3D11BlendState > noColor
double sessionAnchorSeconds
std::vector< OverlayDraw > overlays
static constexpr unsigned MaximumCreatives
Microsoft::WRL::ComPtr< ID3D11RenderTargetView > opacityTarget
bool OverlayVisible() const
std::string sessionStartUtc
Microsoft::WRL::ComPtr< ID3D11Query > Query
Microsoft::WRL::ComPtr< ID3DDeviceContextState > passState
Microsoft::WRL::ComPtr< ID3D11ShaderResourceView > view
CreativeMetadata metadata
Microsoft::WRL::ComPtr< ID3D11Texture2D > staging
std::vector< std::shared_ptr< Patch > > patches
Microsoft::WRL::ComPtr< ID3D11Buffer > sourceBuffer
std::shared_ptr< Patch > patch
AdViewability::Observation observation
std::weak_ptr< void > creativeLifetime
AdViewability::Placement placement
std::vector< unsigned > frontFacets
std::vector< unsigned > angleFacets
DirectX::XMFLOAT4 referenceTransform
std::vector< Candidate > candidates
std::array< std::array< Query, 6 >, MaximumCandidates > queries
std::vector< D3D11_RECT > scissors
Microsoft::WRL::ComPtr< ID3D11Buffer > buffer
Microsoft::WRL::ComPtr< ID3D11RasterizerState > raster
std::vector< Vertex > vertices
std::vector< Vertex > bounds
std::vector< Facet > facets
DirectX::XMFLOAT3 position