mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Squashed 'deps/vitaGL/' changes from fb87308d15..c816fec50f
c816fec50f Added stride arg to vglBindPackedAttribLocation. 07f4380e60 Added glUniform1i implementation. git-subtree-dir: deps/vitaGL git-subtree-split: c816fec50f823f1a7ee082042d5159dbdf16e46c
This commit is contained in:
parent
ff65c836c2
commit
4439e2fcb5
26
deps/vitaGL/source/custom_shaders.c
vendored
26
deps/vitaGL/source/custom_shaders.c
vendored
@ -279,6 +279,26 @@ GLint glGetUniformLocation(GLuint prog, const GLchar *name) {
|
||||
return (GLint)res;
|
||||
}
|
||||
|
||||
void glUniform1i(GLint location, GLint v0) {
|
||||
// Grabbing passed uniform
|
||||
uniform *u = (uniform *)location;
|
||||
if (u->ptr == NULL)
|
||||
return;
|
||||
|
||||
// Setting passed value to desired uniform
|
||||
if (u->isVertex) {
|
||||
if (vert_uniforms == NULL)
|
||||
sceGxmReserveVertexDefaultUniformBuffer(gxm_context, &vert_uniforms);
|
||||
float v0_f = (float)v0;
|
||||
sceGxmSetUniformDataF(vert_uniforms, u->ptr, 0, 1, &v0_f);
|
||||
} else {
|
||||
if (frag_uniforms == NULL)
|
||||
sceGxmReserveFragmentDefaultUniformBuffer(gxm_context, &frag_uniforms);
|
||||
float v0_f = (float)v0;
|
||||
sceGxmSetUniformDataF(frag_uniforms, u->ptr, 0, 1, &v0_f);
|
||||
}
|
||||
}
|
||||
|
||||
void glUniform1f(GLint location, GLfloat v0) {
|
||||
// Grabbing passed uniform
|
||||
uniform *u = (uniform *)location;
|
||||
@ -357,7 +377,7 @@ void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, cons
|
||||
* ------------------------------
|
||||
*/
|
||||
|
||||
void vglBindPackedAttribLocation(GLuint prog, GLuint index, const GLchar *name, const GLuint num, const GLenum type, GLuint offset) {
|
||||
void vglBindPackedAttribLocation(GLuint prog, GLuint index, const GLchar *name, const GLuint num, const GLenum type, GLuint offset, GLint stride) {
|
||||
// Grabbing passed program
|
||||
program *p = &progs[prog - 1];
|
||||
SceGxmVertexAttribute *attributes = &p->attr[index];
|
||||
@ -389,7 +409,7 @@ void vglBindPackedAttribLocation(GLuint prog, GLuint index, const GLchar *name,
|
||||
// Setting various info about the stream
|
||||
attributes->componentCount = num;
|
||||
attributes->regIndex = sceGxmProgramParameterGetResourceIndex(param);
|
||||
streams->stride = bpe * num;
|
||||
streams->stride = stride ? stride : bpe * num;
|
||||
streams->indexSource = SCE_GXM_INDEX_SOURCE_INDEX_16BIT;
|
||||
if (index >= p->attr_num)
|
||||
p->attr_num = index + 1;
|
||||
@ -397,7 +417,7 @@ void vglBindPackedAttribLocation(GLuint prog, GLuint index, const GLchar *name,
|
||||
|
||||
// Equivalent of glBindAttribLocation but for sceGxm architecture
|
||||
void vglBindAttribLocation(GLuint prog, GLuint index, const GLchar *name, const GLuint num, const GLenum type) {
|
||||
vglBindPackedAttribLocation(prog, index, name, num, type, 0);
|
||||
vglBindPackedAttribLocation(prog, index, name, num, type, 0, 0);
|
||||
}
|
||||
|
||||
// Equivalent of glVertexAttribPointer but for sceGxm architecture
|
||||
|
3
deps/vitaGL/source/vitaGL.h
vendored
3
deps/vitaGL/source/vitaGL.h
vendored
@ -355,6 +355,7 @@ void glTexParameteri(GLenum target, GLenum pname, GLint param);
|
||||
void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glTranslatef(GLfloat x, GLfloat y, GLfloat z);
|
||||
void glUniform1f(GLint location, GLfloat v0);
|
||||
void glUniform1i(GLint location, GLint v0);
|
||||
void glUniform2fv(GLint location, GLsizei count, const GLfloat *value);
|
||||
void glUniform4fv(GLint location, GLsizei count, const GLfloat *value);
|
||||
void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
@ -378,7 +379,7 @@ void vglVertexPointerMapped(const GLvoid *pointer);
|
||||
|
||||
// VGL_EXT_gxp_shaders extension implementation
|
||||
void vglBindAttribLocation(GLuint prog, GLuint index, const GLchar *name, const GLuint num, const GLenum type);
|
||||
void vglBindPackedAttribLocation(GLuint prog, GLuint index, const GLchar *name, const GLuint num, const GLenum type, GLuint offset);
|
||||
void vglBindPackedAttribLocation(GLuint prog, GLuint index, const GLchar *name, const GLuint num, const GLenum type, GLuint offset, GLint stride);
|
||||
void vglVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint count, const GLvoid *pointer);
|
||||
void vglVertexAttribPointerMapped(GLuint index, const GLvoid *pointer);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user