Removed texture_size from the GPU renderer vertex shader
This isn't used anywhere, and this saves a UV multiply and divide
This commit is contained in:
1 parent
28ec461ebf
commit
853375da61
13 files changed
+830
-881
No files matched your search
@@ -33,7 +33,6 @@ typedef struct GPU_ShaderUniformData
|
||||
{
|
||||
Float4X4 mvp;
|
||||
SDL_FColor color;
|
||||
float texture_size[2];
|
||||
} GPU_ShaderUniformData;
|
||||
|
||||
typedef struct GPU_RenderData
|
||||
@@ -434,8 +433,8 @@ static bool GPU_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SD
|
||||
|
||||
if (texture) {
|
||||
float *uv_ = (float *)((char *)uv + j * uv_stride);
|
||||
*(verts++) = uv_[0] * texture->w;
|
||||
*(verts++) = uv_[1] * texture->h;
|
||||
*(verts++) = uv_[0];
|
||||
*(verts++) = uv_[1];
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -481,11 +480,6 @@ static void PushVertexUniforms(GPU_RenderData *data, SDL_RenderCommand *cmd)
|
||||
|
||||
uniforms.color = data->state.draw_color;
|
||||
|
||||
if (cmd->data.draw.texture) {
|
||||
uniforms.texture_size[0] = cmd->data.draw.texture->w;
|
||||
uniforms.texture_size[1] = cmd->data.draw.texture->h;
|
||||
}
|
||||
|
||||
SDL_PushGPUVertexUniformData(data->state.command_buffer, 0, &uniforms, sizeof(uniforms));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user