Commit c57dfdf3 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Fix crash when wrapping es2gears

parent 78a9e5b9
......@@ -340,21 +340,25 @@ void panwrap_replay_attributes(const struct panwrap_mapped_memory *mem,
/* gl_VertexID and gl_InstanceID do not have elements to
* decode; we would crash if we tried */
if (!varying && i < MALI_SPECIAL_ATTRIBUTE_BASE) {
if (!varying && i < MALI_SPECIAL_ATTRIBUTE_BASE && 0) {
/* TODO: Attributes are not necessarily float32 vectors in general;
* decoding like this without snarfing types from the shader is unsafe all things considered */
panwrap_msg("i: %d\n", i);
panwrap_msg("attr: %llx\n", raw_elements);
float *buffer = panwrap_fetch_gpu_mem(mem, raw_elements, attr[i].size);
struct panwrap_mapped_memory *l_mem = panwrap_find_mapped_gpu_mem_containing(raw_elements);
float *buffer = panwrap_fetch_gpu_mem(l_mem, raw_elements, attr[i].size);
vertex_count = attr[i].size / attr[i].stride;
component_count = attr[i].stride / sizeof(float);
panwrap_log("float %s_%d[] = {\n", base, i);
#define MIN(a, b) ((a > b) ? b : a)
#if 0
panwrap_indent++;
for (int row = 0; row < vertex_count; row++) {
for (int row = 0; row < MIN(vertex_count, 16); row++) {
panwrap_log_empty();
for (int i = 0; i < component_count; i++)
......@@ -364,6 +368,7 @@ void panwrap_replay_attributes(const struct panwrap_mapped_memory *mem,
buffer += component_count;
}
#endif
panwrap_indent--;
panwrap_log("};\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment