<commit_before>const createQuad = require('primitive-quad')

const SKYBOX_VERT = require('./shaders/skybox/skybox.vert.js')
const SKYBOX_FRAG = require('./shaders/skybox/skybox.frag.js')

const SKYTEXTURE_VERT = require('./shaders/skybox/sky-env-map.vert.js')
const SKYTEXTURE_FRAG = require('./shaders/skybox/sky-env-map.frag.js')

const Signal = require('signals')

function Skybox(opts) {
  this.type = 'Skybox'
  this.enabled = true
  this.changed = new Signal()
  this.rgbm = false
  this.backgroundBlur = 0

  const ctx = (this._ctx = opts.ctx)

  this.texture = null
  this.diffuseTexture = null
  this._dirtySunPosition = true

  this.set(opts)

  const skyboxPositions = [[-1, -1], [1, -1], [1, 1], [-1, 1]]
  const skyboxFaces = [[0, 1, 2], [0, 2, 3]]

  this._drawCommand = {
    name: 'Skybox.draw',
    pipeline: ctx.pipeline({
      vert: SKYBOX_VERT,
      frag: SKYBOX_FRAG,
      depthTest: true
    }),
    attributes: {
      aPosition: ctx.vertexBuffer(skyboxPositions)
    },
    indices: ctx.indexBuffer(skyboxFaces),
    uniforms: {
      uUseTonemapping: false,
      uExposure: 1
    }
  }
<commit_msg>Add missing USE_DRAW_BUFFERS flag to skybox shader<commit_after>const createQuad = require('primitive-quad')

const SKYBOX_VERT = require('./shaders/skybox/skybox.vert.js')
const SKYBOX_FRAG = require('./shaders/skybox/skybox.frag.js')

const SKYTEXTURE_VERT = require('./shaders/skybox/sky-env-map.vert.js')
const SKYTEXTURE_FRAG = require('./shaders/skybox/sky-env-map.frag.js')

const Signal = require('signals')

function Skybox(opts) {
  this.type = 'Skybox'
  this.enabled = true
  this.changed = new Signal()
  this.rgbm = false
  this.backgroundBlur = 0

  const ctx = (this._ctx = opts.ctx)

  this.texture = null
  this.diffuseTexture = null
  this._dirtySunPosition = true

  this.set(opts)

  const skyboxPositions = [[-1, -1], [1, -1], [1, 1], [-1, 1]]
  const skyboxFaces = [[0, 1, 2], [0, 2, 3]]

  const flags = []
  if (ctx.capabilities.maxColorAttachments > 1) {
    flags.push('#define USE_DRAW_BUFFERS')
  }

  this._drawCommand = {
    name: 'Skybox.draw',
    pipeline: ctx.pipeline({
      vert: SKYBOX_VERT,
      frag: flags.join('\n') + '\n' + SKYBOX_FRAG,
      depthTest: true
    }),
    attributes: {
      aPosition: ctx.vertexBuffer(skyboxPositions)
    },
    indices: ctx.indexBuffer(skyboxFaces),
    uniforms: {
      uUseTonemapping: false,
      uExposure: 1
    }
  }

{'fraction_non_alphanumeric': 0.14913722267871815, 'fraction_numerical': 0.013557929334428924, 'mean_word_length': 3.3173758865248226, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '1107450', 'n_tokens_mistral': 928, 'n_tokens_neox': 887, 'n_words': 177}