Compiler - implement gl_PointCoord and point size clamping

TRAC #11592
Author: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@70 736b8ea6-26fd-11df-bfd4-992fa37f6226
This commit is contained in:
daniel@transgaming.com 2010-03-26 04:08:39 +00:00
Родитель 76b820852b
Коммит ccad59f046
3 изменённых файлов: 11 добавлений и 7 удалений

Просмотреть файл

@ -83,6 +83,7 @@ void OutputHLSL::header()
"\n"
"static float4 gl_Color[1] = {float4(0, 0, 0, 0)};\n"
"static float4 gl_FragCoord = float4(0, 0, 0, 0);\n"
"static float2 gl_PointCoord = float2(0.5, 0.5);\n"
"static bool gl_FrontFacing = false;\n"
"\n"
"float4 gl_texture2D(sampler2D s, float2 t)\n"
@ -180,7 +181,7 @@ void OutputHLSL::header()
out << "};\n"
"\n"
"static float4 gl_Position = float4(0, 0, 0, 0);\n"
"static float gl_PointSize = float(0);\n";
"static float gl_PointSize = float(1);\n";
out << varyingGlobals;
out << "\n";
}
@ -792,7 +793,7 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
" output.gl_Position.y = -(gl_Position.y - gl_HalfPixelSize.y * gl_Position.w);\n"
" output.gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;\n"
" output.gl_Position.w = gl_Position.w;\n"
" output.gl_PointSize = gl_PointSize;\n"
" output.gl_PointSize = 1.0;\n"
" output.gl_FragCoord = gl_Position;\n";
TSymbolTableLevel *symbols = context.symbolTable.getGlobalLevel();

Просмотреть файл

@ -61,6 +61,9 @@ enum
IMPLEMENTATION_COLOR_READ_TYPE = GL_UNSIGNED_SHORT_5_6_5
};
const float ALIASED_POINT_SIZE_RANGE_MIN = 1.0f;
const float ALIASED_POINT_SIZE_RANGE_MAX = 1.0f;
// Because indices are accessed internally, we convert them to a common format.
typedef unsigned short Index;

Просмотреть файл

@ -1764,12 +1764,12 @@ void __stdcall glGetFloatv(GLenum pname, GLfloat* params)
{
switch (pname)
{
case GL_LINE_WIDTH: *params = context->lineWidth; break;
case GL_LINE_WIDTH:
*params = context->lineWidth;
break;
case GL_ALIASED_LINE_WIDTH_RANGE:
{
params[0] = 1.0f;
params[1] = 1.0f;
}
params[0] = gl::ALIASED_POINT_SIZE_RANGE_MIN;
params[1] = gl::ALIASED_POINT_SIZE_RANGE_MAX;
break;
default:
UNIMPLEMENTED(); // FIXME