mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 13:30:11 +01:00
pan/va: Define the TEX_GRADIENT instruction
Define the TEX_GRADIENT instruction in valhall/ISA.xml, and add the necessary bits to the compiler to expose it. Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com> Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31742>
This commit is contained in:
parent
9ad80a86c9
commit
ec0646a0b3
4 changed files with 44 additions and 2 deletions
|
|
@ -114,6 +114,7 @@ bi_count_write_registers(const bi_instr *ins, unsigned d)
|
|||
|
||||
case BI_OPCODE_TEX_SINGLE:
|
||||
case BI_OPCODE_TEX_FETCH:
|
||||
case BI_OPCODE_TEX_GRADIENT:
|
||||
case BI_OPCODE_TEX_GATHER: {
|
||||
unsigned chans = util_bitcount(ins->write_mask);
|
||||
|
||||
|
|
|
|||
|
|
@ -508,6 +508,10 @@ typedef struct {
|
|||
bool texel_offset;
|
||||
bool array_enable;
|
||||
bool integer_coordinates;
|
||||
bool derivative_enable;
|
||||
bool force_delta_enable;
|
||||
bool lod_bias_disable;
|
||||
bool lod_clamp_disable;
|
||||
enum bi_fetch_component fetch_component;
|
||||
enum bi_va_lod_mode va_lod_mode;
|
||||
enum bi_dimension dimension;
|
||||
|
|
|
|||
|
|
@ -2518,6 +2518,30 @@
|
|||
<immediate name="sr_count" size="4" pseudo="true"/>
|
||||
</ins>
|
||||
|
||||
<ins name="TEX_GRADIENT" title="Texture gradient" opcode="0x12A" message="tex" unit="T">
|
||||
<desc>Texture sample with explicit gradient.</desc>
|
||||
<slot/>
|
||||
<skip/>
|
||||
<register_type/>
|
||||
<register_width/>
|
||||
<write_mask/>
|
||||
<dimension/>
|
||||
<wide_indices/>
|
||||
<force_delta_enable/>
|
||||
<lod_bias_disable/>
|
||||
<lod_clamp_disable/>
|
||||
<derivative_enable/>
|
||||
|
||||
<sr_count/>
|
||||
<sr_write_count/>
|
||||
|
||||
<sr write="true" flags="false"/>
|
||||
<sr read="true" flags="false"/>
|
||||
<src size="64">Image to read from</src>
|
||||
<src pseudo="true">Dummy for IR</src>
|
||||
<immediate name="sr_count" size="4" pseudo="true"/>
|
||||
</ins>
|
||||
|
||||
<ins name="TEX_DUAL" title="Dual texture" opcode="0x12F" unused="true" unit="T">
|
||||
<desc>Pair of texture instructions.</desc>
|
||||
<slot/>
|
||||
|
|
|
|||
|
|
@ -904,14 +904,16 @@ va_pack_instr(const bi_instr *I)
|
|||
break;
|
||||
}
|
||||
|
||||
case BI_OPCODE_TEX_GRADIENT:
|
||||
case BI_OPCODE_TEX_SINGLE:
|
||||
case BI_OPCODE_TEX_FETCH:
|
||||
case BI_OPCODE_TEX_GATHER: {
|
||||
/* Image to read from */
|
||||
hex |= ((uint64_t)va_pack_src(I, 1)) << 0;
|
||||
|
||||
if (I->op == BI_OPCODE_TEX_FETCH && I->shadow)
|
||||
invalid_instruction(I, "TEX_FETCH does not support .shadow");
|
||||
if ((I->op == BI_OPCODE_TEX_FETCH || I->op == BI_OPCODE_TEX_GRADIENT) &&
|
||||
I->shadow)
|
||||
invalid_instruction(I, "texture instruction does not support .shadow");
|
||||
|
||||
if (I->wide_indices)
|
||||
hex |= (1ull << 8);
|
||||
|
|
@ -926,6 +928,17 @@ va_pack_instr(const bi_instr *I)
|
|||
if (!bi_is_regfmt_16(I->register_format))
|
||||
hex |= (1ull << 46);
|
||||
|
||||
if (I->op == BI_OPCODE_TEX_GRADIENT) {
|
||||
if (I->force_delta_enable)
|
||||
hex |= (1ull << 12);
|
||||
if (I->lod_bias_disable)
|
||||
hex |= (1ull << 13);
|
||||
if (I->lod_clamp_disable)
|
||||
hex |= (1ull << 14);
|
||||
if (I->derivative_enable)
|
||||
hex |= (1ull << 15);
|
||||
}
|
||||
|
||||
if (I->op == BI_OPCODE_TEX_SINGLE)
|
||||
hex |= ((uint64_t)va_pack_lod_mode(I)) << 13;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue