# Shader Cache

file structure:

```
Data_entry[Footer.dataentry_count] shaders
Table_entry[Footer.tableentry_count] materials?
Footer
```

Number of items: Footer.dataentry\_count

```
Data_entry:
{
   u8 hash
   u1 compression (only present in version > 2)
   u4 size (only present in version > 2)
   u4 zsize : compressed size in version > 2, entrysize in version < 3
   byte[zsize] compressed_data: zlib compressed bytes
}
```

Number of items: Footer.tableentry\_count

```
Table_entry:
{
   u4 top
   u4 header1
   u8 header2
   u8 header3
   vlq_bit6_prefixed_string name
   u4 top2 : same as top1
   u8 lower1
   u8 lower2
   byte[36] unk2
   u4unkarray unk3
   u4stringarray strings1
   u4stringarray strings2
}
```

```
vlq_bit6_prefixed_string:
{
   vlq_bit6 len
   bytes[len] value
}
```

```
vlq_bit6:
{
   1 bit sign
   1 bit continuation
   6 bit value
  ... shift bits by 7 afterwards
}
```

```
u4unkarray:
{
   u4 count
   byte[32][count] list
}
```

```
u4stringarray:
{
   u4 count
   stringlistentry[count] list
}
```

```
stringlistentry:
{
   vlq_bit6_prefixed_string val
   u1 idx
}
```

## Footer

```
Footer:
{
   u4 dataentry_count
   u4 tableentry_count
   u8 unk2
   u8 table_offset
   u8 table_size
   u8 table_offset again?
   u4 magic : RDHS
   u4 version
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.redmodding.org/redengine3-research/formats/game-archives/shader-cache.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
