Fix issues with GL_QUADS
This commit is contained in:
parent
026bdeff09
commit
e7574bca1d
14
GL/draw.c
14
GL/draw.c
|
@ -815,17 +815,15 @@ static void generateElementsFastPath(
|
|||
|
||||
#define POLYMODE QUADS
|
||||
#define PROCESS_VERTEX_FLAGS(it, i) { \
|
||||
if((i + 1) % 4 == 0) { \
|
||||
Vertex* prev = ((it) - 1); \
|
||||
Vertex t = (*prev); \
|
||||
*(prev) = *((it)); \
|
||||
*((it)) = t; \
|
||||
prev->flags = GPU_CMD_VERTEX; \
|
||||
it->flags = GPU_CMD_VERTEX_EOL; \
|
||||
} else { \
|
||||
it->flags = GPU_CMD_VERTEX; \
|
||||
if(((i + 1) % 4) == 0) { \
|
||||
Vertex t = *it; \
|
||||
*it = *(it - 1); \
|
||||
*(it - 1) = t; \
|
||||
it->flags = GPU_CMD_VERTEX_EOL; \
|
||||
} \
|
||||
}
|
||||
|
||||
#include "draw_fastpath.inc"
|
||||
#undef PROCESS_VERTEX_FLAGS
|
||||
#undef POLYMODE
|
||||
|
|
|
@ -29,18 +29,6 @@ MAKE_FUNC(POLYMODE)
|
|||
const int_fast32_t loop = ((min + BATCH_SIZE) > count) ? count - min : BATCH_SIZE;
|
||||
const int offset = (first + min);
|
||||
|
||||
stride = ATTRIB_POINTERS.vertex.stride;
|
||||
ptr = ATTRIB_POINTERS.vertex.ptr + (offset * stride);
|
||||
it = (Vertex*) start;
|
||||
|
||||
PREFETCH(ptr);
|
||||
for(int_fast32_t i = 0; i < loop; ++i, ++it) {
|
||||
PREFETCH(ptr + stride);
|
||||
TransformVertex((const float*) ptr, &w, it->xyz, &it->w);
|
||||
PROCESS_VERTEX_FLAGS(it, min + i);
|
||||
ptr += stride;
|
||||
}
|
||||
|
||||
stride = ATTRIB_POINTERS.uv.stride;
|
||||
ptr = (ENABLED_VERTEX_ATTRIBUTES & UV_ENABLED_FLAG) ? ATTRIB_POINTERS.uv.ptr + ((first + min) * stride) : NULL;
|
||||
it = (Vertex*) start;
|
||||
|
@ -80,6 +68,18 @@ MAKE_FUNC(POLYMODE)
|
|||
}
|
||||
}
|
||||
|
||||
stride = ATTRIB_POINTERS.vertex.stride;
|
||||
ptr = ATTRIB_POINTERS.vertex.ptr + (offset * stride);
|
||||
it = (Vertex*) start;
|
||||
|
||||
PREFETCH(ptr);
|
||||
for(int_fast32_t i = 0; i < loop; ++i, ++it) {
|
||||
PREFETCH(ptr + stride);
|
||||
TransformVertex((const float*) ptr, &w, it->xyz, &it->w);
|
||||
PROCESS_VERTEX_FLAGS(it, min + i);
|
||||
ptr += stride;
|
||||
}
|
||||
|
||||
start = aligned_vector_at(target->extras, min);
|
||||
|
||||
stride = ATTRIB_POINTERS.st.stride;
|
||||
|
|
Loading…
Reference in New Issue
Block a user