GLES2 translator: fix point rendering
if points are rendered the built in shader variable gl_PointSize should be active. added a call to enable VERTEX_PROGRAM_POINT_SIZE to signal opengl to activate this variable GL_POINT_SPRITE should also be enabled when rendering points Change-Id: Iba7f62844ee2208ae22700b985aef0229d75fc46
This commit is contained in:
committed by
Yochai Shefi Simchon
parent
a24932259f
commit
addc68e9f5
@@ -26,6 +26,7 @@
|
|||||||
#include <GLES2/gl2ext.h>
|
#include <GLES2/gl2ext.h>
|
||||||
#include <GLcommon/TranslatorIfaces.h>
|
#include <GLcommon/TranslatorIfaces.h>
|
||||||
#include <GLcommon/ThreadInfo.h>
|
#include <GLcommon/ThreadInfo.h>
|
||||||
|
#include <GLcommon/gldefs.h>
|
||||||
#include "GLESv2Context.h"
|
#include "GLESv2Context.h"
|
||||||
#include "GLESv2Validate.h"
|
#include "GLESv2Validate.h"
|
||||||
#include "ShaderParser.h"
|
#include "ShaderParser.h"
|
||||||
@@ -453,7 +454,20 @@ GL_APICALL void GL_APIENTRY glDrawArrays(GLenum mode, GLint first, GLsizei coun
|
|||||||
|
|
||||||
GLESConversionArrays tmpArrs;
|
GLESConversionArrays tmpArrs;
|
||||||
ctx->setupArraysPointers(tmpArrs,first,count,0,NULL,true);
|
ctx->setupArraysPointers(tmpArrs,first,count,0,NULL,true);
|
||||||
|
|
||||||
|
//Enable texture generation for GL_POINTS and gl_PointSize shader variable
|
||||||
|
//GLES2 assumes this is enabled by default, we need to set this state for GL
|
||||||
|
if (mode==GL_POINTS) {
|
||||||
|
ctx->dispatcher().glEnable(GL_POINT_SPRITE);
|
||||||
|
ctx->dispatcher().glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
ctx->dispatcher().glDrawArrays(mode,first,count);
|
ctx->dispatcher().glDrawArrays(mode,first,count);
|
||||||
|
|
||||||
|
if (mode==GL_POINTS) {
|
||||||
|
ctx->dispatcher().glDisable(GL_VERTEX_PROGRAM_POINT_SIZE);
|
||||||
|
ctx->dispatcher().glDisable(GL_POINT_SPRITE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GL_APICALL void GL_APIENTRY glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* elementsIndices){
|
GL_APICALL void GL_APIENTRY glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* elementsIndices){
|
||||||
@@ -469,7 +483,19 @@ GL_APICALL void GL_APIENTRY glDrawElements(GLenum mode, GLsizei count, GLenum t
|
|||||||
|
|
||||||
GLESConversionArrays tmpArrs;
|
GLESConversionArrays tmpArrs;
|
||||||
ctx->setupArraysPointers(tmpArrs,0,count,type,indices,false);
|
ctx->setupArraysPointers(tmpArrs,0,count,type,indices,false);
|
||||||
|
|
||||||
|
//See glDrawArrays
|
||||||
|
if (mode==GL_POINTS) {
|
||||||
|
ctx->dispatcher().glEnable(GL_POINT_SPRITE);
|
||||||
|
ctx->dispatcher().glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
ctx->dispatcher().glDrawElements(mode,count,type,indices);
|
ctx->dispatcher().glDrawElements(mode,count,type,indices);
|
||||||
|
|
||||||
|
if (mode==GL_POINTS) {
|
||||||
|
ctx->dispatcher().glDisable(GL_VERTEX_PROGRAM_POINT_SIZE);
|
||||||
|
ctx->dispatcher().glDisable(GL_POINT_SPRITE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GL_APICALL void GL_APIENTRY glEnable(GLenum cap){
|
GL_APICALL void GL_APIENTRY glEnable(GLenum cap){
|
||||||
|
|||||||
@@ -25,3 +25,5 @@ typedef double GLdouble; /* double precision float */
|
|||||||
#define GL_INT 0x1404
|
#define GL_INT 0x1404
|
||||||
#define GL_HALF_FLOAT_NV 0x140B
|
#define GL_HALF_FLOAT_NV 0x140B
|
||||||
#define GL_HALF_FLOAT 0x140B
|
#define GL_HALF_FLOAT 0x140B
|
||||||
|
#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
|
||||||
|
#define GL_POINT_SPRITE 0x8861
|
||||||
|
|||||||
Reference in New Issue
Block a user