[Mesa-dev] [PATCH 5/7] i965: relax brw_texture_offset assert
Kenneth Graunke
kenneth at whitecape.org
Sat Oct 26 00:23:07 PDT 2013
On 10/08/2013 12:31 PM, Ian Romanick wrote:
> On 10/08/2013 02:34 AM, Chris Forbes wrote:
>> Some texturing ops are about to have nonconstant offset support; the
>> offset in the header in these cases should be zero.
>>
>> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
>> ---
>> src/mesa/drivers/dri/i965/brw_shader.cpp | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
>> index 6b37f58..df7fa55 100644
>> --- a/src/mesa/drivers/dri/i965/brw_shader.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
>> @@ -370,7 +370,7 @@ brw_math_function(enum opcode op)
>> uint32_t
>> brw_texture_offset(ir_constant *offset)
>> {
>> - assert(offset != NULL);
>
> I think we should leave this assertion, but amend it to be
>
> /* If the driver does not support GL_ARB_gpu_shader5, the offset
> * must be constant.
> */
> assert(offset != NULL || ctx->Extensions.ARB_gpu_shader5);
Once we actually enable ARB_gpu_shader5, this won't be useful on Gen7+.
I'm not sure if Chris is hoping to land his Sandybridge support for
ARB_texture_gather or not (it has mad workarounds, but he's already done
them...). If so, then your suggestion seems reasonable.
I guess I have a mild preference for following Ian's suggestion, in case
we ever do add Sandybridge support. But I'll leave the decision up to
you, Chris.
>> + if (!offset) return 0; /* nonconstant offset; caller will handle it. */
>>
>> signed char offsets[3];
>> for (unsigned i = 0; i < offset->type->vector_elements; i++)
>>
>
> _______________________________________________
> 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