[GPU] Rename a few misnamed vfetch fields

This commit is contained in:
DrChat 2017-12-18 17:24:52 -06:00
parent 29c5fb8022
commit 55d2c03943
3 changed files with 27 additions and 17 deletions

View File

@ -777,7 +777,7 @@ void ShaderTranslator::ParseVertexFetchInstruction(
i.attributes.exp_adjust = op.exp_adjust(); i.attributes.exp_adjust = op.exp_adjust();
i.attributes.is_index_rounded = op.is_index_rounded(); i.attributes.is_index_rounded = op.is_index_rounded();
i.attributes.is_signed = op.is_signed(); i.attributes.is_signed = op.is_signed();
i.attributes.is_integer = op.is_integer(); i.attributes.is_integer = op.is_normalized();
i.attributes.prefetch_count = op.prefetch_count(); i.attributes.prefetch_count = op.prefetch_count();
// Store for later use by mini fetches. // Store for later use by mini fetches.

View File

@ -545,8 +545,8 @@ struct VertexFetchInstruction {
int exp_adjust() const { int exp_adjust() const {
return ((static_cast<int>(data_.exp_adjust) << 26) >> 26); return ((static_cast<int>(data_.exp_adjust) << 26) >> 26);
} }
bool is_signed() const { return data_.is_signed == 1; } bool is_signed() const { return data_.fomat_comp_all == 1; }
bool is_integer() const { return data_.is_integer == 1; } bool is_normalized() const { return data_.num_format_all == 0; }
bool is_index_rounded() const { return data_.is_index_rounded == 1; } bool is_index_rounded() const { return data_.is_index_rounded == 1; }
// Dword stride, [0-255]. // Dword stride, [0-255].
uint32_t stride() const { return data_.stride; } uint32_t stride() const { return data_.stride; }
@ -575,8 +575,8 @@ struct VertexFetchInstruction {
}); });
XEPACKEDSTRUCTANONYMOUS({ XEPACKEDSTRUCTANONYMOUS({
uint32_t dst_swiz : 12; uint32_t dst_swiz : 12;
uint32_t is_signed : 1; uint32_t fomat_comp_all : 1;
uint32_t is_integer : 1; uint32_t num_format_all : 1;
uint32_t signed_rf_mode_all : 1; uint32_t signed_rf_mode_all : 1;
uint32_t is_index_rounded : 1; uint32_t is_index_rounded : 1;
uint32_t format : 6; uint32_t format : 6;

View File

@ -1018,22 +1018,32 @@ PipelineCache::UpdateStatus PipelineCache::UpdateVertexInputState(
vertex_attrib_descr.format = VK_FORMAT_R16G16B16A16_SFLOAT; vertex_attrib_descr.format = VK_FORMAT_R16G16B16A16_SFLOAT;
break; break;
case VertexFormat::k_32: case VertexFormat::k_32:
// FIXME: Is this a NORM format? if (is_integer) {
assert_true(is_integer); vertex_attrib_descr.format =
vertex_attrib_descr.format = is_signed ? VK_FORMAT_R32_SINT : VK_FORMAT_R32_UINT;
is_signed ? VK_FORMAT_R32_SINT : VK_FORMAT_R32_UINT; } else {
// No NORM format.
assert_always();
}
break; break;
case VertexFormat::k_32_32: case VertexFormat::k_32_32:
// FIXME: Is this a NORM format? if (is_integer) {
assert_true(is_integer); vertex_attrib_descr.format =
vertex_attrib_descr.format = is_signed ? VK_FORMAT_R32G32_SINT : VK_FORMAT_R32G32_UINT;
is_signed ? VK_FORMAT_R32G32_SINT : VK_FORMAT_R32G32_UINT; } else {
// No NORM format.
assert_always();
}
break; break;
case VertexFormat::k_32_32_32_32: case VertexFormat::k_32_32_32_32:
// FIXME: Is this a NORM format? if (is_integer) {
assert_true(is_integer); vertex_attrib_descr.format = is_signed
vertex_attrib_descr.format = is_signed ? VK_FORMAT_R32G32B32A32_SINT ? VK_FORMAT_R32G32B32A32_SINT
: VK_FORMAT_R32G32B32A32_UINT; : VK_FORMAT_R32G32B32A32_UINT;
} else {
// No NORM format.
assert_always();
}
break; break;
case VertexFormat::k_32_FLOAT: case VertexFormat::k_32_FLOAT:
// assert_true(is_signed); // assert_true(is_signed);