llvmpipe: Remove more loose ends of TGSI exec sampling.

This commit is contained in:
José Fonseca 2010-01-07 15:59:41 +00:00
parent 27fe7a7303
commit 12c6b871a3
6 changed files with 4 additions and 127 deletions

View File

@ -256,22 +256,6 @@ llvmpipe_create( struct pipe_screen *screen )
llvmpipe->vertex_tex_cache[i] = lp_create_tex_tile_cache(screen);
/* vertex shader samplers */
for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
llvmpipe->tgsi.vert_samplers[i].base.get_samples = lp_get_samples;
llvmpipe->tgsi.vert_samplers[i].processor = TGSI_PROCESSOR_VERTEX;
llvmpipe->tgsi.vert_samplers[i].cache = llvmpipe->vertex_tex_cache[i];
llvmpipe->tgsi.vert_samplers_list[i] = &llvmpipe->tgsi.vert_samplers[i];
}
/* fragment shader samplers */
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
llvmpipe->tgsi.frag_samplers[i].base.get_samples = lp_get_samples;
llvmpipe->tgsi.frag_samplers[i].processor = TGSI_PROCESSOR_FRAGMENT;
llvmpipe->tgsi.frag_samplers[i].cache = llvmpipe->tex_cache[i];
llvmpipe->tgsi.frag_samplers_list[i] = &llvmpipe->tgsi.frag_samplers[i];
}
/*
* Create drawing context and plug our rendering stage into it.
*/
@ -279,10 +263,7 @@ llvmpipe_create( struct pipe_screen *screen )
if (!llvmpipe->draw)
goto fail;
draw_texture_samplers(llvmpipe->draw,
PIPE_MAX_VERTEX_SAMPLERS,
(struct tgsi_sampler **)
llvmpipe->tgsi.vert_samplers_list);
/* FIXME: devise alternative to draw_texture_samplers */
if (debug_get_bool_option( "LP_NO_RAST", FALSE ))
llvmpipe->no_rast = TRUE;

View File

@ -115,14 +115,6 @@ struct llvmpipe_context {
unsigned line_stipple_counter;
/** TGSI exec things */
struct {
struct lp_shader_sampler vert_samplers[PIPE_MAX_SAMPLERS];
struct lp_shader_sampler *vert_samplers_list[PIPE_MAX_SAMPLERS];
struct lp_shader_sampler frag_samplers[PIPE_MAX_SAMPLERS];
struct lp_shader_sampler *frag_samplers_list[PIPE_MAX_SAMPLERS];
} tgsi;
/** The primitive drawing context */
struct draw_context *draw;

View File

@ -109,24 +109,6 @@ lp_jit_init_globals(struct llvmpipe_screen *screen)
screen->context_ptr_type = LLVMPointerType(context_type, 0);
}
/* fetch_texel
*/
{
LLVMTypeRef ret_type;
LLVMTypeRef arg_types[3];
LLVMValueRef fetch_texel;
ret_type = LLVMVoidType();
arg_types[0] = LLVMPointerType(LLVMInt8Type(), 0); /* samplers */
arg_types[1] = LLVMInt32Type(); /* unit */
arg_types[2] = LLVMPointerType(LLVMVectorType(LLVMFloatType(), 4), 0); /* store */
fetch_texel = lp_declare_intrinsic(screen->module, "fetch_texel",
ret_type, arg_types, Elements(arg_types));
LLVMAddGlobalMapping(screen->engine, fetch_texel, lp_fetch_texel_soa);
}
#ifdef DEBUG
LLVMDumpModule(screen->module);
#endif

View File

@ -118,12 +118,6 @@ typedef void
void *color,
void *depth);
void PIPE_CDECL
lp_fetch_texel_soa( struct tgsi_sampler **samplers,
uint32_t unit,
float *store );
void
lp_jit_screen_cleanup(struct llvmpipe_screen *screen);

View File

@ -192,36 +192,6 @@ compute_cliprect(struct llvmpipe_context *lp)
}
static void
update_tgsi_samplers( struct llvmpipe_context *llvmpipe )
{
unsigned i;
/* vertex shader samplers */
for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
llvmpipe->tgsi.vert_samplers[i].sampler = llvmpipe->vertex_samplers[i];
llvmpipe->tgsi.vert_samplers[i].texture = llvmpipe->vertex_textures[i];
llvmpipe->tgsi.vert_samplers[i].base.get_samples = lp_get_samples;
}
for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
lp_tex_tile_cache_validate_texture( llvmpipe->vertex_tex_cache[i] );
}
/* fragment shader samplers */
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
llvmpipe->tgsi.frag_samplers[i].sampler = llvmpipe->sampler[i];
llvmpipe->tgsi.frag_samplers[i].texture = llvmpipe->texture[i];
llvmpipe->tgsi.frag_samplers[i].base.get_samples = lp_get_samples;
}
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
lp_tex_tile_cache_validate_texture( llvmpipe->tex_cache[i] );
}
llvmpipe->jit_context.samplers = (struct tgsi_sampler **)llvmpipe->tgsi.frag_samplers_list;
}
/* Hopefully this will remain quite simple, otherwise need to pull in
* something like the state tracker mechanism.
*/
@ -237,8 +207,9 @@ void llvmpipe_update_derived( struct llvmpipe_context *llvmpipe )
}
if (llvmpipe->dirty & (LP_NEW_SAMPLER |
LP_NEW_TEXTURE))
update_tgsi_samplers( llvmpipe );
LP_NEW_TEXTURE)) {
/* TODO */
}
if (llvmpipe->dirty & (LP_NEW_RASTERIZER |
LP_NEW_FS |

View File

@ -31,53 +31,10 @@
#include <llvm-c/Core.h>
#include "tgsi/tgsi_exec.h"
struct llvmpipe_tex_tile_cache;
struct lp_sampler_static_state;
/**
* Subclass of tgsi_sampler
*/
struct lp_shader_sampler
{
struct tgsi_sampler base; /**< base class */
unsigned processor;
/* For lp_get_samples_2d_linear_POT:
*/
unsigned xpot;
unsigned ypot;
unsigned level;
const struct pipe_texture *texture;
const struct pipe_sampler_state *sampler;
struct llvmpipe_tex_tile_cache *cache;
};
static INLINE struct lp_shader_sampler *
lp_shader_sampler(const struct tgsi_sampler *sampler)
{
return (struct lp_shader_sampler *) sampler;
}
extern void
lp_get_samples(struct tgsi_sampler *tgsi_sampler,
const float s[QUAD_SIZE],
const float t[QUAD_SIZE],
const float p[QUAD_SIZE],
float lodbias,
float rgba[NUM_CHANNELS][QUAD_SIZE]);
/**
* Pure-LLVM texture sampling code generator.
*