2016-03-19 21:07:05 +00:00
//
// CRTContants.hpp
// Clock Signal
//
// Created by Thomas Harte on 19/03/2016.
// Copyright © 2016 Thomas Harte. All rights reserved.
//
# ifndef CRTConstants_h
# define CRTConstants_h
# include "OpenGL.hpp"
# include <cstddef>
namespace Outputs {
namespace CRT {
// Output vertices are those used to copy from an input buffer — whether it describes data that maps directly to RGB
// or is one of the intermediate buffers that we've used to convert from composite towards RGB.
2016-05-10 11:47:47 +00:00
const GLsizei OutputVertexOffsetOfHorizontal = 0 ;
const GLsizei OutputVertexOffsetOfVertical = 4 ;
2016-03-19 21:07:05 +00:00
2016-05-10 11:47:47 +00:00
const GLsizei OutputVertexSize = 8 ;
2016-03-19 21:07:05 +00:00
// Input vertices, used only in composite mode, map from the input buffer to temporary buffer locations; such
// remapping occurs to ensure a continous stream of data for each scan, giving correct out-of-bounds behaviour
2016-05-10 23:50:12 +00:00
const GLsizei SourceVertexOffsetOfInputStart = 0 ;
const GLsizei SourceVertexOffsetOfOutputStart = 4 ;
const GLsizei SourceVertexOffsetOfEnds = 8 ;
const GLsizei SourceVertexOffsetOfPhaseTimeAndAmplitude = 12 ;
2016-03-19 21:07:05 +00:00
2016-04-21 01:05:32 +00:00
const GLsizei SourceVertexSize = 16 ;
2016-03-19 21:07:05 +00:00
// These constants hold the size of the rolling buffer to which the CPU writes
2016-04-21 01:05:32 +00:00
const GLsizei InputBufferBuilderWidth = 2048 ;
2016-05-08 20:07:36 +00:00
const GLsizei InputBufferBuilderHeight = 512 ;
2016-03-19 21:07:05 +00:00
// This is the size of the intermediate buffers used during composite to RGB conversion
2016-04-21 01:05:32 +00:00
const GLsizei IntermediateBufferWidth = 2048 ;
2016-05-09 23:17:03 +00:00
const GLsizei IntermediateBufferHeight = 1024 ;
2016-03-19 21:07:05 +00:00
2016-04-14 02:14:18 +00:00
// Some internal buffer sizes
2016-05-10 23:04:03 +00:00
const GLsizeiptr OutputVertexBufferDataSize = OutputVertexSize * IntermediateBufferHeight ; // i.e. the maximum number of scans of output that can be created between draws
2016-06-30 01:16:34 +00:00
const GLsizeiptr SourceVertexBufferDataSize = SourceVertexSize * IntermediateBufferHeight * 10 ; // (the maximum number of scans) * conservative, high guess at a maximumum number of events likely to occur within a scan
// TODO: when SourceVertexBufferDataSize is exhausted, the CRT keeps filling OutputVertexBufferDataSize regardless,
// leading to empty scanlines that nevertheless clear old contents.
2016-03-19 21:07:05 +00:00
}
}
# endif /* CRTContants_h */