<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
Dear list, <br>
<br>
i wonder if all vendors in mesa3d use intel's glsl compiler now? by
browsing glsl source code, i still don't understand how it generates
ir_texture. in my idea, it treats it as normal function call.<br>
<br>
for example, this is tiny fragment shader:<br>
<tt>uniform sampler2D sampler2d;</tt><tt><br>
</tt><tt>varying mediump vec2 myTexCoord;</tt><tt><br>
</tt><tt>void main (void)</tt><tt><br>
</tt><tt>{</tt><tt><br>
</tt><tt> gl_FragColor = texture2D(sampler2d,myTexCoord);</tt><tt><br>
</tt><tt>}</tt><tt><br>
</tt><br>
glsl_compiler will emit LIR/HIR like this. please note (call
texture2D ...). it's a normal ir_call instead of ir_texture. i
confirm that ast2hir doesn't new ir_texture in any case.<br>
<br>
<tt>(function main</tt><tt><br>
</tt><tt> (signature void</tt><tt><br>
</tt><tt> (parameters</tt><tt><br>
</tt><tt> )</tt><tt><br>
</tt><tt> (</tt><tt><br>
</tt><tt> (declare (temporary ) vec4
texture2D_retval@0x94fc11c)</tt><tt><br>
</tt><tt> (assign (constant bool (1)) (xyzw) (var_ref
texture2D_retval@0x94fc11c) (call texture2D ((var_ref
sampler2d@0x955b114) (var_ref myTexCoord@0x955b03c) ))</tt><tt><br>
</tt><tt>) </tt><tt><br>
</tt><tt> (assign (constant bool (1)) (xyzw) (var_ref
gl_FragColor@0x92c2eb4) (var_ref texture2D_retval@0x94fc11c) ) </tt><tt><br>
</tt><tt> ))</tt><tt><br>
</tt><tt><br>
</tt><tt>)</tt><br>
<br>
do mesa glsl compiler can make use of ir_texture? i think it must be
yes because all GPUs have texture unit and should handle tex
commands. how does mesa do it?<br>
<br>
thanks,<br>
--lx<br>
<br>
<span style="color: rgb(0, 0, 0); font-family: 'Times New Roman';
font-size: medium; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px; display: inline !important; float:
none;"></span>
</body>
</html>