summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300/r300_context.h
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-04-11 01:13:11 +0200
committerMarek Olšák <maraeo@gmail.com>2010-04-11 01:32:15 +0200
commit1c356ac95b6df0962dbd15311ff7e0ea172e1aea (patch)
treee4d1090f383e3b232555b86b3aeb7fda585bed08 /src/gallium/drivers/r300/r300_context.h
parent26a54ed6fddd42d8dba3d0c18d9d23ea63c62807 (diff)
r300g: cleanup handling of sampler views
The evolution of TX_FORMAT bits is as follows: * When a texture is created, set bits independent of pipe_format. * When a sampler view is created, add format-specific bits. * When sampler states and views are getting merged, add min/max LOD.
Diffstat (limited to 'src/gallium/drivers/r300/r300_context.h')
-rw-r--r--src/gallium/drivers/r300/r300_context.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index 8d770853a4..fc186df640 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -130,6 +130,15 @@ struct r300_texture_format_state {
uint32_t format0; /* R300_TX_FORMAT0: 0x4480 */
uint32_t format1; /* R300_TX_FORMAT1: 0x44c0 */
uint32_t format2; /* R300_TX_FORMAT2: 0x4500 */
+ uint32_t tile_config; /* R300_TX_OFFSET (subset thereof) */
+};
+
+struct r300_sampler_view {
+ struct pipe_sampler_view base;
+
+ /* Copy of r300_texture::texture_format_state with format-specific bits
+ * added. */
+ struct r300_texture_format_state format;
};
struct r300_texture_fb_state {
@@ -144,20 +153,20 @@ struct r300_texture_fb_state {
struct r300_textures_state {
/* Textures. */
- struct pipe_sampler_view *fragment_sampler_views[16];
- int texture_count;
+ struct r300_sampler_view *sampler_views[16];
+ int sampler_view_count;
/* Sampler states. */
struct r300_sampler_state *sampler_states[16];
- int sampler_count;
+ int sampler_state_count;
- /* These is the merge of the texture and sampler states. */
+ /* This is the merge of the texture and sampler states. */
unsigned count;
uint32_t tx_enable; /* R300_TX_ENABLE: 0x4101 */
struct r300_texture_sampler_state {
- uint32_t format[3]; /* R300_TX_FORMAT[0-2] */
- uint32_t filter[2]; /* R300_TX_FILTER[0-1] */
+ struct r300_texture_format_state format;
+ uint32_t filter0; /* R300_TX_FILTER0: 0x4400 */
+ uint32_t filter1; /* R300_TX_FILTER1: 0x4440 */
uint32_t border_color; /* R300_TX_BORDER_COLOR: 0x45c0 */
- uint32_t tile_config; /* R300_TX_OFFSET (subset thereof) */
} regs[16];
};
@@ -266,7 +275,9 @@ struct r300_texture {
struct r300_winsys_buffer *buffer;
/* Registers carrying texture format data. */
- struct r300_texture_format_state state;
+ /* Only format-independent bits should be filled in. */
+ struct r300_texture_format_state tx_format;
+ /* All bits should be filled in. */
struct r300_texture_fb_state fb_state;
/* Buffer tiling */