Table of Contents

Class OwnerTextureDispatcher

Namespace
Map.Rendering
Assembly
MapAssembly.dll

Manages GPU compute shaders for owner texture population. Full-map shader (PopulateOwnerTexture) used at load time. Indexed shader (UpdateOwnerByIndex) used at runtime — dispatches only over pixels belonging to changed provinces instead of scanning all 97.5M pixels.

public class OwnerTextureDispatcher : MonoBehaviour
Inheritance
object
OwnerTextureDispatcher

Methods

Initialize()

public void Initialize()

PopulateOwnerTexture(ProvinceQueries)

Full populate: builds entire owner buffer from simulation data. Used at load time only.

[ContextMenu("Populate Owner Texture")]
public void PopulateOwnerTexture(ProvinceQueries provinceQueries)

Parameters

provinceQueries ProvinceQueries

SetPixelIndex(uint[], uint[], uint[])

Set the per-province pixel index built at load time. Enables targeted runtime updates via UpdateOwnerByIndex compute shader.

public void SetPixelIndex(uint[] pixelCoords, uint[] offsets, uint[] counts)

Parameters

pixelCoords uint[]
offsets uint[]
counts uint[]

SetTextureManager(MapTextureManager)

public void SetTextureManager(MapTextureManager manager)

Parameters

manager MapTextureManager

UpdateOwnerTexture(ProvinceQueries, ushort[], CommandBuffer)

Incremental update: queues compute shader dispatch into a CommandBuffer for only pixels of changed provinces. Non-blocking — no GPU sync stall. Falls back to full-map dispatch if pixel index not available.

public void UpdateOwnerTexture(ProvinceQueries provinceQueries, ushort[] changedProvinces, CommandBuffer cmd)

Parameters

provinceQueries ProvinceQueries
changedProvinces ushort[]
cmd CommandBuffer