diff options
author | Francisco Jerez <[email protected]> | 2012-05-01 02:38:51 +0200 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2012-05-11 12:39:39 +0200 |
commit | a5f44cc8c2ce0916809ce5da5a2490ad000ef099 (patch) | |
tree | 33ffba4161f7f3201a505ab5a23d6f70ea6cfc7f /src/gallium/include | |
parent | d9d82dcd006c124e6569789c90390c43c1360c06 (diff) |
gallium/tgsi: Split sampler views from shader resources.
This commit splits the current concept of resource into "sampler
views" and "shader resources":
"Sampler views" are textures or buffers that are bound to a given
shader stage and can be read from in conjunction with a sampler
object. They are analogous to OpenGL texture objects or Direct3D
SRVs.
"Shader resources" are textures or buffers that can be read and
written from a shader. There's no support for floating point
coordinates, address wrap modes or filtering, and, unlike sampler
views, shader resources are global for the whole graphics pipeline.
They are analogous to OpenGL image objects (as in
ARB_shader_image_load_store) or Direct3D UAVs.
Most hardware is likely to implement shader resources and sampler
views as separate objects, so, having the distinction at the API level
simplifies things slightly for the driver.
This patch introduces the SVIEW register file with a declaration token
and syntax analogous to the already existing RES register file. After
this change, the SAMPLE_* opcodes no longer accept a resource as
input, but rather a SVIEW object. To preserve the functionality of
reading from a sampler view with integer coordinates, the
SAMPLE_I(_MS) opcodes are introduced which are similar to LOAD(_MS)
but take a SVIEW register instead of a RES register as argument.
Diffstat (limited to 'src/gallium/include')
-rw-r--r-- | src/gallium/include/pipe/p_shader_tokens.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h index 9d08fde9f03..cc850db2c40 100644 --- a/src/gallium/include/pipe/p_shader_tokens.h +++ b/src/gallium/include/pipe/p_shader_tokens.h @@ -76,6 +76,7 @@ enum tgsi_file_type { TGSI_FILE_IMMEDIATE_ARRAY =10, TGSI_FILE_TEMPORARY_ARRAY =11, TGSI_FILE_RESOURCE =12, + TGSI_FILE_SAMPLER_VIEW =13, TGSI_FILE_COUNT /**< how many TGSI_FILE_ types */ }; @@ -160,6 +161,11 @@ struct tgsi_declaration_semantic struct tgsi_declaration_resource { unsigned Resource : 8; /**< one of TGSI_TEXTURE_ */ + unsigned Padding : 24; +}; + +struct tgsi_declaration_sampler_view { + unsigned Resource : 8; /**< one of TGSI_TEXTURE_ */ unsigned ReturnTypeX : 6; /**< one of enum pipe_type */ unsigned ReturnTypeY : 6; /**< one of enum pipe_type */ unsigned ReturnTypeZ : 6; /**< one of enum pipe_type */ @@ -372,16 +378,16 @@ struct tgsi_property_data { #define TGSI_OPCODE_ENDSWITCH 144 /* resource related opcodes */ -#define TGSI_OPCODE_LOAD 145 -#define TGSI_OPCODE_LOAD_MS 146 -#define TGSI_OPCODE_SAMPLE 147 +#define TGSI_OPCODE_SAMPLE 145 +#define TGSI_OPCODE_SAMPLE_I 146 +#define TGSI_OPCODE_SAMPLE_I_MS 147 #define TGSI_OPCODE_SAMPLE_B 148 #define TGSI_OPCODE_SAMPLE_C 149 #define TGSI_OPCODE_SAMPLE_C_LZ 150 #define TGSI_OPCODE_SAMPLE_D 151 #define TGSI_OPCODE_SAMPLE_L 152 #define TGSI_OPCODE_GATHER4 153 -#define TGSI_OPCODE_RESINFO 154 +#define TGSI_OPCODE_SVIEWINFO 154 #define TGSI_OPCODE_SAMPLE_POS 155 #define TGSI_OPCODE_SAMPLE_INFO 156 @@ -390,7 +396,9 @@ struct tgsi_property_data { #define TGSI_OPCODE_IABS 159 #define TGSI_OPCODE_ISSG 160 -#define TGSI_OPCODE_LAST 161 +#define TGSI_OPCODE_LOAD 161 + +#define TGSI_OPCODE_LAST 162 #define TGSI_SAT_NONE 0 /* do not saturate */ #define TGSI_SAT_ZERO_ONE 1 /* clamp to [0,1] */ |