Re: [Mesa-dev] [PATCH] glsl_to_tgsi: make sure copied instructions don't lose texture target.

2011-12-12 Thread Brian Paul
On Sat, Dec 10, 2011 at 2:47 PM, Dave Airlie  wrote:
>>>
>>> The piglit draw-pixel-with-texture was asserting in the glsl->tgsi code,
>>> due to 0 texture target, this makes sure the texture target is copied over
>>> correctly when we copy instructions around.
>>
>> Oh so it looks like this could be "fun" or maybe the other one, so
>> glsl->tgsi is broken for draw pixels where a texturing is enabled.
>>
>> The problem is we ignore the fact that texturing is enabled and we
>> blindly write over the original programs texture info, we also seem to
>> bind our samplers on top of the original states which also seems
>> doomed to failure.
>>
>> I'm not 100% sure how best to solve this, I'll just tool around until
>> I have an answer unless someone comes up with a better one.
>
> Okay I suspect the st_cb_drawpixels.c needs to start looking a lot
> more like the st_cb_bitmap.c, if the draw-pixel-with-texture test is
> correct, which I've no reason to believe it isn't.

To be honest, I'm not too concerned about fixing the case of
glDrawPixels + texture. I can't think of any case where anyone would
want to do that.  As long as we don't crash and we render the original
glDrawPixels image, that's OK for now, IMO.

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


Re: [Mesa-dev] [PATCH] glsl_to_tgsi: make sure copied instructions don't lose texture target.

2011-12-12 Thread Brian Paul
On Sat, Dec 10, 2011 at 11:34 AM, Dave Airlie  wrote:
> From: Dave Airlie 
>
> The piglit draw-pixel-with-texture was asserting in the glsl->tgsi code,
> due to 0 texture target, this makes sure the texture target is copied over
> correctly when we copy instructions around.
>
> Signed-off-by: Dave Airlie 
> ---
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
> b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index 6cc655d..68eaddc 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -3786,6 +3786,7 @@ get_pixel_transfer_visitor(struct st_fragment_program 
> *fp,
>     * new visitor. */
>    foreach_iter(exec_list_iterator, iter, original->instructions) {
>       glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *)iter.get();
> +      glsl_to_tgsi_instruction *newinst;
>       st_src_reg src_regs[3];
>
>       if (inst->dst.file == PROGRAM_OUTPUT)
> @@ -3803,7 +3804,8 @@ get_pixel_transfer_visitor(struct st_fragment_program 
> *fp,
>             prog->InputsRead |= BITFIELD64_BIT(src_regs[i].index);
>       }
>
> -      v->emit(NULL, inst->op, inst->dst, src_regs[0], src_regs[1], 
> src_regs[2]);
> +      newinst = v->emit(NULL, inst->op, inst->dst, src_regs[0], src_regs[1], 
> src_regs[2]);
> +      newinst->tex_target = inst->tex_target;
>    }
>
>    /* Make modifications to fragment program info. */

Looks good to me.  I had started to look into the glDrawPixels
failures and found tex_target to be zero.  I didn't know where it was
supposed to come from though.

Reviewed-by: Brian Paul 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] glsl_to_tgsi: make sure copied instructions don't lose texture target.

2011-12-10 Thread Dave Airlie
>>
>> The piglit draw-pixel-with-texture was asserting in the glsl->tgsi code,
>> due to 0 texture target, this makes sure the texture target is copied over
>> correctly when we copy instructions around.
>
> Oh so it looks like this could be "fun" or maybe the other one, so
> glsl->tgsi is broken for draw pixels where a texturing is enabled.
>
> The problem is we ignore the fact that texturing is enabled and we
> blindly write over the original programs texture info, we also seem to
> bind our samplers on top of the original states which also seems
> doomed to failure.
>
> I'm not 100% sure how best to solve this, I'll just tool around until
> I have an answer unless someone comes up with a better one.

Okay I suspect the st_cb_drawpixels.c needs to start looking a lot
more like the st_cb_bitmap.c, if the draw-pixel-with-texture test is
correct, which I've no reason to believe it isn't.

Dave.


>
> Dave.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] glsl_to_tgsi: make sure copied instructions don't lose texture target.

2011-12-10 Thread Dave Airlie
On Sat, Dec 10, 2011 at 6:34 PM, Dave Airlie  wrote:
> From: Dave Airlie 
>
> The piglit draw-pixel-with-texture was asserting in the glsl->tgsi code,
> due to 0 texture target, this makes sure the texture target is copied over
> correctly when we copy instructions around.

Oh so it looks like this could be "fun" or maybe the other one, so
glsl->tgsi is broken for draw pixels where a texturing is enabled.

The problem is we ignore the fact that texturing is enabled and we
blindly write over the original programs texture info, we also seem to
bind our samplers on top of the original states which also seems
doomed to failure.

I'm not 100% sure how best to solve this, I'll just tool around until
I have an answer unless someone comes up with a better one.

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


[Mesa-dev] [PATCH] glsl_to_tgsi: make sure copied instructions don't lose texture target.

2011-12-10 Thread Dave Airlie
From: Dave Airlie 

The piglit draw-pixel-with-texture was asserting in the glsl->tgsi code,
due to 0 texture target, this makes sure the texture target is copied over
correctly when we copy instructions around.

Signed-off-by: Dave Airlie 
---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 6cc655d..68eaddc 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -3786,6 +3786,7 @@ get_pixel_transfer_visitor(struct st_fragment_program *fp,
 * new visitor. */
foreach_iter(exec_list_iterator, iter, original->instructions) {
   glsl_to_tgsi_instruction *inst = (glsl_to_tgsi_instruction *)iter.get();
+  glsl_to_tgsi_instruction *newinst;
   st_src_reg src_regs[3];
 
   if (inst->dst.file == PROGRAM_OUTPUT)
@@ -3803,7 +3804,8 @@ get_pixel_transfer_visitor(struct st_fragment_program *fp,
 prog->InputsRead |= BITFIELD64_BIT(src_regs[i].index);
   }
 
-  v->emit(NULL, inst->op, inst->dst, src_regs[0], src_regs[1], 
src_regs[2]);
+  newinst = v->emit(NULL, inst->op, inst->dst, src_regs[0], src_regs[1], 
src_regs[2]);
+  newinst->tex_target = inst->tex_target;
}
 
/* Make modifications to fragment program info. */
-- 
1.7.7.3

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