How does ScummVM draw/render...

Ask for help with ScummVM problems

Moderator: ScummVM Team

Post Reply
User avatar
Raziel
ScummVM Porter
Posts: 1522
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet

How does ScummVM draw/render...

Post by Raziel »

...and could it be enhanced for the SDL2 port(s)?

Sorry if this is a stupid question or has already been covered in the wiki or similar.

I can already use render targets with SDL on my local build, but it doesn't show any difference in rendering speed/fps, because ScummVM would need to use specific operations for blitting.
Blitting operations can be faster.
But if an application doesn't draw using https://wiki.libsdl.org/SDL_RenderCopy (or Ex variant), then there is no impact.

A game that has a sprite sheet (SDL_Texture) should benefit.

An app that writes memory byte at time instead of blitting, probably won't.
Still, if that app draws a framebuffer texture of, say, 320*200, this texture could be scaled, rotated, blended or filtered almost for "free", using compositing or OpenGL.

So it really depends what the application is doing.
The above is an answer from one of the AmigaOS4 SDL2 porters.

I guess it would be a lot of work supporting those render targets?
I'm just asking because it would probably speed up rendering on SDL quite a lot, but that's just my guess.
User avatar
Raziel
ScummVM Porter
Posts: 1522
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet

Re: How does ScummVM draw/render...

Post by Raziel »

Anyone, please?

I'd also like to know what exactly is covered by the OpenGL renderer option.
Is it only the launcher or does OpenGL take over rendering the game screen as well?

I was trying to build with ogles2, but it throws errors on shader compilation when i start ScummVM (which is kind of normal, given my platforms unfinished gles2 implementation) and an assertion, probably because of said erroneous shader compilation.

Code: Select all

WARNING: GL ERROR: GL_INVALID_VALUE on glCompileShader(handle) (backends/graphics/opengl/shader.cpp:268)!
WARNING: Could not compile shader "varying vec2 texCoord;
varying vec4 blendColor;

uniform sampler2D texture;

void main(void) {
	gl_FragColor = blendColor * texture2D(texture, texCoord);
}
": "ERROR: 18:1: 'texture' : can't use function syntax on variable 
ERROR: 20:0: '' : compilation terminated 
ERROR: 2 compilation errors.  No code generated.

"!
WARNING: GL ERROR: GL_INVALID_VALUE on glCompileShader(handle) (backends/graphics/opengl/shader.cpp:268)!
WARNING: Could not compile shader "varying vec2 texCoord;
varying vec4 blendColor;

uniform sampler2D texture;
uniform sampler2D palette;

const float adjustFactor = 255.0 / 256.0 + 1.0 / (2.0 * 256.0);
void main(void) {
	vec4 index = texture2D(texture, texCoord);
	gl_FragColor = blendColor * texture2D(palette, vec2(index.a * adjustFactor, 0.0));
}
": "ERROR: 20:1: 'texture' : can't use function syntax on variable 
ERROR: 20:1: '=' :  cannot convert from ' const float' to ' temp 4-component vector of float'
ERROR: 23:0: '' : compilation terminated 
ERROR: 3 compilation errors.  No code generated.

"!
WARNING: GL ERROR: GL_INVALID_ENUM on glGetUniformLocation(_program, name) (backends/graphics/opengl/shader.cpp:225)!
WARNING: GL ERROR: GL_INVALID_ENUM on glGetUniformLocation(_program, name) (backends/graphics/opengl/shader.cpp:225)!
WARNING: GL ERROR: GL_INVALID_ENUM on glGetUniformLocation(_program, name) (backends/graphics/opengl/shader.cpp:225)!
WARNING: GL ERROR: GL_INVALID_VALUE on glGetAttribLocation(_program, name) (backends/graphics/opengl/shader.cpp:219)!
WARNING: GL ERROR: GL_INVALID_VALUE on glGetAttribLocation(_program, name) (backends/graphics/opengl/shader.cpp:219)!
WARNING: GL ERROR: GL_INVALID_VALUE on glGetAttribLocation(_program, name) (backends/graphics/opengl/shader.cpp:219)!
assertion "_vertexAttribLocation != -1" failed: file "backends/graphics/opengl/pipelines/shader.cpp", line 36
Post Reply