// Class: openfl._internal.stage3D.Context3DStateCache

var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this

$global.Object.defineProperty(exports, "__esModule", {value: true});

var __map_reserved = {};

// Imports

var $hxClasses = require("./../../../hxClasses_stub").default;
var $import = require("./../../../import_stub").default;
function openfl__$Vector_Vector_$Impl_$() {return require("./../../../openfl/_Vector/Vector_Impl_");}

// Constructor

var Context3DStateCache = function() {
	this._registers = (openfl__$Vector_Vector_$Impl_$().default)._new(4096);
	this.clearSettings();
}

// Meta

Context3DStateCache.__name__ = ["openfl","_internal","stage3D","Context3DStateCache"];
Context3DStateCache.prototype = {
	clearRegisters: function() {
		var numFloats = 4096;
		var _g1 = 0;
		var _g = numFloats;
		while(_g1 < _g) {
			var c = _g1++;
			(openfl__$Vector_Vector_$Impl_$().default).set(this._registers,c,-999999999.0);
		}
	},
	clearSettings: function() {
		this._srcBlendFactor = null;
		this._destBlendFactor = null;
		this._depthTestEnabled = false;
		this._depthTestMask = false;
		this._depthTestCompareMode = null;
		this._program = null;
		this._cullingMode = null;
		this._activeTexture = -1;
		this._activeVertexArray = -1;
		this._viewportOriginX = -1;
		this._viewportOriginY = -1;
		this._viewportWidth = -1;
		this._viewportHeight = -1;
		this.clearRegisters();
	},
	updateActiveTextureSample: function(texture) {
		this._activeTexture = texture;
		return true;
	},
	updateActiveVertexArray: function(vertexArray) {
		this._activeVertexArray = vertexArray;
		return true;
	},
	updateBlendDestFactor: function(factor) {
		this._destBlendFactor = factor;
		return true;
	},
	updateBlendSrcFactor: function(factor) {
		this._srcBlendFactor = factor;
		return true;
	},
	updateCullingMode: function(cullMode) {
		this._cullingMode = cullMode;
		return true;
	},
	updateDepthCompareMode: function(mode) {
		this._depthTestCompareMode = mode;
		return true;
	},
	updateDepthTestEnabled: function(test) {
		this._depthTestEnabled = test;
		return true;
	},
	updateDepthTestMask: function(mask) {
		this._depthTestMask = mask;
		return true;
	},
	updateProgram3D: function(program3d) {
		this._program = program3d;
		return true;
	},
	updateRegisters: function(mTemp,startRegister,numRegisters) {
		return true;
	},
	updateViewport: function(originX,originY,width,height) {
		this._viewportOriginX = originX;
		this._viewportOriginY = originY;
		this._viewportWidth = width;
		this._viewportHeight = height;
		return true;
	}
};
Context3DStateCache.prototype.__class__ = Context3DStateCache.prototype.constructor = $hxClasses["openfl._internal.stage3D.Context3DStateCache"] = Context3DStateCache;

// Init



// Statics


Context3DStateCache.FLOATS_PER_REGISTER = 4
Context3DStateCache.MAX_NUM_REGISTERS = 1024
Context3DStateCache.disableCache = true

// Export

exports.default = Context3DStateCache;