Dear list,

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.

for example, this is tiny fragment shader:
uniform sampler2D sampler2d;
varying mediump vec2  myTexCoord;
void main (void)
{
  gl_FragColor = texture2D(sampler2d,myTexCoord);
}

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.

(function main
  (signature void
    (parameters
    )
    (
      (declare (temporary ) vec4 texture2D_retval@0x94fc11c)
(assign (constant bool (1)) (xyzw) (var_ref texture2D_retval@0x94fc11c) (call texture2D ((var_ref sampler2d@0x955b114) (var_ref myTexCoord@0x955b03c) ))
)
(assign (constant bool (1)) (xyzw) (var_ref gl_FragColor@0x92c2eb4) (var_ref texture2D_retval@0x94fc11c) )
    ))

)

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?

thanks,
--lx

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to