TECHNICAL FIELD

The present disclosure relates to dictionary-based compression, and more particularly to scalable dictionary-based compression.

BACKGROUND

Conventionally, a zero-bandwidth clear (ZBC) command is used to associate a single value to multiple locations in memory without actually writing the value to each of the memory locations. The association is done by storing the single value (referred to as a uniform value) in a global uniform table at a particular index in the table, and associating the index with the multiple memory locations. Thereafter, when a value needs to be read from one of the multiple memory locations, the value is retrieved from the global uniform table using the index associated with the memory location. The memory locations are in off-chip memory, so actually reading or writing values to the memory locations consumes memory access bandwidth. In contrast, the global uniform table is typically stored on-chip. So on-chip processing units can quickly refer to the values of the memory locations using the global uniform table instead of having to access the off-chip memory.

Without the ZBC command, clearing a buffer, a depth buffer (e.g., z-buffer) or color buffer requires actually writing a value (e.g., a value representing a maximum depth value or a value representing a single color) to all the memory locations of the buffer being cleared. When the ZBC command is used, the value is first stored in an entry of the global uniform table and an index corresponding to the entry is stored for the buffer that is cleared. Multiple entries are available in the uniform value table, enabling different buffers to be cleared to different values. When a buffer is compressed using ZBC, the index is a compressed representation of all of the values within the buffer (hence, ZBC mechanism can be considered a dictionary-based compression).

The ZBC mechanism reduces the off-chip memory bandwidth consumed to clear (write) buffers and to read cleared buffers. However, the existing ZBC mechanism has at least two drawbacks. The performance of ZBC compression is limited by the capacity of the global uniform table. When all of the entries have been used to store values, it is difficult (e.g., time consuming) to reclaim or free any entries to store new values, even when a particular value in the table is no longer referenced. Thus, there is a need to extend the capabilities of such dictionary-based compression mechanisms that can be used not only for compressing graphics-related data stored in off-chip memory, but also for compressing any type of data that may at times have only values that are uniform (e.g., same).

SUMMARY

A method, computer readable medium, and system are disclosed for dynamic uniform value hardware compression. In one embodiment, a method for dynamically compressing values includes the steps of receiving a first value to be stored in a first granule among a plurality of granules, determining that if the first value is stored in the first granule, all of the values stored in the plurality of memory locations associated with the first granule will have a uniform value, determining that the first value is stored in a table at a first index in the table, and updating a first CSI, which corresponds with the first granule, to indicate that the first granule is compressed and to indicate that all of the values of the first granule has a uniform value as the value associated with the first index in the table. Each granule in the plurality of granules is associated with a plurality of memory locations of a memory for storing a plurality of values, and each of the plurality of granules is associated with a corresponding compression state information (CSI). The table holds a plurality of values, wherein each of the values in the table is associated with a unique index, where the first value was previously stored in the table due to receiving a command to write the first value in the table.

