[Mesa-dev] [PATCH 1/2] gallium: add texture gather support to gallium

Roland Scheidegger sroland at vmware.com
Thu Feb 6 18:36:57 PST 2014


Am 07.02.2014 02:56, schrieb Ilia Mirkin:
> On Thu, Feb 6, 2014 at 8:52 PM, Dave Airlie <airlied at gmail.com> wrote:
>> From: Dave Airlie <airlied at redhat.com>
>>
>> This just adds the TG4 opcode, and a CAP for the
>> max texture gather components.
> 
> Is this different from GATHER4? If it is, should probably be
> documented in docs/source/tgsi.rst...
I'm pretty sure this is the OGL-equivalent of gather4 (as gather4 is
d3d10-style, that is separate sampler and resource reg).
You are quite right though this is definitely missing documentation
(looking at it I have no idea for instance how the component selection
is going to work).

> 
>>
>> Signed-off-by: Dave Airlie <airlied at redhat.com>
>> ---
>>  src/gallium/auxiliary/tgsi/tgsi_info.c     | 1 +
>>  src/gallium/include/pipe/p_defines.h       | 3 ++-
>>  src/gallium/include/pipe/p_shader_tokens.h | 4 +++-
>>  3 files changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.c b/src/gallium/auxiliary/tgsi/tgsi_info.c
>> index f993600..0fa1338 100644
>> --- a/src/gallium/auxiliary/tgsi/tgsi_info.c
>> +++ b/src/gallium/auxiliary/tgsi/tgsi_info.c
>> @@ -221,6 +221,7 @@ static const struct tgsi_opcode_info opcode_info[TGSI_OPCODE_LAST] =
>>     { 1, 3, 1, 0, 0, 0, OTHR, "TXL2", TGSI_OPCODE_TXL2 },
>>     { 1, 2, 0, 0, 0, 0, COMP, "IMUL_HI", TGSI_OPCODE_IMUL_HI },
>>     { 1, 2, 0, 0, 0, 0, COMP, "UMUL_HI", TGSI_OPCODE_UMUL_HI },
>> +   { 1, 2, 1, 0, 0, 0, OTHR, "TG4", TGSI_OPCODE_TG4 },
>>  };
>>
>>  const struct tgsi_opcode_info *
>> diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
>> index dbedd87..316aa8b 100644
>> --- a/src/gallium/include/pipe/p_defines.h
>> +++ b/src/gallium/include/pipe/p_defines.h
>> @@ -520,7 +520,8 @@ enum pipe_cap {
>>     PIPE_CAP_MAX_VIEWPORTS = 84,
>>     PIPE_CAP_ENDIANNESS = 85,
>>     PIPE_CAP_MIXED_FRAMEBUFFER_SIZES = 86,
>> -   PIPE_CAP_TGSI_VS_LAYER = 87
>> +   PIPE_CAP_TGSI_VS_LAYER = 87,
>> +   PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS = 88
>>  };
>>
>>  #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)
>> diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h
>> index 8750bd2..8fa6a0a 100644
>> --- a/src/gallium/include/pipe/p_shader_tokens.h
>> +++ b/src/gallium/include/pipe/p_shader_tokens.h
>> @@ -453,7 +453,9 @@ struct tgsi_property_data {
>>  #define TGSI_OPCODE_IMUL_HI             180
>>  #define TGSI_OPCODE_UMUL_HI             181
>>
>> -#define TGSI_OPCODE_LAST                182
>> +#define TGSI_OPCODE_TG4                 182
>> +
>> +#define TGSI_OPCODE_LAST                183
>>
>>  #define TGSI_SAT_NONE            0  /* do not saturate */
>>  #define TGSI_SAT_ZERO_ONE        1  /* clamp to [0,1] */
>> --
>> 1.8.3.1
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://urldefense.proofpoint.com/v1/url?u=http://lists.freedesktop.org/mailman/listinfo/mesa-dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=F4msKE2WxRzA%2BwN%2B25muztFm5TSPwE8HKJfWfR2NgfY%3D%0A&m=Y5GSMx5Dfya7evTxKvtT1FyqThgxuTDd4EpfBojeULw%3D%0A&s=484efa75618e456da6277866ffba19281f78b9a9f71cb4aafde69f1d2ab19701
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://urldefense.proofpoint.com/v1/url?u=http://lists.freedesktop.org/mailman/listinfo/mesa-dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=F4msKE2WxRzA%2BwN%2B25muztFm5TSPwE8HKJfWfR2NgfY%3D%0A&m=Y5GSMx5Dfya7evTxKvtT1FyqThgxuTDd4EpfBojeULw%3D%0A&s=484efa75618e456da6277866ffba19281f78b9a9f71cb4aafde69f1d2ab19701
> 


More information about the mesa-dev mailing list