mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 01:08:03 +02:00
tgsi: change tgsi_shader_info::properties to a one-dimensional array
Reviewed-by: Roland Scheidegger <sroland@vmware.com> v2: fix svga too
This commit is contained in:
parent
1f6c0b55df
commit
0c4bc1e292
13 changed files with 23 additions and 24 deletions
|
|
@ -766,11 +766,11 @@ draw_create_geometry_shader(struct draw_context *draw,
|
|||
}
|
||||
|
||||
gs->input_primitive =
|
||||
gs->info.properties[TGSI_PROPERTY_GS_INPUT_PRIM][0];
|
||||
gs->info.properties[TGSI_PROPERTY_GS_INPUT_PRIM];
|
||||
gs->output_primitive =
|
||||
gs->info.properties[TGSI_PROPERTY_GS_OUTPUT_PRIM][0];
|
||||
gs->info.properties[TGSI_PROPERTY_GS_OUTPUT_PRIM];
|
||||
gs->max_output_vertices =
|
||||
gs->info.properties[TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES][0];
|
||||
gs->info.properties[TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES];
|
||||
if (!gs->max_output_vertices)
|
||||
gs->max_output_vertices = 32;
|
||||
|
||||
|
|
|
|||
|
|
@ -3865,7 +3865,7 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm,
|
|||
bld.bld_base.op_actions[TGSI_OPCODE_ENDPRIM].emit = end_primitive;
|
||||
|
||||
max_output_vertices =
|
||||
info->properties[TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES][0];
|
||||
info->properties[TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES];
|
||||
if (!max_output_vertices)
|
||||
max_output_vertices = 32;
|
||||
|
||||
|
|
|
|||
|
|
@ -280,8 +280,7 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
|
|||
unsigned name = fullprop->Property.PropertyName;
|
||||
|
||||
assert(name < Elements(info->properties));
|
||||
memcpy(info->properties[name],
|
||||
fullprop->u, 8 * sizeof(unsigned));
|
||||
info->properties[name] = fullprop->u[0].Data;
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -298,7 +297,7 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
|
|||
*/
|
||||
if (procType == TGSI_PROCESSOR_GEOMETRY) {
|
||||
unsigned input_primitive =
|
||||
info->properties[TGSI_PROPERTY_GS_INPUT_PRIM][0];
|
||||
info->properties[TGSI_PROPERTY_GS_INPUT_PRIM];
|
||||
int num_verts = u_vertices_per_prim(input_primitive);
|
||||
int j;
|
||||
info->file_count[TGSI_FILE_INPUT] = num_verts;
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ struct tgsi_shader_info
|
|||
*/
|
||||
unsigned indirect_files;
|
||||
|
||||
unsigned properties[TGSI_PROPERTY_COUNT][8]; /* index with TGSI_PROPERTY_ */
|
||||
unsigned properties[TGSI_PROPERTY_COUNT]; /* index with TGSI_PROPERTY_ */
|
||||
};
|
||||
|
||||
extern void
|
||||
|
|
|
|||
|
|
@ -433,7 +433,7 @@ util_pstipple_create_fragment_shader(struct pipe_context *pipe,
|
|||
tgsi_scan_shader(fs->tokens, &transform.info);
|
||||
|
||||
transform.coordOrigin =
|
||||
transform.info.properties[TGSI_PROPERTY_FS_COORD_ORIGIN][0];
|
||||
transform.info.properties[TGSI_PROPERTY_FS_COORD_ORIGIN];
|
||||
|
||||
tgsi_transform_shader(fs->tokens,
|
||||
(struct tgsi_token *) new_fs->tokens,
|
||||
|
|
|
|||
|
|
@ -2213,7 +2213,7 @@ generate_fragment(struct llvmpipe_context *lp,
|
|||
|
||||
/* check if writes to cbuf[0] are to be copied to all cbufs */
|
||||
cbuf0_write_all =
|
||||
shader->info.base.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS][0];
|
||||
shader->info.base.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS];
|
||||
|
||||
/* TODO: actually pick these based on the fs and color buffer
|
||||
* characteristics. */
|
||||
|
|
@ -2324,7 +2324,7 @@ generate_fragment(struct llvmpipe_context *lp,
|
|||
num_loop, "mask_store");
|
||||
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];
|
||||
shader->info.base.properties[TGSI_PROPERTY_FS_COORD_PIXEL_CENTER];
|
||||
|
||||
/*
|
||||
* The shader input interpolation info is not explicitely baked in the
|
||||
|
|
|
|||
|
|
@ -1138,11 +1138,11 @@ _nvfx_fragprog_translate(uint16_t oclass, struct nv30_fragprog *fp)
|
|||
fpc->num_regs = 2;
|
||||
memset(fp->texcoord, 0xff, sizeof(fp->texcoord));
|
||||
|
||||
if (fp->info.properties[TGSI_PROPERTY_FS_COORD_ORIGIN][0])
|
||||
if (fp->info.properties[TGSI_PROPERTY_FS_COORD_ORIGIN])
|
||||
fp->coord_conventions |= NV30_3D_COORD_CONVENTIONS_ORIGIN_INVERTED;
|
||||
if (fp->info.properties[TGSI_PROPERTY_FS_COORD_PIXEL_CENTER][0])
|
||||
if (fp->info.properties[TGSI_PROPERTY_FS_COORD_PIXEL_CENTER])
|
||||
fp->coord_conventions |= NV30_3D_COORD_CONVENTIONS_CENTER_INTEGER;
|
||||
if (fp->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS][0])
|
||||
if (fp->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS])
|
||||
fp->rt_enable |= NV30_3D_RT_ENABLE_MRT;
|
||||
|
||||
if (!nvfx_fragprog_prepare(fpc))
|
||||
|
|
|
|||
|
|
@ -469,7 +469,7 @@ static void r300_translate_fragment_shader(
|
|||
find_output_registers(&compiler, shader);
|
||||
|
||||
shader->write_all =
|
||||
shader->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS][0];
|
||||
shader->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS];
|
||||
|
||||
if (compiler.Base.Debug & RC_DBG_LOG) {
|
||||
DBG(r300, DBG_FP, "r300: Initial fragment program\n");
|
||||
|
|
|
|||
|
|
@ -1487,7 +1487,7 @@ static void si_llvm_emit_fs_epilogue(struct lp_build_tgsi_context * bld_base)
|
|||
memcpy(last_args, args, sizeof(args));
|
||||
|
||||
/* Handle FS_COLOR0_WRITES_ALL_CBUFS. */
|
||||
if (shader->selector->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS][0] &&
|
||||
if (shader->selector->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS] &&
|
||||
shader->output[i].sid == 0 &&
|
||||
si_shader_ctx->shader->key.ps.nr_cbufs > 1) {
|
||||
for (int c = 1; c < si_shader_ctx->shader->key.ps.nr_cbufs; c++) {
|
||||
|
|
@ -2867,7 +2867,7 @@ int si_shader_create(struct si_screen *sscreen, struct si_shader *shader)
|
|||
si_shader_ctx.radeon_bld.load_input = declare_input_fs;
|
||||
bld_base->emit_epilogue = si_llvm_emit_fs_epilogue;
|
||||
|
||||
switch (sel->info.properties[TGSI_PROPERTY_FS_DEPTH_LAYOUT][0]) {
|
||||
switch (sel->info.properties[TGSI_PROPERTY_FS_DEPTH_LAYOUT]) {
|
||||
case TGSI_FS_DEPTH_LAYOUT_GREATER:
|
||||
shader->db_shader_control |=
|
||||
S_02880C_CONSERVATIVE_Z_EXPORT(V_02880C_EXPORT_GREATER_THAN_Z);
|
||||
|
|
|
|||
|
|
@ -2214,7 +2214,7 @@ static INLINE void si_shader_selector_key(struct pipe_context *ctx,
|
|||
key->vs.gs_used_inputs = sctx->gs_shader->gs_used_inputs;
|
||||
}
|
||||
} else if (sel->type == PIPE_SHADER_FRAGMENT) {
|
||||
if (sel->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS][0])
|
||||
if (sel->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS])
|
||||
key->ps.nr_cbufs = sctx->framebuffer.state.nr_cbufs;
|
||||
key->ps.export_16bpc = sctx->framebuffer.export_16bpc;
|
||||
|
||||
|
|
@ -2312,9 +2312,9 @@ static void *si_create_shader_state(struct pipe_context *ctx,
|
|||
switch (pipe_shader_type) {
|
||||
case PIPE_SHADER_GEOMETRY:
|
||||
sel->gs_output_prim =
|
||||
sel->info.properties[TGSI_PROPERTY_GS_OUTPUT_PRIM][0];
|
||||
sel->info.properties[TGSI_PROPERTY_GS_OUTPUT_PRIM];
|
||||
sel->gs_max_out_vertices =
|
||||
sel->info.properties[TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES][0];
|
||||
sel->info.properties[TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES];
|
||||
|
||||
for (i = 0; i < sel->info.num_inputs; i++) {
|
||||
unsigned name = sel->info.input_semantic_name[i];
|
||||
|
|
|
|||
|
|
@ -924,7 +924,7 @@ blend_fallback(struct quad_stage *qs,
|
|||
const struct pipe_blend_state *blend = softpipe->blend;
|
||||
unsigned cbuf;
|
||||
boolean write_all =
|
||||
softpipe->fs_variant->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS][0];
|
||||
softpipe->fs_variant->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS];
|
||||
|
||||
for (cbuf = 0; cbuf < softpipe->framebuffer.nr_cbufs; cbuf++) {
|
||||
if (softpipe->framebuffer.cbufs[cbuf]) {
|
||||
|
|
|
|||
|
|
@ -563,9 +563,9 @@ setup_fragcoord_coeff(struct setup_context *setup, uint slot)
|
|||
{
|
||||
const struct tgsi_shader_info *fsInfo = &setup->softpipe->fs_variant->info;
|
||||
boolean origin_lower_left =
|
||||
fsInfo->properties[TGSI_PROPERTY_FS_COORD_ORIGIN][0];
|
||||
fsInfo->properties[TGSI_PROPERTY_FS_COORD_ORIGIN];
|
||||
boolean pixel_center_integer =
|
||||
fsInfo->properties[TGSI_PROPERTY_FS_COORD_PIXEL_CENTER][0];
|
||||
fsInfo->properties[TGSI_PROPERTY_FS_COORD_PIXEL_CENTER];
|
||||
|
||||
/*X*/
|
||||
setup->coef[slot].a0[0] = pixel_center_integer ? 0.0f : 0.5f;
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ make_fs_key(const struct svga_context *svga,
|
|||
== PIPE_SPRITE_COORD_LOWER_LEFT);
|
||||
|
||||
/* SVGA_NEW_FRAME_BUFFER */
|
||||
if (fs->base.info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS][0]) {
|
||||
if (fs->base.info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS]) {
|
||||
/* Replicate color0 output to N colorbuffers */
|
||||
key->write_color0_to_n_cbufs = svga->curr.framebuffer.nr_cbufs;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue