<commit_before>package gl

// #include <GLES2/gl2.h>
import "C"

type Uniform interface {
	// Location() C.GLint
}

type uniformBase struct {
	location C.GLint
}

// func (u uniformBase) Location() C.GLint {
// 	return u.location
// }

type Uniform1f struct {
	uniformBase
}

type Uniform2f struct {
	uniformBase
}

type Uniform3f struct {
	uniformBase
}

type Uniform4f struct {
	uniformBase
}

type Uniform1i struct {
	uniformBase
}
type Uniform2i struct {
	uniformBase
}
type Uniform3i struct {
	uniformBase
}
type Uniform4i struct {
	uniformBase
}

type UniformMatrix2f struct {
	uniformBase
}
type UniformMatrix3f struct {
	uniformBase
}
type UniformMatrix4f struct {
	uniformBase
}

func (u Uniform1f) Set(x float32) {
	C.glUniform1f(u.location, C.GLfloat(x))
}

func (u Uniform1f) Setv(data []float32) {
	C.glUniform1fv(u.location, C.GLsizei(len(data)), (*C.GLfloat)(&data[0]))
}

func (u Uniform2f) Set(x, y float32) {
	C.glUniform2f(u.location, C.GLfloat(x), C.GLfloat(y))
}

func (u Uniform2f) Setv(data []float32) {
	C.glUniform2fv(u.location, C.GLsizei(len(data)/2), (*C.GLfloat)(&data[0]))
}

func (u Uniform1i) Set(x int32) {
	C.glUniform1i(u.location, C.GLint(x))
}

func (u Uniform1i) Setv(data []int32) {
	C.glUniform1iv(u.location, C.GLsizei(len(data)), (*C.GLint)(&data[0]))
}<commit_msg>implement uniform[34]f<commit_after>package gl

// #include <GLES2/gl2.h>
import "C"

type Uniform interface {
	// Location() C.GLint
}

type uniformBase struct {
	location C.GLint
}

// func (u uniformBase) Location() C.GLint {
// 	return u.location
// }

type Uniform1f struct {
	uniformBase
}

type Uniform2f struct {
	uniformBase
}

type Uniform3f struct {
	uniformBase
}

type Uniform4f struct {
	uniformBase
}

type Uniform1i struct {
	uniformBase
}
type Uniform2i struct {
	uniformBase
}
type Uniform3i struct {
	uniformBase
}
type Uniform4i struct {
	uniformBase
}

type UniformMatrix2f struct {
	uniformBase
}
type UniformMatrix3f struct {
	uniformBase
}
type UniformMatrix4f struct {
	uniformBase
}

func (u Uniform1f) Set(x float32) {
	C.glUniform1f(u.location, C.GLfloat(x))
}

func (u Uniform1f) Setv(data []float32) {
	C.glUniform1fv(u.location, C.GLsizei(len(data)), (*C.GLfloat)(&data[0]))
}

func (u Uniform2f) Set(x, y float32) {
	C.glUniform2f(u.location, C.GLfloat(x), C.GLfloat(y))
}

func (u Uniform2f) Setv(data []float32) {
	C.glUniform2fv(u.location, C.GLsizei(len(data)/2), (*C.GLfloat)(&data[0]))
}

func (u Uniform3f) Set(x, y, z float32) {
	C.glUniform3f(u.location, C.GLfloat(x), C.GLfloat(y), C.GLfloat(z))
}

func (u Uniform3f) Setv(data []float32) {
	C.glUniform3fv(u.location, C.GLsizei(len(data)/3), (*C.GLfloat)(&data[0]))
}

func (u Uniform4f) Set(x, y, z, w float32) {
	C.glUniform4f(u.location, C.GLfloat(x), C.GLfloat(y), C.GLfloat(z), C.GLfloat(w))
}

func (u Uniform4f) Setv(data []float32) {
	C.glUniform4fv(u.location, C.GLsizei(len(data)/4), (*C.GLfloat)(&data[0]))
}

func (u Uniform1i) Set(x int32) {
	C.glUniform1i(u.location, C.GLint(x))
}

func (u Uniform1i) Setv(data []int32) {
	C.glUniform1iv(u.location, C.GLsizei(len(data)), (*C.GLint)(&data[0]))
}
{'fraction_non_alphanumeric': 0.1585209003215434, 'fraction_numerical': 0.033440514469453377, 'mean_word_length': 4.708256880733945, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6045566', 'n_tokens_mistral': 1360, 'n_tokens_neox': 1296, 'n_words': 269}