<commit_before>function CommandQueue (ctx) {
  this._ctx = ctx
  this._commands = []
}

var ID = 0

CommandQueue.prototype.getContext = function () {
  return this._ctx
}

// currenlty this doesn't do anything but in the future it can provide:
// - defaults
// - validation
CommandQueue.prototype.createDrawCommand = function (obj) {
  obj._type = 'draw'
  obj._id = ID++
  return obj
}

CommandQueue.prototype.createClearCommand = function (obj) {
  obj._type = 'clear'
  obj._id = ID++
  return obj
}

CommandQueue.prototype.createTextureUpdateCommand = function (obj) {
}

CommandQueue.prototype.createVertexArrayUpdateCommand = function (obj) {
}

function applyUniforms (ctx, program, uniforms, debug) {
  var textureOffset = 0
  for (var uniformName in uniforms) {
    // TODO: can i do array index check instead of function call?
    // if (debug) console.log('  setUniform', uniformName, '' + uniforms[uniformName])
    if (!program.hasUniform(uniformName)) {
      // console.log('Unnecessary uniform', uniformName)
      continue
    }<commit_msg>CommandQueue added missing shader uniform check<commit_after>function CommandQueue (ctx) {
  this._ctx = ctx
  this._commands = []
}

var ID = 0

CommandQueue.prototype.getContext = function () {
  return this._ctx
}

// currenlty this doesn't do anything but in the future it can provide:
// - defaults
// - validation
CommandQueue.prototype.createDrawCommand = function (obj) {
  obj._type = 'draw'
  obj._id = ID++
  return obj
}

CommandQueue.prototype.createClearCommand = function (obj) {
  obj._type = 'clear'
  obj._id = ID++
  return obj
}

CommandQueue.prototype.createTextureUpdateCommand = function (obj) {
}

CommandQueue.prototype.createVertexArrayUpdateCommand = function (obj) {
}

function applyUniforms (ctx, program, uniforms, debug) {
  for (var requiredUniform in program._uniforms) {
    if (requiredUniform === 'uProjectionMatrix') continue
    if (requiredUniform === 'uViewMatrix') continue
    if (requiredUniform === 'uInverseViewMatrix') continue
    if (requiredUniform === 'uModelMatrix') continue
    if (requiredUniform === 'uNormalMatrix') continue
    if (uniforms[requiredUniform] === undefined) {
      console.log('missing uniform', requiredUniform)
    }
  }

  var textureOffset = 0
  for (var uniformName in uniforms) {
    // TODO: can i do array index check instead of function call?
    // if (debug) console.log('  setUniform', uniformName, '' + uniforms[uniformName])
    if (!program.hasUniform(uniformName)) {
      // console.log('Unnecessary uniform', uniformName)
      continue
    }
{'fraction_non_alphanumeric': 0.11539945966808182, 'fraction_numerical': 0.0015438054805094559, 'mean_word_length': 3.909090909090909, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7507769', 'n_tokens_mistral': 753, 'n_tokens_neox': 739, 'n_words': 212}