[Mesa-dev] [PATCH] nv50/ir: do not call textureMask() for non-texture ops

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue Dec 1 15:01:55 PST 2015



On 11/29/2015 04:11 PM, Ilia Mirkin wrote:
> Under what circumstances can you get into this code and not be a texture op?

This only happens with surface ops. In this example, it's related to 
sustp. I don't think we need to add that texture mask for surface ops
because we don't do that for nve4+.

Note that the commit message and the description need to be adjusted.

>
> On Sun, Nov 29, 2015 at 9:57 AM, Samuel Pitoiset
> <samuel.pitoiset at gmail.com> wrote:
>> This fixes a segmentation fault with the 'test_surface_st' test from
>> src/gallium/tests/trivial/compute.c on Fermi.
>>
>> While we are it, apply the same change for Tesla.
>>
>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
>> ---
>>   src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
>> index 7859c8e..7b183ea 100644
>> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
>> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
>> @@ -2046,7 +2046,8 @@ RegAlloc::InsertConstraintsPass::texConstraintNVC0(TexInstruction *tex)
>>   {
>>      int n, s;
>>
>> -   textureMask(tex);
>> +   if (isTextureOp(tex->op))
>> +      textureMask(tex);
>>
>>      if (tex->op == OP_TXQ) {
>>         s = tex->srcCount(0xff);
>> @@ -2077,7 +2078,8 @@ RegAlloc::InsertConstraintsPass::texConstraintNV50(TexInstruction *tex)
>>      if (pred)
>>         tex->setPredicate(tex->cc, NULL);
>>
>> -   textureMask(tex);
>> +   if (isTextureOp(tex->op))
>> +      textureMask(tex);
>>
>>      assert(tex->defExists(0) && tex->srcExists(0));
>>      // make src and def count match
>> --
>> 2.6.2
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list