diff options
author | Marek Olšák <marek.olsak@amd.com> | 2015-10-17 23:17:52 +0200 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2015-10-20 12:58:25 +0200 |
commit | 8910ebd8e8ed7e163ae69bb85cda55531675e95d (patch) | |
tree | 76bc0f22424b1a25f0940818725b006b92613746 | |
parent | 7c75f23cb92f7e4a55f2ae31df9274338ec60531 (diff) | |
download | external_mesa3d-8910ebd8e8ed7e163ae69bb85cda55531675e95d.zip external_mesa3d-8910ebd8e8ed7e163ae69bb85cda55531675e95d.tar.gz external_mesa3d-8910ebd8e8ed7e163ae69bb85cda55531675e95d.tar.bz2 |
tgsi/scan: use properties for clip/cull distance writemasks
No changes needed for drivers already relying on tgsi_shader_info.
Reviewed-by: Brian Paul <brianp@vmware.com>
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_scan.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c index b84a175..4645ef2 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c @@ -369,19 +369,7 @@ tgsi_scan_shader(const struct tgsi_token *tokens, procType == TGSI_PROCESSOR_GEOMETRY || procType == TGSI_PROCESSOR_TESS_CTRL || procType == TGSI_PROCESSOR_TESS_EVAL) { - if (semName == TGSI_SEMANTIC_CLIPDIST) { - info->num_written_clipdistance += - util_bitcount(fulldecl->Declaration.UsageMask); - info->clipdist_writemask |= - fulldecl->Declaration.UsageMask << (semIndex*4); - } - else if (semName == TGSI_SEMANTIC_CULLDIST) { - info->num_written_culldistance += - util_bitcount(fulldecl->Declaration.UsageMask); - info->culldist_writemask |= - fulldecl->Declaration.UsageMask << (semIndex*4); - } - else if (semName == TGSI_SEMANTIC_VIEWPORT_INDEX) { + if (semName == TGSI_SEMANTIC_VIEWPORT_INDEX) { info->writes_viewport_index = TRUE; } else if (semName == TGSI_SEMANTIC_LAYER) { @@ -432,9 +420,21 @@ tgsi_scan_shader(const struct tgsi_token *tokens, const struct tgsi_full_property *fullprop = &parse.FullToken.FullProperty; unsigned name = fullprop->Property.PropertyName; + unsigned value = fullprop->u[0].Data; assert(name < Elements(info->properties)); - info->properties[name] = fullprop->u[0].Data; + info->properties[name] = value; + + switch (name) { + case TGSI_PROPERTY_NUM_CLIPDIST_ENABLED: + info->num_written_clipdistance = value; + info->clipdist_writemask |= (1 << value) - 1; + break; + case TGSI_PROPERTY_NUM_CULLDIST_ENABLED: + info->num_written_culldistance = value; + info->culldist_writemask |= (1 << value) - 1; + break; + } } break; |