[Mesa-dev] [PATCH 3/6] st_glsl_to_tgsi: implement TXS/TXQ.

Brian Paul brianp at vmware.com
Thu Aug 25 06:50:08 PDT 2011


On 08/25/2011 04:47 AM, Dave Airlie wrote:
> From: Dave Airlie<airlied at redhat.com>
>
> GLSL uses TXS, call the gallium TXQ opcode.
>
> Signed-off-by: Dave Airlie<airlied at redhat.com>
> ---
>   src/mesa/state_tracker/st_glsl_to_tgsi.cpp |   29 ++++++++++++++++++---------
>   1 files changed, 19 insertions(+), 10 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index 6f0d9fa..dc3bb76 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -2426,16 +2426,18 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir)
>      glsl_to_tgsi_instruction *inst = NULL;
>      unsigned opcode = TGSI_OPCODE_NOP;
>
> -   ir->coordinate->accept(this);
> +   if (ir->coordinate) {
> +       ir->coordinate->accept(this);
>
> -   /* Put our coords in a temp.  We'll need to modify them for shadow,
> -    * projection, or LOD, so the only case we'd use it as is is if
> -    * we're doing plain old texturing.  The optimization passes on
> -    * glsl_to_tgsi_visitor should handle cleaning up our mess in that case.
> -    */
> -   coord = get_temp(glsl_type::vec4_type);
> -   coord_dst = st_dst_reg(coord);
> -   emit(ir, TGSI_OPCODE_MOV, coord_dst, this->result);
> +       /* Put our coords in a temp.  We'll need to modify them for shadow,
> +	* projection, or LOD, so the only case we'd use it as is is if
> +	* we're doing plain old texturing.  The optimization passes on
> +	* glsl_to_tgsi_visitor should handle cleaning up our mess in that case.
> +	*/
> +       coord = get_temp(glsl_type::vec4_type);
> +       coord_dst = st_dst_reg(coord);
> +       emit(ir, TGSI_OPCODE_MOV, coord_dst, this->result);
> +   }

It looks like you're using 4-space indentation here instead of 3.

-Brian


More information about the mesa-dev mailing list