summaryrefslogtreecommitdiff
path: root/src/gallium/include
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2011-08-26 10:59:18 +0100
committerDave Airlie <airlied@redhat.com>2011-09-02 10:47:45 +0100
commit2083a276eb270b748d1c2668eb9faa5aadc8e700 (patch)
treefa03d01ecdba21bab656cf5e9f274ee2b0db7f83 /src/gallium/include
parent49e24d3b8c0129e11fcc94b6e74dc2589d64c882 (diff)
tgsi: add support for texture offsets to the TGSI IR. (v2)
This adds tokens for texture offsets, to store 4 * swizzled vec 3 for use in TXF and other opcodes. It also contains TGSI exec changes for softpipe to use this code, along with GLSL->TGSI support for TXF. v2: add some more comments, add back padding I removed. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/gallium/include')
-rw-r--r--src/gallium/include/pipe/p_shader_tokens.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h
index d3a3632654c..72d3139562e 100644
--- a/src/gallium/include/pipe/p_shader_tokens.h
+++ b/src/gallium/include/pipe/p_shader_tokens.h
@@ -401,6 +401,8 @@ struct tgsi_instruction
* If tgsi_instruction::Label is TRUE, tgsi_instruction_label follows.
*
* If tgsi_instruction::Texture is TRUE, tgsi_instruction_texture follows.
+ * if texture instruction has a number of offsets,
+ * then tgsi_instruction::Texture::NumOffset of tgsi_texture_offset follow.
*
* Then, tgsi_instruction::NumDstRegs of tgsi_dst_register follow.
*
@@ -437,7 +439,23 @@ struct tgsi_instruction_label
struct tgsi_instruction_texture
{
unsigned Texture : 8; /* TGSI_TEXTURE_ */
- unsigned Padding : 24;
+ unsigned NumOffsets : 4;
+ unsigned Padding : 20;
+};
+
+/* for texture offsets in GLSL and DirectX.
+ * Generally these always come from TGSI_FILE_IMMEDIATE,
+ * however DX11 appears to have the capability to do
+ * non-constant texture offsets.
+ */
+struct tgsi_texture_offset
+{
+ int Index : 16;
+ unsigned File : 4; /**< one of TGSI_FILE_x */
+ unsigned SwizzleX : 2; /* TGSI_SWIZZLE_x */
+ unsigned SwizzleY : 2; /* TGSI_SWIZZLE_x */
+ unsigned SwizzleZ : 2; /* TGSI_SWIZZLE_x */
+ unsigned Padding : 6;
};
/*