26 snprintf(buffer,
sizeof(buffer),
"%d", i);
138 return elementSize * arraySize;
148 out << *structDeclaration;
162 const TType &
type = uniform->second->getType();
163 const TString &
name = uniform->second->getSymbol();
170 " : register(s" +
str(index) +
");\n";
173 " : register(t" +
str(index) +
");\n";
184 const TType &
type = varying->second->getType();
185 const TString &
name = varying->second->getSymbol();
206 out <<
"// Varyings\n";
209 "static float4 gl_Color[" << numColorValues <<
"] =\n"
211 for (
unsigned int i = 0;
i < numColorValues;
i++)
213 out <<
" float4(0, 0, 0, 0)";
214 if (
i + 1 != numColorValues)
224 out <<
"static float gl_Depth = 0.0;\n";
229 out <<
"static float4 gl_FragCoord = float4(0, 0, 0, 0);\n";
234 out <<
"static float2 gl_PointCoord = float2(0.5, 0.5);\n";
239 out <<
"static bool gl_FrontFacing = false;\n";
246 out <<
"struct gl_DepthRangeParameters\n"
257 out <<
"cbuffer DriverConstants : register(b1)\n"
262 out <<
" float3 dx_DepthRange : packoffset(c0);\n";
267 out <<
" float4 dx_ViewCoords : packoffset(c1);\n";
272 out <<
" float3 dx_DepthFront : packoffset(c2);\n";
281 out <<
"uniform float3 dx_DepthRange : register(c0);";
286 out <<
"uniform float4 dx_ViewCoords : register(c1);\n";
291 out <<
"uniform float3 dx_DepthFront : register(c2);\n";
299 out <<
"static gl_DepthRangeParameters gl_DepthRange = {dx_DepthRange.x, dx_DepthRange.y, dx_DepthRange.z};\n"
310 out <<
"float4 gl_texture2D(sampler2D s, float2 t)\n"
312 " return tex2D(s, t);\n"
318 out <<
"float4 gl_texture2D(Texture2D t, SamplerState s, float2 uv)\n"
320 " return t.Sample(s, uv);\n"
331 out <<
"float4 gl_texture2D(sampler2D s, float2 t, float bias)\n"
333 " return tex2Dbias(s, float4(t.x, t.y, 0, bias));\n"
339 out <<
"float4 gl_texture2D(Texture2D t, SamplerState s, float2 uv, float bias)\n"
341 " return t.SampleBias(s, uv, bias);\n"
352 out <<
"float4 gl_texture2DProj(sampler2D s, float3 t)\n"
354 " return tex2Dproj(s, float4(t.x, t.y, 0, t.z));\n"
357 "float4 gl_texture2DProj(sampler2D s, float4 t)\n"
359 " return tex2Dproj(s, t);\n"
365 out <<
"float4 gl_texture2DProj(Texture2D t, SamplerState s, float3 uvw)\n"
367 " return t.Sample(s, float2(uvw.x / uvw.z, uvw.y / uvw.z));\n"
370 "float4 gl_texture2DProj(Texture2D t, SamplerState s, float4 uvw)\n"
372 " return t.Sample(s, float2(uvw.x / uvw.w, uvw.y / uvw.w));\n"
383 out <<
"float4 gl_texture2DProj(sampler2D s, float3 t, float bias)\n"
385 " return tex2Dbias(s, float4(t.x / t.z, t.y / t.z, 0, bias));\n"
388 "float4 gl_texture2DProj(sampler2D s, float4 t, float bias)\n"
390 " return tex2Dbias(s, float4(t.x / t.w, t.y / t.w, 0, bias));\n"
396 out <<
"float4 gl_texture2DProj(Texture2D t, SamplerState s, float3 uvw, float bias)\n"
398 " return t.SampleBias(s, float2(uvw.x / uvw.z, uvw.y / uvw.z), bias);\n"
401 "float4 gl_texture2DProj(Texture2D t, SamplerState s, float4 uvw, float bias)\n"
403 " return t.SampleBias(s, float2(uvw.x / uvw.w, uvw.y / uvw.w), bias);\n"
414 out <<
"float4 gl_textureCube(samplerCUBE s, float3 t)\n"
416 " return texCUBE(s, t);\n"
422 out <<
"float4 gl_textureCube(TextureCube t, SamplerState s, float3 uvw)\n"
424 " return t.Sample(s, uvw);\n"
435 out <<
"float4 gl_textureCube(samplerCUBE s, float3 t, float bias)\n"
437 " return texCUBEbias(s, float4(t.x, t.y, t.z, bias));\n"
443 out <<
"float4 gl_textureCube(TextureCube t, SamplerState s, float3 uvw, float bias)\n"
445 " return t.SampleBias(s, uvw, bias);\n"
458 out <<
"float4 gl_texture2DLod0(sampler2D s, float2 t)\n"
460 " return tex2Dlod(s, float4(t.x, t.y, 0, 0));\n"
466 out <<
"float4 gl_texture2DLod0(Texture2D t, SamplerState s, float2 uv)\n"
468 " return t.SampleLevel(s, uv, 0);\n"
479 out <<
"float4 gl_texture2DLod0(sampler2D s, float2 t, float bias)\n"
481 " return tex2Dlod(s, float4(t.x, t.y, 0, 0));\n"
487 out <<
"float4 gl_texture2DLod0(Texture2D t, SamplerState s, float2 uv, float bias)\n"
489 " return t.SampleLevel(s, uv, 0);\n"
500 out <<
"float4 gl_texture2DProjLod0(sampler2D s, float3 t)\n"
502 " return tex2Dlod(s, float4(t.x / t.z, t.y / t.z, 0, 0));\n"
505 "float4 gl_texture2DProjLod(sampler2D s, float4 t)\n"
507 " return tex2Dlod(s, float4(t.x / t.w, t.y / t.w, 0, 0));\n"
513 out <<
"float4 gl_texture2DProjLod0(Texture2D t, SamplerState s, float3 uvw)\n"
515 " return t.SampleLevel(s, float2(uvw.x / uvw.z, uvw.y / uvw.z), 0);\n"
518 "float4 gl_texture2DProjLod0(Texture2D t, SamplerState s, float4 uvw)\n"
520 " return t.SampleLevel(s, float2(uvw.x / uvw.w, uvw.y / uvw.w), 0);\n"
531 out <<
"float4 gl_texture2DProjLod0_bias(sampler2D s, float3 t, float bias)\n"
533 " return tex2Dlod(s, float4(t.x / t.z, t.y / t.z, 0, 0));\n"
536 "float4 gl_texture2DProjLod_bias(sampler2D s, float4 t, float bias)\n"
538 " return tex2Dlod(s, float4(t.x / t.w, t.y / t.w, 0, 0));\n"
544 out <<
"float4 gl_texture2DProjLod_bias(Texture2D t, SamplerState s, float3 uvw, float bias)\n"
546 " return t.SampleLevel(s, float2(uvw.x / uvw.z, uvw.y / uvw.z), 0);\n"
549 "float4 gl_texture2DProjLod_bias(Texture2D t, SamplerState s, float4 uvw, float bias)\n"
551 " return t.SampleLevel(s, float2(uvw.x / uvw.w, uvw.y / uvw.w), 0);\n"
562 out <<
"float4 gl_textureCubeLod0(samplerCUBE s, float3 t)\n"
564 " return texCUBElod(s, float4(t.x, t.y, t.z, 0));\n"
570 out <<
"float4 gl_textureCubeLod0(TextureCube t, SamplerState s, float3 uvw)\n"
572 " return t.SampleLevel(s, uvw, 0);\n"
583 out <<
"float4 gl_textureCubeLod0(samplerCUBE s, float3 t, float bias)\n"
585 " return texCUBElod(s, float4(t.x, t.y, t.z, 0));\n"
591 out <<
"float4 gl_textureCubeLod0(TextureCube t, SamplerState s, float3 uvw, float bias)\n"
593 " return t.SampleLevel(s, uvw, 0);\n"
602 out <<
"#define GL_USES_MRT\n";
607 out <<
"#define GL_USES_FRAG_COLOR\n";
612 out <<
"#define GL_USES_FRAG_DATA\n";
617 out <<
"// Attributes\n";
620 "static float4 gl_Position = float4(0, 0, 0, 0);\n";
624 out <<
"static float gl_PointSize = float(1);\n";
634 out <<
"struct gl_DepthRangeParameters\n"
647 out <<
"cbuffer DriverConstants : register(b1)\n"
649 " float3 dx_DepthRange : packoffset(c0);\n"
658 out <<
"uniform float3 dx_DepthRange : register(c0);\n";
661 out <<
"uniform float4 dx_ViewAdjust : register(c1);\n"
667 out <<
"static gl_DepthRangeParameters gl_DepthRange = {dx_DepthRange.x, dx_DepthRange.y, dx_DepthRange.z};\n"
678 out <<
"float4 gl_texture2D(sampler2D s, float2 t)\n"
680 " return tex2Dlod(s, float4(t.x, t.y, 0, 0));\n"
686 out <<
"float4 gl_texture2D(Texture2D t, SamplerState s, float2 uv)\n"
688 " return t.SampleLevel(s, uv, 0);\n"
699 out <<
"float4 gl_texture2DLod(sampler2D s, float2 t, float lod)\n"
701 " return tex2Dlod(s, float4(t.x, t.y, 0, lod));\n"
707 out <<
"float4 gl_texture2DLod(Texture2D t, SamplerState s, float2 uv, float lod)\n"
709 " return t.SampleLevel(s, uv, lod);\n"
720 out <<
"float4 gl_texture2DProj(sampler2D s, float3 t)\n"
722 " return tex2Dlod(s, float4(t.x / t.z, t.y / t.z, 0, 0));\n"
725 "float4 gl_texture2DProj(sampler2D s, float4 t)\n"
727 " return tex2Dlod(s, float4(t.x / t.w, t.y / t.w, 0, 0));\n"
733 out <<
"float4 gl_texture2DProj(Texture2D t, SamplerState s, float3 uvw)\n"
735 " return t.SampleLevel(s, float2(uvw.x / uvw.z, uvw.y / uvw.z), 0);\n"
738 "float4 gl_texture2DProj(Texture2D t, SamplerState s, float4 uvw)\n"
740 " return t.SampleLevel(s, float2(uvw.x / uvw.w, uvw.y / uvw.w), 0);\n"
751 out <<
"float4 gl_texture2DProjLod(sampler2D s, float3 t, float lod)\n"
753 " return tex2Dlod(s, float4(t.x / t.z, t.y / t.z, 0, lod));\n"
756 "float4 gl_texture2DProjLod(sampler2D s, float4 t, float lod)\n"
758 " return tex2Dlod(s, float4(t.x / t.w, t.y / t.w, 0, lod));\n"
764 out <<
"float4 gl_texture2DProj(Texture2D t, SamplerState s, float3 uvw, float lod)\n"
766 " return t.SampleLevel(s, float2(uvw.x / uvw.z, uvw.y / uvw.z), lod);\n"
769 "float4 gl_texture2DProj(Texture2D t, SamplerState s, float4 uvw)\n"
771 " return t.SampleLevel(s, float2(uvw.x / uvw.w, uvw.y / uvw.w), lod);\n"
782 out <<
"float4 gl_textureCube(samplerCUBE s, float3 t)\n"
784 " return texCUBElod(s, float4(t.x, t.y, t.z, 0));\n"
790 out <<
"float4 gl_textureCube(TextureCube t, SamplerState s, float3 uvw)\n"
792 " return t.SampleLevel(s, uvw, 0);\n"
803 out <<
"float4 gl_textureCubeLod(samplerCUBE s, float3 t, float lod)\n"
805 " return texCUBElod(s, float4(t.x, t.y, t.z, lod));\n"
811 out <<
"float4 gl_textureCubeLod(TextureCube t, SamplerState s, float3 uvw, float lod)\n"
813 " return t.SampleLevel(s, uvw, lod);\n"
823 out <<
"#define GL_USES_FRAG_COORD\n";
828 out <<
"#define GL_USES_POINT_COORD\n";
833 out <<
"#define GL_USES_FRONT_FACING\n";
838 out <<
"#define GL_USES_POINT_SIZE\n";
843 out <<
"#define GL_USES_FRAG_DEPTH\n";
848 out <<
"#define GL_USES_DEPTH_RANGE\n";
853 out <<
"bool xor(bool p, bool q)\n"
855 " return (p || q) && !(p && q);\n"
862 out <<
"float mod(float x, float y)\n"
864 " return x - y * floor(x / y);\n"
871 out <<
"float2 mod(float2 x, float2 y)\n"
873 " return x - y * floor(x / y);\n"
880 out <<
"float2 mod(float2 x, float y)\n"
882 " return x - y * floor(x / y);\n"
889 out <<
"float3 mod(float3 x, float3 y)\n"
891 " return x - y * floor(x / y);\n"
898 out <<
"float3 mod(float3 x, float y)\n"
900 " return x - y * floor(x / y);\n"
907 out <<
"float4 mod(float4 x, float4 y)\n"
909 " return x - y * floor(x / y);\n"
916 out <<
"float4 mod(float4 x, float y)\n"
918 " return x - y * floor(x / y);\n"
925 out <<
"float faceforward(float N, float I, float Nref)\n"
927 " if(dot(Nref, I) >= 0)\n"
941 out <<
"float2 faceforward(float2 N, float2 I, float2 Nref)\n"
943 " if(dot(Nref, I) >= 0)\n"
957 out <<
"float3 faceforward(float3 N, float3 I, float3 Nref)\n"
959 " if(dot(Nref, I) >= 0)\n"
973 out <<
"float4 faceforward(float4 N, float4 I, float4 Nref)\n"
975 " if(dot(Nref, I) >= 0)\n"
989 out <<
"float atanyx(float y, float x)\n"
991 " if(x == 0 && y == 0) x = 1;\n"
992 " return atan2(y, x);\n"
998 out <<
"float2 atanyx(float2 y, float2 x)\n"
1000 " if(x[0] == 0 && y[0] == 0) x[0] = 1;\n"
1001 " if(x[1] == 0 && y[1] == 0) x[1] = 1;\n"
1002 " return float2(atan2(y[0], x[0]), atan2(y[1], x[1]));\n"
1008 out <<
"float3 atanyx(float3 y, float3 x)\n"
1010 " if(x[0] == 0 && y[0] == 0) x[0] = 1;\n"
1011 " if(x[1] == 0 && y[1] == 0) x[1] = 1;\n"
1012 " if(x[2] == 0 && y[2] == 0) x[2] = 1;\n"
1013 " return float3(atan2(y[0], x[0]), atan2(y[1], x[1]), atan2(y[2], x[2]));\n"
1019 out <<
"float4 atanyx(float4 y, float4 x)\n"
1021 " if(x[0] == 0 && y[0] == 0) x[0] = 1;\n"
1022 " if(x[1] == 0 && y[1] == 0) x[1] = 1;\n"
1023 " if(x[2] == 0 && y[2] == 0) x[2] = 1;\n"
1024 " if(x[3] == 0 && y[3] == 0) x[3] = 1;\n"
1025 " return float4(atan2(y[0], x[0]), atan2(y[1], x[1]), atan2(y[2], x[2]), atan2(y[3], x[3]));\n"
1036 if (name ==
"gl_FragColor")
1038 out <<
"gl_Color[0]";
1041 else if (name ==
"gl_FragData")
1046 else if (name ==
"gl_DepthRange")
1051 else if (name ==
"gl_FragCoord")
1056 else if (name ==
"gl_PointCoord")
1061 else if (name ==
"gl_FrontFacing")
1066 else if (name ==
"gl_PointSize")
1071 else if (name ==
"gl_FragDepthEXT")
1106 switch (node->
getOp())
1121 expression->
traverse(&searchSymbol);
1122 bool sameSymbol = searchSymbol.foundMatch();
1156 out <<
", transpose(";
1204 for (TIntermSequence::iterator sit = sequence.begin(); sit != sequence.end(); sit++)
1214 case 0: out <<
"x";
break;
1215 case 1: out <<
"y";
break;
1216 case 2: out <<
"z";
break;
1217 case 3: out <<
"w";
break;
1259 for (
size_t i = 0;
i < fields.size();
i++)
1261 const TField *field = fields[
i];
1268 if (
i < fields.size() - 1)
1319 switch (node->
getOp())
1424 switch (node->
getOp())
1445 for (TIntermSequence::iterator sit = node->
getSequence().begin(); sit != node->
getSequence().end(); sit++)
1486 for (TIntermSequence::iterator sit = sequence.begin(); sit != sequence.end(); sit++)
1498 (*sit)->traverse(
this);
1501 if (*sit != sequence.back())
1515 for (TIntermSequence::iterator sit = sequence.begin(); sit != sequence.end(); sit++)
1545 for (
unsigned int i = 0;
i < arguments.size();
i++)
1553 if (
i < arguments.size() - 1)
1591 TIntermSequence &arguments = sequence[0]->getAsAggregate()->getSequence();
1593 for (
unsigned int i = 0;
i < arguments.size();
i++)
1606 if (
i < arguments.size() - 1)
1617 if (sequence.size() > 1)
1620 sequence[1]->traverse(
this);
1646 out <<
decorate(name) << (lod0 ?
"Lod0(" :
"(");
1650 if (name ==
"texture2D")
1664 out <<
"gl_texture2D(";
1678 out <<
"gl_texture2DLod0(";
1681 else if (name ==
"texture2DProj")
1695 out <<
"gl_texture2DProj(";
1709 out <<
"gl_texture2DProjLod0(";
1712 else if (name ==
"textureCube")
1726 out <<
"gl_textureCube(";
1740 out <<
"gl_textureCubeLod0(";
1743 else if (name ==
"texture2DLod")
1751 out <<
"gl_texture2DLod(";
1753 else if (name ==
"texture2DProjLod")
1761 out <<
"gl_texture2DProjLod(";
1763 else if (name ==
"textureCubeLod")
1771 out <<
"gl_textureCubeLod(";
1778 for (TIntermSequence::iterator arg = arguments.begin(); arg != arguments.end(); arg++)
1783 (*arg)->traverse(
this);
1784 out <<
", sampler_";
1787 (*arg)->traverse(
this);
1789 if (arg < arguments.end() - 1)
1874 switch (node->
getSequence()[0]->getAsTyped()->getNominalSize() * 10
1875 + node->
getSequence()[1]->getAsTyped()->getNominalSize())
1893 switch (node->
getSequence()[0]->getAsTyped()->getNominalSize())
1914 switch (node->
getSequence()[0]->getAsTyped()->getNominalSize())
2081 out <<
" = true; break;}\n";
2138 for (TIntermSequence::iterator sit = aggregate->
getSequence().begin(); sit != aggregate->
getSequence().end(); sit++)
2157 const int MAX_LOOP_ITERATIONS = 254;
2187 if (symbol && constant)
2213 comparator = test->
getOp();
2246 else if (unaryTerminal)
2261 if (index !=
NULL && comparator !=
EOpNull && increment != 0)
2271 int iterations = (limit - initial) / increment;
2273 if (iterations <= MAX_LOOP_ITERATIONS)
2286 out <<
" = false;\n";
2288 bool firstLoopFragment =
true;
2290 while (iterations > 0)
2292 int clampedLimit = initial + increment *
std::min(MAX_LOOP_ITERATIONS, iterations);
2294 if (!firstLoopFragment)
2301 if (iterations <= MAX_LOOP_ITERATIONS)
2316 out << clampedLimit;
2335 if (!firstLoopFragment)
2340 firstLoopFragment =
false;
2342 initial += MAX_LOOP_ITERATIONS * increment;
2343 iterations -= MAX_LOOP_ITERATIONS;
2381 mBody <<
"#line " << line;
2420 case EvqIn:
return "in";
2421 case EvqOut:
return "out";
2446 for (
unsigned int i = 0;
i < fields.size();
i++)
2448 const TField *field = fields[
i];
2462 case 2:
return "float2x2";
2463 case 3:
return "float3x3";
2464 case 4:
return "float4x4";
2474 case 1:
return "float";
2475 case 2:
return "float2";
2476 case 3:
return "float3";
2477 case 4:
return "float4";
2482 case 1:
return "int";
2483 case 2:
return "int2";
2484 case 3:
return "int3";
2485 case 4:
return "int4";
2490 case 1:
return "bool";
2491 case 2:
return "bool2";
2492 case 3:
return "bool3";
2493 case 4:
return "bool4";
2500 return "samplerCUBE";
2509 return "<unknown type>";
2519 return "TextureCube";
2527 return "<unknown texture type>";
2545 for (
size_t component = 0; component <
size; component++)
2549 if (component + 1 < size)
2555 return "{" +
string +
"}";
2577 typedef std::vector<TType> ParameterArray;
2578 ParameterArray ctorParameters;
2585 structure +=
"struct " +
decorate(name) +
"\n"
2590 for (
unsigned int i = 0;
i < fields.size();
i++)
2592 const TField *field = fields[
i];
2597 structure +=
"};\n";
2604 for (
unsigned int i = 0;
i < fields.size();
i++)
2606 ctorParameters.push_back(*fields[
i]->
type());
2609 else if (parameters)
2611 for (TIntermSequence::const_iterator parameter = parameters->begin(); parameter != parameters->end(); parameter++)
2613 ctorParameters.push_back((*parameter)->getAsTyped()->getType());
2622 constructor += ctorName +
" " + ctorName +
"_ctor(";
2626 constructor +=
typeString(ctorType) +
" " + ctorName +
"(";
2629 for (
unsigned int parameter = 0; parameter < ctorParameters.size(); parameter++)
2631 const TType &type = ctorParameters[parameter];
2635 if (parameter < ctorParameters.size() - 1)
2637 constructor +=
", ";
2641 constructor +=
")\n"
2646 constructor +=
" " + ctorName +
" structure = {";
2650 constructor +=
" return " +
typeString(ctorType) +
"(";
2653 if (ctorType.
isMatrix() && ctorParameters.size() == 1)
2656 const TType ¶meter = ctorParameters[0];
2662 for (
int col = 0; col < dim; col++)
2664 constructor +=
TString((
row == col) ?
"x0" :
"0.0");
2666 if (
row < dim - 1 || col < dim - 1)
2668 constructor +=
", ";
2677 for (
int col = 0; col < dim; col++)
2681 constructor +=
TString(
"x0") +
"[" +
str(
row) +
"]" +
"[" +
str(col) +
"]";
2685 constructor +=
TString((
row == col) ?
"1.0" :
"0.0");
2688 if (
row < dim - 1 || col < dim - 1)
2690 constructor +=
", ";
2700 size_t parameterIndex = 0;
2702 while (remainingComponents > 0)
2704 const TType ¶meter = ctorParameters[parameterIndex];
2706 bool moreParameters = parameterIndex + 1 < ctorParameters.size();
2708 constructor +=
"x" +
str(parameterIndex);
2712 ASSERT(parameterSize <= remainingComponents);
2713 remainingComponents -= parameterSize;
2717 if (remainingComponents == parameterSize || moreParameters)
2719 ASSERT(parameterSize <= remainingComponents);
2720 remainingComponents -= parameterSize;
2722 else if (remainingComponents < static_cast<size_t>(parameter.
getNominalSize()))
2724 switch (remainingComponents)
2726 case 1: constructor +=
".x";
break;
2727 case 2: constructor +=
".xy";
break;
2728 case 3: constructor +=
".xyz";
break;
2729 case 4: constructor +=
".xyzw";
break;
2733 remainingComponents = 0;
2739 ASSERT(remainingComponents == parameterSize || moreParameters);
2740 ASSERT(parameterSize <= remainingComponents);
2742 remainingComponents -= parameterSize;
2751 if (remainingComponents)
2753 constructor +=
", ";
2760 constructor +=
"};\n"
2761 " return structure;\n"
2766 constructor +=
");\n"
2783 for (
size_t i = 0;
i < fields.size();
i++)
2785 const TType *fieldType = fields[
i]->type();
2789 if (
i != fields.size() - 1)
2800 bool writeType = size > 1;
2807 for (
size_t i = 0;
i <
size;
i++, constUnion++)
2809 switch (constUnion->
getType())
2838 string +=
"_" +
str(
i);
2862 if (*structName == scopedName)
2876 if (
string.compare(0, 3,
"gl_") != 0 &&
string.compare(0, 3,
"dx_") != 0)
2896 if (structure.
getStruct()->
name().compare(0, 3,
"gl_") != 0)
2956 int elementIndex =
index;
2960 for (
size_t j = 0;
j < fields.size();
j++)
2962 const TType &fieldType = *fields[
j]->type();
2971 int fieldIndex =
index;
2973 for (
size_t i = 0;
i < fields.size();
i++)
2975 const TType &fieldType = *fields[
i]->type();
bool isUserDefined() const
EGLSurface EGLint attribute
void setPrecision(TPrecision p)
static TString initializer(const TType &type)
bool mUsesTextureCubeLod0
TIntermSequence & getSequence()
TIntermNode * getTrueBlock() const
TIntermTyped * getCondition()
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum type
const ShShaderOutput mOutputType
ActiveUniforms mActiveUniforms
void visitConstantUnion(TIntermConstantUnion *)
TIntermTyped * getLeft() const
bool mUsesTexture2DProj_bias
std::vector< Uniform > ActiveUniforms
virtual TIntermAggregate * getAsAggregate()
virtual TIntermSymbol * getAsSymbolNode()
void outputTriplet(Visit visit, const TString &preString, const TString &inString, const TString &postString)
bool IsSampler(TBasicType type)
const TString & name() const
TIntermNode * getFalseBlock() const
TString textureString(const TType &type)
TIntermTyped * getRight() const
int totalRegisterCount() const
static void init(struct bs2b *bs2b)
TBasicType getBasicType() const
bool visitLoop(Visit visit, TIntermLoop *)
virtual TIntermConstantUnion * getAsConstantUnion()
TBasicType getBasicType() const
int getNominalSize() const
TString registerString(TIntermSymbol *operand)
EGLImageKHR EGLint * name
OutputHLSL(TParseContext &context, const ShBuiltInResources &resources, ShShaderOutput outputType)
const TString & name() const
virtual TIntermBinary * getAsBinaryNode()
bool mContainsLoopDiscontinuity
int uniformRegister(TIntermSymbol *uniform)
TQualifier getQualifier() const
void outputLineDirective(int line)
static TString decorateField(const TString &string, const TType &structure)
void setQualifier(TQualifier q)
bool handleExcessiveLoop(TIntermLoop *node)
bool mInsideDiscontinuousLoop
StructDeclarations mStructDeclarations
int vectorSize(const TType &type) const
static GLenum glVariablePrecision(const TType &type)
static GLenum glVariableType(const TType &type)
virtual TIntermConstantUnion * getAsConstantUnion()
EGLContext EGLenum EGLClientBuffer buffer
TPrecision getPrecision() const
bool mUsesTexture2DProjLod
static TString arrayString(const TType &type)
const ConstantUnion * writeConstantUnion(const TType &type, const ConstantUnion *constUnion)
GLenum GLenum GLvoid * row
const ActiveUniforms & getUniforms()
#define ASSERT(expression)
bool mUsesTextureCubeLod0_bias
bool visitUnary(Visit visit, TIntermUnary *)
void visitSymbol(TIntermSymbol *)
TInfoSinkBase & getBodyStream()
GLuint GLsizei GLsizei GLchar * uniformName
bool visitBranch(Visit visit, TIntermBranch *)
int totalRegisterCount() const
virtual void traverse(TIntermTraverser *)=0
TIntermNode * getCondition() const
const TSourceLoc & getLine() const
const TType & getType() const
virtual TIntermUnary * getAsUnaryNode()
ConstantUnion * getUnionArrayPointer() const
void traverse(TIntermNode *node)
TBasicType getType() const
TIntermTyped * getExpression()
const TString & getName() const
GLsizei const GLchar *const * varyings
GLint GLenum GLsizei GLsizei GLsizei depth
TIntermTyped * getOperand()
UnfoldShortCircuit * mUnfoldShortCircuit
TString scopeString(unsigned int depthLimit)
virtual void traverse(TIntermTraverser *)
int getNextTemporaryIndex()
int getIConst(int index) const
std::basic_string< char, std::char_traits< char >, TStringAllocator > TString
TString scopedStruct(const TString &typeName)
bool usesTernaryOperator() const
static TString qualifierString(TQualifier qualifier)
EGLSurface EGLint void ** value
static TString unmangleName(const TString &mangledName)
ReferencedSymbols mReferencedAttributes
int samplerRegister(TIntermSymbol *sampler)
void declareUniform(const TType &type, const TString &name, int index)
bool mUsesTexture2DProjLod0
bool visitAggregate(Visit visit, TIntermAggregate *)
ReferencedSymbols mReferencedUniforms
bool visitSelection(Visit visit, TIntermSelection *)
TIntermTyped * getExpression()
ScopeBracket mScopeBracket
GLsizei const GLcharARB ** string
TString structLookup(const TString &typeName)
const TExtensionBehavior & extensionBehavior() const
void traverseStatements(TIntermNode *node)
ReferencedSymbols mReferencedVaryings
void addConstructor(const TType &type, const TString &name, const TIntermSequence *parameters)
virtual void traverse(TIntermTraverser *)
bool containsLoopDiscontinuity(TIntermNode *node)
size_t getObjectSize() const
const TFieldList & fields() const
TStructure * getStruct() const
const TString & getSymbol() const
bool mUsesTexture2DProjLod0_bias
bool isSingleStatement(TIntermNode *node)
Constructors mConstructors
const char * c_str() const
bool mUsesTexture2DLod0_bias
bool mUsesTextureCube_bias
int getNominalSize() const
virtual TIntermSymbol * getAsSymbolNode()
static TString decorate(const TString &string)
TString argumentString(const TIntermSymbol *symbol)
TIntermSymbol * mExcessiveLoopIndex
TString typeString(const TType &type)
static TString decorateUniform(const TString &string, const TType &type)
bool visitBinary(Visit visit, TIntermBinary *)
TLoopType getType() const