Skip to content

Commit

Permalink
Update source code for RMV v1.6.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosier committed May 22, 2023
1 parent 2a91cef commit 801942f
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 15 deletions.
17 changes: 11 additions & 6 deletions Release_Notes.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Radeon™ Memory Visualizer V1.6 04-26-2023
-----------------------------------------
Radeon™ Memory Visualizer V1.6.1 05-24-2023
-------------------------------------------

V1.6 Changes
V1.6.1 Changes
------------------------------------
1) Additional parameters added to the resource history table in the resource details pane.
2) Improved Device configuration reporting with newer trace files, including CPU and driver information.
3) Bug/stability fixes.
1) Add support for an upcoming driver release.
2) Bug/stability fixes.

Known Issues
------------------------------------
Expand All @@ -25,6 +24,12 @@ Known Issues
Release Notes History
------------------------------------

V1.6 Changes
------------------------------------
1) Additional parameters added to the resource history table in the resource details pane.
2) Improved Device configuration reporting with newer trace files, including CPU and driver information.
3) Bug/stability fixes.

V1.5 Changes
------------------------------------
1) Keyboard shortcuts added for all panes on the Welcome and Settings lists. Some keys have also been remapped to avoid conflict with the Adrenaline software. See the documentation or keyboard shortcuts pane for details.
Expand Down
4 changes: 2 additions & 2 deletions documentation/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
# built documents.
#
# The short X.Y version.
version = u'1.6.0'
version = u'1.6.1'
# The full version, including alpha/beta/rc tags.
release = u'1.6.0'
release = u'1.6.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
5 changes: 4 additions & 1 deletion source/backend/rmt_rdf_file_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ static RmtErrorCode LoadSnapshotChunks(rdfChunkFile* chunk_file, RmtDataSet* dat
// Load each of the Snapshot Info chunks using the indices found in the Snapshot Index chunk and copy to the data set.
for (uint16_t snapshot_info_chunk_index : *indices)
{
StoreSnapshotToDataSet(*chunk_file, snapshot_info_chunk, snapshot_info_chunk_index, *data_set);
if (snapshot_info_chunk_index != kEmptySnapshotIndexChunk)
{
StoreSnapshotToDataSet(*chunk_file, snapshot_info_chunk, snapshot_info_chunk_index, *data_set);
}
}
}
}
Expand Down
19 changes: 14 additions & 5 deletions source/backend/rmt_rdf_snapshot_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,24 @@ RmtErrorCode RmtRdfSnapshotWriter::Remove(const uint16_t removed_snapshot_index)
{
std::vector<int16_t> indices;
std::string chunk_indices_string;
indices.reserve(data_set_->snapshot_count);
for (int16_t snapshot_index = 0; snapshot_index < data_set_->snapshot_count; snapshot_index++)

// NOTE: The snapshot count isn't decremented until after the remove operation completes so the count will be one here if the last snapshot is being deleted.
if (data_set_->snapshot_count > 1)
{
// Skip snapshots with an empty name.
if (data_set_->snapshots[snapshot_index].name[0] != '\0')
indices.reserve(data_set_->snapshot_count);
for (int16_t snapshot_index = 0; snapshot_index < data_set_->snapshot_count; snapshot_index++)
{
indices.push_back(data_set_->snapshots[snapshot_index].chunk_index);
// Skip snapshots with an empty name.
if (data_set_->snapshots[snapshot_index].name[0] != '\0')
{
indices.push_back(data_set_->snapshots[snapshot_index].chunk_index);
}
}
}
else
{
indices.push_back(kEmptySnapshotIndexChunk);
}

// Populate the header for the snapshot index chunk.
RmtRdfSnapshotIndex::TraceSnapShotIndexHeader header;
Expand Down
5 changes: 5 additions & 0 deletions source/backend/rmt_rdf_snapshot_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@

#include "rdf/rdf/inc/amdrdf.h"

#include <stdint.h>

constexpr const char* kSnapshotIndexChunkId = "RmvSnapshotIndex";

// A dummy index that indicates there are no snapshots in the file.
static const uint16_t kEmptySnapshotIndexChunk = UINT16_MAX;

// A class that handles writing snapshot data to RDF trace files.
class RmtRdfSnapshotWriter : public RmtSnapshotWriter
{
Expand Down
2 changes: 1 addition & 1 deletion source/parser/rmt_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static const int kRmtRdfResultSuccess = 1;
typedef enum RmtTokenType
{
kRmtTokenTypeTimestamp = 0, ///< The token is a timestamp token.
kRmtTokenTypeReserved0 = 1, ///< The token is reserved
kRmtTokenTypeResourceUpdate = 1, ///< The token is a resource update token.
kRmtTokenTypeReserved1 = 2, ///< The token is reserved
kRmtTokenTypePageTableUpdate = 3, ///< The token is a page table update token.
kRmtTokenTypeUserdata = 4, ///< The token is a user data token.
Expand Down
40 changes: 40 additions & 0 deletions source/parser/rmt_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#define RMT_TOKEN_SIZE_VIRTUAL_ALLOCATE (96 / 8) ///< Virtual Allocate Token Size, in bytes
#define RMT_TOKEN_SIZE_RESOURCE_CREATE (56 / 8) ///< Resource Create Token Size, in bytes
#define RMT_TOKEN_SIZE_RESOURCE_DESTROY (40 / 8) ///< Resource Destroy Token Size, in bytes
#define RMT_TOKEN_SIZE_RESOURCE_UPDATE (112 / 8) ///< Resource Update Token Size, in bytes

#define IMAGE_RESOURCE_TOKEN_SIZE (304 / 8) ///< Image Resource Token Size
#define IMAGE_RESOURCE_TOKEN_SIZE_V1_6 (312 / 8) ///< Image Resource Token Size for V1.6 onwards
Expand Down Expand Up @@ -441,6 +442,10 @@ static int32_t GetTokenSize(RmtParser* rmt_parser, const uint16_t token_header)
}
case kRmtTokenTypeResourceDestroy:
return RMT_TOKEN_SIZE_RESOURCE_DESTROY;

case kRmtTokenTypeResourceUpdate:
return RMT_TOKEN_SIZE_RESOURCE_UPDATE;

default:
RMT_ASSERT(false);

Expand Down Expand Up @@ -1387,6 +1392,38 @@ static RmtErrorCode ParseResourceDestroy(RmtParser* rmt_parser, const uint16_t t
return kRmtOk;
}

// parse resource update
static RmtErrorCode ParseResourceUpdate(RmtParser* rmt_parser,
const uint16_t token_header,
RmtTokenResourceUpdate* out_resource_update)
{
RMT_UNUSED(token_header);

PopulateCommonFields(rmt_parser, &out_resource_update->common);

uint8_t data[RMT_TOKEN_SIZE_RESOURCE_UPDATE];
RmtErrorCode error_code = ReadBytes(rmt_parser, data, 0, sizeof(data));

RMT_RETURN_ON_ERROR(error_code == kRmtOk, error_code);

out_resource_update->resource_identifier = ReadBitsFromBuffer(data, sizeof(data), 39, 8);
out_resource_update->subresource_id = (uint32_t)ReadBitsFromBuffer(data, sizeof(data), 71, 40);
out_resource_update->resource_type = (RmtResourceType)ReadBitsFromBuffer(data, sizeof(data), 77, 72);
// Resource types can be anything, but for now, the driver is only going to log buffers:
RMT_ASSERT(out_resource_update->resource_type == kRmtResourceTypeBuffer);
// Buffers should always be cleared with 0xFFFFFFFF. Maybe there is a valid case where this could be something else...
RMT_ASSERT(out_resource_update->subresource_id == 0xffffffff);

// The DX12 resource transition API provides the state before and after the transition. The driver converts
// them to the relevant RMT usage flags and stores them in the 'before' and 'after' fields.
// Since we are only concerned with buffers right now, these flags will be of type
// RMT_BUFFER_USAGE_FLAGS (aka RmtBufferUsageFlagBits):
out_resource_update->before = ReadBitsFromBuffer(data, sizeof(data), 92, 78);
out_resource_update->after = ReadBitsFromBuffer(data, sizeof(data), 107, 93);

return kRmtOk;
}

RmtErrorCode RmtParserInitialize(RmtParser* rmt_parser,
FILE* file_handle,
int32_t file_offset,
Expand Down Expand Up @@ -1541,6 +1578,9 @@ RmtErrorCode RmtParserAdvance(RmtParser* rmt_parser, RmtToken* out_token, RmtPar
case kRmtTokenTypeResourceDestroy:
error_code = ParseResourceDestroy(rmt_parser, token_header, &out_token->resource_destroy_token);
break;
case kRmtTokenTypeResourceUpdate:
error_code = ParseResourceUpdate(rmt_parser, token_header, &out_token->resource_update_token);
break;
default:
RMT_ASSERT(0);
error_code = kRmtErrorMalformedData; // corrupted file.
Expand Down
4 changes: 4 additions & 0 deletions source/parser/rmt_token.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ void RmtTokenCopy(RmtToken* dest, const RmtToken* src)
memcpy(&dest->virtual_free_token, &src->virtual_free_token, sizeof(RmtTokenVirtualFree));
break;

case RmtTokenType::kRmtTokenTypeResourceUpdate:
memcpy(&dest->resource_update_token, &src->resource_update_token, sizeof(RmtTokenResourceUpdate));
break;

default:
break;
}
Expand Down
12 changes: 12 additions & 0 deletions source/parser/rmt_token.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,17 @@ typedef struct RmtTokenResourceDestroy
RmtResourceIdentifier resource_identifier; ///< A unique identifier for the resource being unbound.
} RmtTokenResourceDestroy;

/// A structure for a resource update
typedef struct RmtTokenResourceUpdate
{
RmtTokenCommon common; ///< Fields common to all tokens.
RmtResourceIdentifier resource_identifier; ///< Resource ID
uint32_t subresource_id; ///< Subresource ID
RmtResourceType resource_type; ///< Type of resource being updated
uint64_t before; ///< Usage flags before
uint64_t after; ///< Usage flags after
} RmtTokenResourceUpdate;

/// A structure encapsulating the token.
typedef struct RmtToken
{
Expand All @@ -204,6 +215,7 @@ typedef struct RmtToken
RmtTokenResourceCreate resource_create_token; ///< Valid when <c><i>type</i></c> is <c><i>kRmtTokenTypeResourceCreate</i></c>.
RmtTokenTimeDelta time_delta_token; ///< Valid when <c><i>type</i></c> is <c><i>kRmtTokenTypeTimeDelta</i></c>.
RmtTokenResourceDestroy resource_destroy_token; ///< Valid when <c><i>type</i></c> is <c><i>kRmtTokenTypeResourceDestroy</i></c>.
RmtTokenResourceUpdate resource_update_token; ///< Valid when <c><i>type</i></c> is <c><i>kRmtTokenTypeResourceUpdate</i></c>.
};

} RmtToken;
Expand Down

0 comments on commit 801942f

Please sign in to comment.