tgsi: Check in scan for fs position and depth reads
This commit is contained in:
committed by
Brian Paul
parent
379353e16b
commit
c8c2fc9a7a
@@ -108,6 +108,17 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
|
||||
assert(ind < PIPE_MAX_SHADER_INPUTS);
|
||||
info->input_usage_mask[ind] |= usage_mask;
|
||||
}
|
||||
|
||||
if (procType == TGSI_PROCESSOR_FRAGMENT &&
|
||||
src->Register.File == TGSI_FILE_INPUT &&
|
||||
info->reads_position &&
|
||||
src->Register.Index == 0 &&
|
||||
(src->Register.SwizzleX == TGSI_SWIZZLE_Z ||
|
||||
src->Register.SwizzleY == TGSI_SWIZZLE_Z ||
|
||||
src->Register.SwizzleZ == TGSI_SWIZZLE_Z ||
|
||||
src->Register.SwizzleW == TGSI_SWIZZLE_Z)) {
|
||||
info->reads_z = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/* check for indirect register reads */
|
||||
@@ -150,6 +161,10 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
|
||||
info->input_centroid[reg] = (ubyte)fulldecl->Declaration.Centroid;
|
||||
info->input_cylindrical_wrap[reg] = (ubyte)fulldecl->Declaration.CylindricalWrap;
|
||||
info->num_inputs++;
|
||||
|
||||
if (procType == TGSI_PROCESSOR_FRAGMENT &&
|
||||
fulldecl->Semantic.Name == TGSI_SEMANTIC_POSITION)
|
||||
info->reads_position = TRUE;
|
||||
}
|
||||
else if (file == TGSI_FILE_SYSTEM_VALUE) {
|
||||
unsigned index = fulldecl->Range.First;
|
||||
|
||||
@@ -63,6 +63,8 @@ struct tgsi_shader_info
|
||||
|
||||
uint opcode_count[TGSI_OPCODE_LAST]; /**< opcode histogram */
|
||||
|
||||
boolean reads_position; /**< does fragment shader read position? */
|
||||
boolean reads_z; /**< does fragment shader read depth? */
|
||||
boolean writes_z; /**< does fragment shader write Z value? */
|
||||
boolean writes_stencil; /**< does fragment shader write stencil value? */
|
||||
boolean writes_edgeflag; /**< vertex shader outputs edgeflag */
|
||||
|
||||
Reference in New Issue
Block a user