tgsi: remove some not so useful variables from tgsi_shader_info
This commit is contained in:
parent
8860584045
commit
7dc0164192
|
@ -293,14 +293,6 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
|
||||||
info->uses_kill = (info->opcode_count[TGSI_OPCODE_KILL_IF] ||
|
info->uses_kill = (info->opcode_count[TGSI_OPCODE_KILL_IF] ||
|
||||||
info->opcode_count[TGSI_OPCODE_KILL]);
|
info->opcode_count[TGSI_OPCODE_KILL]);
|
||||||
|
|
||||||
/* extract simple properties */
|
|
||||||
info->origin_lower_left =
|
|
||||||
info->properties[TGSI_PROPERTY_FS_COORD_ORIGIN][0];
|
|
||||||
info->pixel_center_integer =
|
|
||||||
info->properties[TGSI_PROPERTY_FS_COORD_PIXEL_CENTER][0];
|
|
||||||
info->color0_writes_all_cbufs =
|
|
||||||
info->properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS][0];
|
|
||||||
|
|
||||||
/* The dimensions of the IN decleration in geometry shader have
|
/* The dimensions of the IN decleration in geometry shader have
|
||||||
* to be deduced from the type of the input primitive.
|
* to be deduced from the type of the input primitive.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -76,9 +76,6 @@ struct tgsi_shader_info
|
||||||
boolean uses_vertexid;
|
boolean uses_vertexid;
|
||||||
boolean uses_primid;
|
boolean uses_primid;
|
||||||
boolean uses_frontface;
|
boolean uses_frontface;
|
||||||
boolean origin_lower_left;
|
|
||||||
boolean pixel_center_integer;
|
|
||||||
boolean color0_writes_all_cbufs;
|
|
||||||
boolean writes_viewport_index;
|
boolean writes_viewport_index;
|
||||||
boolean writes_layer;
|
boolean writes_layer;
|
||||||
boolean is_msaa_sampler[PIPE_MAX_SAMPLERS];
|
boolean is_msaa_sampler[PIPE_MAX_SAMPLERS];
|
||||||
|
|
|
@ -2323,6 +2323,8 @@ generate_fragment(struct llvmpipe_context *lp,
|
||||||
LLVMValueRef mask_store = lp_build_array_alloca(gallivm, mask_type,
|
LLVMValueRef mask_store = lp_build_array_alloca(gallivm, mask_type,
|
||||||
num_loop, "mask_store");
|
num_loop, "mask_store");
|
||||||
LLVMValueRef color_store[PIPE_MAX_COLOR_BUFS][TGSI_NUM_CHANNELS];
|
LLVMValueRef color_store[PIPE_MAX_COLOR_BUFS][TGSI_NUM_CHANNELS];
|
||||||
|
boolean pixel_center_integer =
|
||||||
|
shader->info.base.properties[TGSI_PROPERTY_FS_COORD_PIXEL_CENTER][0];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The shader input interpolation info is not explicitely baked in the
|
* The shader input interpolation info is not explicitely baked in the
|
||||||
|
@ -2333,7 +2335,7 @@ generate_fragment(struct llvmpipe_context *lp,
|
||||||
gallivm,
|
gallivm,
|
||||||
shader->info.base.num_inputs,
|
shader->info.base.num_inputs,
|
||||||
inputs,
|
inputs,
|
||||||
shader->info.base.pixel_center_integer,
|
pixel_center_integer,
|
||||||
builder, fs_type,
|
builder, fs_type,
|
||||||
a0_ptr, dadx_ptr, dady_ptr,
|
a0_ptr, dadx_ptr, dady_ptr,
|
||||||
x, y);
|
x, y);
|
||||||
|
|
|
@ -923,9 +923,8 @@ blend_fallback(struct quad_stage *qs,
|
||||||
struct softpipe_context *softpipe = qs->softpipe;
|
struct softpipe_context *softpipe = qs->softpipe;
|
||||||
const struct pipe_blend_state *blend = softpipe->blend;
|
const struct pipe_blend_state *blend = softpipe->blend;
|
||||||
unsigned cbuf;
|
unsigned cbuf;
|
||||||
boolean write_all;
|
boolean write_all =
|
||||||
|
softpipe->fs_variant->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS][0];
|
||||||
write_all = softpipe->fs_variant->info.color0_writes_all_cbufs;
|
|
||||||
|
|
||||||
for (cbuf = 0; cbuf < softpipe->framebuffer.nr_cbufs; cbuf++) {
|
for (cbuf = 0; cbuf < softpipe->framebuffer.nr_cbufs; cbuf++) {
|
||||||
if (softpipe->framebuffer.cbufs[cbuf]) {
|
if (softpipe->framebuffer.cbufs[cbuf]) {
|
||||||
|
|
|
@ -562,17 +562,21 @@ static void
|
||||||
setup_fragcoord_coeff(struct setup_context *setup, uint slot)
|
setup_fragcoord_coeff(struct setup_context *setup, uint slot)
|
||||||
{
|
{
|
||||||
const struct tgsi_shader_info *fsInfo = &setup->softpipe->fs_variant->info;
|
const struct tgsi_shader_info *fsInfo = &setup->softpipe->fs_variant->info;
|
||||||
|
boolean origin_lower_left =
|
||||||
|
fsInfo->properties[TGSI_PROPERTY_FS_COORD_ORIGIN][0];
|
||||||
|
boolean pixel_center_integer =
|
||||||
|
fsInfo->properties[TGSI_PROPERTY_FS_COORD_PIXEL_CENTER][0];
|
||||||
|
|
||||||
/*X*/
|
/*X*/
|
||||||
setup->coef[slot].a0[0] = fsInfo->pixel_center_integer ? 0.0f : 0.5f;
|
setup->coef[slot].a0[0] = pixel_center_integer ? 0.0f : 0.5f;
|
||||||
setup->coef[slot].dadx[0] = 1.0f;
|
setup->coef[slot].dadx[0] = 1.0f;
|
||||||
setup->coef[slot].dady[0] = 0.0f;
|
setup->coef[slot].dady[0] = 0.0f;
|
||||||
/*Y*/
|
/*Y*/
|
||||||
setup->coef[slot].a0[1] =
|
setup->coef[slot].a0[1] =
|
||||||
(fsInfo->origin_lower_left ? setup->softpipe->framebuffer.height-1 : 0)
|
(origin_lower_left ? setup->softpipe->framebuffer.height-1 : 0)
|
||||||
+ (fsInfo->pixel_center_integer ? 0.0f : 0.5f);
|
+ (pixel_center_integer ? 0.0f : 0.5f);
|
||||||
setup->coef[slot].dadx[1] = 0.0f;
|
setup->coef[slot].dadx[1] = 0.0f;
|
||||||
setup->coef[slot].dady[1] = fsInfo->origin_lower_left ? -1.0f : 1.0f;
|
setup->coef[slot].dady[1] = origin_lower_left ? -1.0f : 1.0f;
|
||||||
/*Z*/
|
/*Z*/
|
||||||
setup->coef[slot].a0[2] = setup->posCoef.a0[2];
|
setup->coef[slot].a0[2] = setup->posCoef.a0[2];
|
||||||
setup->coef[slot].dadx[2] = setup->posCoef.dadx[2];
|
setup->coef[slot].dadx[2] = setup->posCoef.dadx[2];
|
||||||
|
|
|
@ -338,7 +338,7 @@ make_fs_key(const struct svga_context *svga,
|
||||||
== PIPE_SPRITE_COORD_LOWER_LEFT);
|
== PIPE_SPRITE_COORD_LOWER_LEFT);
|
||||||
|
|
||||||
/* SVGA_NEW_FRAME_BUFFER */
|
/* SVGA_NEW_FRAME_BUFFER */
|
||||||
if (fs->base.info.color0_writes_all_cbufs) {
|
if (fs->base.info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS][0]) {
|
||||||
/* Replicate color0 output to N colorbuffers */
|
/* Replicate color0 output to N colorbuffers */
|
||||||
key->write_color0_to_n_cbufs = svga->curr.framebuffer.nr_cbufs;
|
key->write_color0_to_n_cbufs = svga->curr.framebuffer.nr_cbufs;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue