Mesa (gallium-gpu4-texture-opcodes): Revert "softpipe: Implement resource fetches for fragment shaders."
MichaŠKról
michal at kemper.freedesktop.org
Thu Jan 28 13:12:26 UTC 2010
Module: Mesa
Branch: gallium-gpu4-texture-opcodes
Commit: 2a9dfb19332572f8e63b9833e1923345cb390aec
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2a9dfb19332572f8e63b9833e1923345cb390aec
Author: Michal Krol <michal at vmware.com>
Date: Tue Jan 26 11:55:29 2010 +0100
Revert "softpipe: Implement resource fetches for fragment shaders."
This reverts commit 848226ee1d2a8a3aaf147cfe309641acef838968.
---
src/gallium/drivers/softpipe/sp_context.c | 4 --
src/gallium/drivers/softpipe/sp_context.h | 1 -
src/gallium/drivers/softpipe/sp_quad_fs.c | 2 +-
src/gallium/drivers/softpipe/sp_state_sampler.c | 16 +------
src/gallium/drivers/softpipe/sp_tex_sample.c | 54 -----------------------
src/gallium/drivers/softpipe/sp_tex_sample.h | 21 ---------
6 files changed, 3 insertions(+), 95 deletions(-)
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c
index 86ca086..f3ac676 100644
--- a/src/gallium/drivers/softpipe/sp_context.c
+++ b/src/gallium/drivers/softpipe/sp_context.c
@@ -112,10 +112,6 @@ softpipe_destroy( struct pipe_context *pipe )
pipe_texture_reference(&softpipe->vertex_textures[i], NULL);
}
- for (i = 0; i < PIPE_MAX_SHADER_RESOURCES; i++) {
- FREE(softpipe->tgsi.frag_res_list[i]);
- }
-
for (i = 0; i < Elements(softpipe->constants); i++) {
if (softpipe->constants[i].buffer) {
pipe_buffer_reference(&softpipe->constants[i].buffer, NULL);
diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h
index 4c4c1e7..73fa744 100644
--- a/src/gallium/drivers/softpipe/sp_context.h
+++ b/src/gallium/drivers/softpipe/sp_context.h
@@ -132,7 +132,6 @@ struct softpipe_context {
struct {
struct sp_sampler_varient *vert_samplers_list[PIPE_MAX_VERTEX_SAMPLERS];
struct sp_sampler_varient *frag_samplers_list[PIPE_MAX_SAMPLERS];
- struct sp_resource *frag_res_list[PIPE_MAX_SHADER_RESOURCES];
} tgsi;
/** The primitive drawing context */
diff --git a/src/gallium/drivers/softpipe/sp_quad_fs.c b/src/gallium/drivers/softpipe/sp_quad_fs.c
index df1fc14..7a32b5f 100644
--- a/src/gallium/drivers/softpipe/sp_quad_fs.c
+++ b/src/gallium/drivers/softpipe/sp_quad_fs.c
@@ -145,7 +145,7 @@ shade_begin(struct quad_stage *qs)
softpipe->fs->prepare(softpipe->fs,
qss->machine,
(struct tgsi_sampler **)softpipe->tgsi.frag_samplers_list,
- (struct tgsi_resource **)softpipe->tgsi.frag_res_list);
+ NULL);
qs->next->begin(qs->next);
}
diff --git a/src/gallium/drivers/softpipe/sp_state_sampler.c b/src/gallium/drivers/softpipe/sp_state_sampler.c
index e70f8c0..ceb4e33 100644
--- a/src/gallium/drivers/softpipe/sp_state_sampler.c
+++ b/src/gallium/drivers/softpipe/sp_state_sampler.c
@@ -232,6 +232,8 @@ get_sampler_varient( unsigned unit,
}
+
+
void
softpipe_reset_sampler_varients(struct softpipe_context *softpipe)
{
@@ -268,20 +270,6 @@ softpipe_reset_sampler_varients(struct softpipe_context *softpipe)
softpipe->texture[i] );
}
}
-
- for (i = 0; i <= softpipe->fs->info.file_max[TGSI_FILE_RESOURCE]; i++) {
- /* XXX: Separate samplers from textures.
- */
- if (softpipe->sampler[i]) {
- if (!softpipe->tgsi.frag_res_list[i]) {
- softpipe->tgsi.frag_res_list[i] = sp_create_resource();
- }
-
- sp_resource_bind_texture(softpipe->tgsi.frag_res_list[i],
- softpipe->tex_cache[i],
- softpipe->texture[i]);
- }
- }
}
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c
index f2a74ec..1ae8fec 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -1956,57 +1956,3 @@ sp_create_sampler_varient( const struct pipe_sampler_state *sampler,
return samp;
}
-
-static void
-sp_fetch3D(struct tgsi_resource *resource,
- const int i[QUAD_SIZE],
- const int j[QUAD_SIZE],
- const int k[QUAD_SIZE],
- const int lod[QUAD_SIZE],
- float rgba[NUM_CHANNELS][QUAD_SIZE])
-{
- const struct sp_resource *res = sp_resource(resource);
- union tex_tile_address addr;
- uint q;
-
- addr.value = 0;
-
- for (q = 0; q < QUAD_SIZE; q++) {
- const struct softpipe_tex_cached_tile *tile;
- const float *texel;
-
- addr.bits.level = lod[q];
- addr.bits.x = i[q] / TILE_SIZE;
- addr.bits.y = j[q] / TILE_SIZE;
- addr.bits.z = k[q];
-
- tile = sp_get_cached_tile_tex(res->cache, addr);
- texel = &tile->data.color[j[q] % TILE_SIZE][i[q] % TILE_SIZE][0];
-
- rgba[0][q] = texel[0];
- rgba[1][q] = texel[1];
- rgba[2][q] = texel[2];
- rgba[3][q] = texel[3];
- }
-}
-
-struct sp_resource *
-sp_create_resource(void)
-{
- struct sp_resource *res = CALLOC_STRUCT(sp_resource);
-
- if (res) {
- res->base.fetch3D = sp_fetch3D;
- }
-
- return res;
-}
-
-void
-sp_resource_bind_texture(struct sp_resource *resource,
- struct softpipe_tex_tile_cache *cache,
- const struct pipe_texture *texture)
-{
- resource->texture = texture;
- resource->cache = cache;
-}
diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.h b/src/gallium/drivers/softpipe/sp_tex_sample.h
index c8aafdd..b6e66c9 100644
--- a/src/gallium/drivers/softpipe/sp_tex_sample.h
+++ b/src/gallium/drivers/softpipe/sp_tex_sample.h
@@ -150,25 +150,4 @@ sp_get_samples(struct tgsi_sampler *tgsi_sampler,
float rgba[NUM_CHANNELS][QUAD_SIZE]);
-struct sp_resource {
- struct tgsi_resource base; /**< base class */
-
- const struct pipe_texture *texture;
- struct softpipe_tex_tile_cache *cache;
-};
-
-static INLINE struct sp_resource *
-sp_resource(const struct tgsi_resource *resource)
-{
- return (struct sp_resource *)resource;
-}
-
-struct sp_resource *
-sp_create_resource(void);
-
-void
-sp_resource_bind_texture(struct sp_resource *resource,
- struct softpipe_tex_tile_cache *cache,
- const struct pipe_texture *texture);
-
#endif /* SP_TEX_SAMPLE_H */
More information about the mesa-commit
mailing list