mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 03:55:19 -04:00
Dreamcast: Optimise a tiny bit
This commit is contained in:
parent
0b82f4f3df
commit
c087dfac50
@ -59,7 +59,7 @@ ClassiCube runs on:
|
|||||||
* macOS - 10.5 or later (but can be compiled to work with 10.3/10.4 though)
|
* macOS - 10.5 or later (but can be compiled to work with 10.3/10.4 though)
|
||||||
* Linux - needs `libcurl` and `libopenal`
|
* Linux - needs `libcurl` and `libopenal`
|
||||||
* Android - 2.3 or later
|
* Android - 2.3 or later
|
||||||
* iOS - 10.3 or later
|
* iOS - 8.0 or later
|
||||||
* Most web browsers (even runs on IE11)
|
* Most web browsers (even runs on IE11)
|
||||||
|
|
||||||
And also runs on:
|
And also runs on:
|
||||||
|
17
third_party/gldc/src/draw.c
vendored
17
third_party/gldc/src/draw.c
vendored
@ -34,12 +34,6 @@ GL_FORCE_INLINE Vertex* _glSubmissionTargetStart(SubmissionTarget* target) {
|
|||||||
return aligned_vector_at(&target->output->vector, target->start_offset);
|
return aligned_vector_at(&target->output->vector, target->start_offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
float u, v;
|
|
||||||
} Float2;
|
|
||||||
|
|
||||||
static const Float2 F2ZERO = {0.0f, 0.0f};
|
|
||||||
|
|
||||||
static void generateQuads(SubmissionTarget* target, const GLsizei first, const GLuint count) {
|
static void generateQuads(SubmissionTarget* target, const GLsizei first, const GLuint count) {
|
||||||
/* Read from the client buffers and generate an array of ClipVertices */
|
/* Read from the client buffers and generate an array of ClipVertices */
|
||||||
TRACE();
|
TRACE();
|
||||||
@ -55,24 +49,25 @@ static void generateQuads(SubmissionTarget* target, const GLsizei first, const G
|
|||||||
|
|
||||||
Vertex* dst = start;
|
Vertex* dst = start;
|
||||||
const float w = 1.0f;
|
const float w = 1.0f;
|
||||||
|
PREFETCH(src);
|
||||||
|
|
||||||
// TODO: optimise
|
// TODO: optimise
|
||||||
ITERATE(numQuads) {
|
ITERATE(numQuads) {
|
||||||
// 4 vertices per quad
|
// 4 vertices per quad
|
||||||
Vertex* it = dst;
|
Vertex* it = dst;
|
||||||
PREFETCH(it); // TODO: more prefetching?
|
|
||||||
PREFETCH(src);
|
|
||||||
|
|
||||||
for(GLuint j = 0; j < 4; ++j) {
|
for(GLuint j = 0; j < 4; ++j) {
|
||||||
PREFETCH(src + stride);
|
PREFETCH(src + stride);
|
||||||
TransformVertex((const float*)src, &w, it->xyz, &it->w);
|
TransformVertex((const float*)src, &w, it->xyz, &it->w);
|
||||||
|
|
||||||
*((uint32_t*)it->bgra) = *((uint32_t*)(src + 12));
|
*((uint32_t*)&it->bgra) = *((uint32_t*)(src + 12));
|
||||||
|
|
||||||
if(has_uv) {
|
if(has_uv) {
|
||||||
MEMCPY4(it->uv, src + 16, sizeof(float) * 2);
|
*((uint32_t*)&it->uv[0]) = *((uint32_t*)(src + 16));
|
||||||
|
*((uint32_t*)&it->uv[1]) = *((uint32_t*)(src + 20));
|
||||||
} else {
|
} else {
|
||||||
*((Float2*)it->uv) = F2ZERO;
|
it->uv[0] = 0.0f;
|
||||||
|
it->uv[1] = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
src += stride;
|
src += stride;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user