Okay, I haven't messed with anything since D16(where everything was too far to the left), but here's the tests against 40d.
SHADER: Instant crash. There's a crash report file here.
data/shader.vs preprocessed source:
#version 140 // -*- mode: C -*-
#define dimx 144
#define dimy 37
#define dispx 10
#define dispy 24
const vec4 colors[] = vec4[16](vec4(0,0,0,1.0), vec4(0,0,0.501961,1.0), vec4(0,0.501961,0,1.0), vec4(0,0.501961,0.501961,1.0), vec4(0.501961,0,0,1.0), vec4(0.501961,0,0.501961,1.0), vec4(0.501961,0.501961,0,1.0), vec4(0.752941,0.752941,0.752941,1.0), vec4(0.501961,0.501961,0.501961,1.0), vec4(0,0,1,1.0), vec4(0,1,0,1.0), vec4(0,1,1,1.0), vec4(1,0,0,1.0), vec4(1,0,1,1.0), vec4(1,1,0,1.0), vec4(1,1,1,1.0));
#line 1 0
// Defines emitted by gridrectst::init_gl at load:
// dimx, dimy: Grid size of the screen array
// dispx, dispy: Grid-cell (font) size
// vec4 colors[16]: Color palette; first non-bold, then bold
#ifdef GRAPHICS
// offset_texpos, offset_addcolor, offset_grayscale, offset_cf, offset_cbr:
// offsets of the corresponding graphicst arrays in data
#endif
uniform usamplerBuffer data;
uniform samplerBuffer coords;
uniform isamplerBuffer fontmap;
uniform uint frame; // Counts up from 0
in vec4 gl_Vertex;
in int gl_VertexID;
flat out vec4 frontColor;
flat out vec4 backColor;
smooth out vec2 texCoords;
void main() {
int tile = gl_VertexID / 6;
int offset_tile = tile * 4;
int ch = int(texelFetch(data, offset_tile).a);
int fg = int(texelFetch(data, offset_tile+1).a);
int bg = int(texelFetch(data, offset_tile+2).a);
int bold = clamp(int(texelFetch(data, offset_tile+3).a), 0, 1);
#ifdef GRAPHICS
uint texpos = texelFetch(data, offset_texpos + offset_tile).a;
texpos += texelFetch(data, offset_texpos + offset_tile + 1).a * 256u;
texpos += texelFetch(data, offset_texpos + offset_tile + 2).a * 65536u;
texpos += texelFetch(data, offset_texpos + offset_tile + 3).a * 16777216u;
uint addcolor = texelFetch(data, offset_addcolor + offset_tile).a;
uint grayscale = texelFetch(data, offset_grayscale + offset_tile).a;
uint cf = texelFetch(data, offset_cf + offset_tile).a;
uint cbr = texelFetch(data, offset_cbr + offset_tile).a;
vec4 tex_square;
if (texpos != 0u && ch != 0) {
tex_square = texelFetch(coords, int(texpos));
if (grayscale != 0u) {
frontColor = colors[int(cf + cbr * 8u)];
} else if (addcolor != 0u) {
frontColor = colors[fg + bold * 8];
} else {
frontColor = vec4(1);
}
} else {
tex_square = texelFetch(coords, texelFetch(fontmap, ch).a);
frontColor = colors[fg + bold * 8];
}
#else
vec4 tex_square = texelFetch(coords, texelFetch(fontmap, ch).a);
frontColor = colors[fg + bold * 8];
#endif
vec2 coords[6] = vec2[](tex_square.sq, tex_square.tq, tex_square.tp,
tex_square.sq, tex_square.tp, tex_square.sp);
texCoords = coords[gl_VertexID % 6];
gl_Position = gl_Vertex;
backColor = colors[bg];
}
data/shader.vs shader compilation log (238):
Vertex shader failed to compile with the following errors:
ERROR: 2:16: error(#168) Reserved built-in name gl_Vertex
ERROR: 2:17: error(#168) Reserved built-in name gl_VertexID
ERROR: error(#273) 2 compilation errors. No code generated
data/shader.vs preprocessed source:
#version 140 // -*- mode: C -*-
#define dimx 80
#define dimy 45
#define dispx 16
#define dispy 16
#define GRAPHICS
#define offset_texpos 14400
#define offset_addcolor 28800
#define offset_grayscale 32448
#define offset_cf 36096
#define offset_cbr 39744
const vec4 colors[] = vec4[16](vec4(0,0,0,1.0), vec4(0,0,0.501961,1.0), vec4(0,0.501961,0,1.0), vec4(0,0.501961,0.501961,1.0), vec4(0.501961,0,0,1.0), vec4(0.501961,0,0.501961,1.0), vec4(0.501961,0.501961,0,1.0), vec4(0.752941,0.752941,0.752941,1.0), vec4(0.501961,0.501961,0.501961,1.0), vec4(0,0,1,1.0), vec4(0,1,0,1.0), vec4(0,1,1,1.0), vec4(1,0,0,1.0), vec4(1,0,1,1.0), vec4(1,1,0,1.0), vec4(1,1,1,1.0));
#line 1 0
// Defines emitted by gridrectst::init_gl at load:
// dimx, dimy: Grid size of the screen array
// dispx, dispy: Grid-cell (font) size
// vec4 colors[16]: Color palette; first non-bold, then bold
#ifdef GRAPHICS
// offset_texpos, offset_addcolor, offset_grayscale, offset_cf, offset_cbr:
// offsets of the corresponding graphicst arrays in data
#endif
uniform usamplerBuffer data;
uniform samplerBuffer coords;
uniform isamplerBuffer fontmap;
uniform uint frame; // Counts up from 0
in vec4 gl_Vertex;
in int gl_VertexID;
flat out vec4 frontColor;
flat out vec4 backColor;
smooth out vec2 texCoords;
void main() {
int tile = gl_VertexID / 6;
int offset_tile = tile * 4;
int ch = int(texelFetch(data, offset_tile).a);
int fg = int(texelFetch(data, offset_tile+1).a);
int bg = int(texelFetch(data, offset_tile+2).a);
int bold = clamp(int(texelFetch(data, offset_tile+3).a), 0, 1);
#ifdef GRAPHICS
uint texpos = texelFetch(data, offset_texpos + offset_tile).a;
texpos += texelFetch(data, offset_texpos + offset_tile + 1).a * 256u;
texpos += texelFetch(data, offset_texpos + offset_tile + 2).a * 65536u;
texpos += texelFetch(data, offset_texpos + offset_tile + 3).a * 16777216u;
uint addcolor = texelFetch(data, offset_addcolor + offset_tile).a;
uint grayscale = texelFetch(data, offset_grayscale + offset_tile).a;
uint cf = texelFetch(data, offset_cf + offset_tile).a;
uint cbr = texelFetch(data, offset_cbr + offset_tile).a;
vec4 tex_square;
if (texpos != 0u && ch != 0) {
tex_square = texelFetch(coords, int(texpos));
if (grayscale != 0u) {
frontColor = colors[int(cf + cbr * 8u)];
} else if (addcolor != 0u) {
frontColor = colors[fg + bold * 8];
} else {
frontColor = vec4(1);
}
} else {
tex_square = texelFetch(coords, texelFetch(fontmap, ch).a);
frontColor = colors[fg + bold * 8];
}
#else
vec4 tex_square = texelFetch(coords, texelFetch(fontmap, ch).a);
frontColor = colors[fg + bold * 8];
#endif
vec2 coords[6] = vec2[](tex_square.sq, tex_square.tq, tex_square.tp,
tex_square.sq, tex_square.tp, tex_square.sp);
texCoords = coords[gl_VertexID % 6];
gl_Position = gl_Vertex;
backColor = colors[bg];
}
data/shader.vs shader compilation log (238):
Vertex shader failed to compile with the following errors:
ERROR: 2:16: error(#168) Reserved built-in name gl_Vertex
ERROR: 2:17: error(#168) Reserved built-in name gl_VertexID
ERROR: error(#273) 2 compilation errors. No code generated
PARTIAL: Runs much faster (99 FPS vs. 43 FPS in 40d), however everything is really tiny. The sprites are about half of normal size, and quite distorted. Even though BLACKSPACE is OFF, everything is displayed in a tiny square at the bottom of a large black field.
2DASYNC: Runs considerably faster 72 FPS vs. 43 in D40, however there are a number of weird artifacts.
Everything is too far to the left. As in, the three leftmost columns are missing from the screen. This doesn't make the game unplayable, but it's really annoying, as I can't read artifact descriptions properly.
Playing in windowed mode solves this, and I can just resize the window to fill the whole screen, which is almost as good.
When you open the menu, any creatures represented by graphics set sprites are not hidden. The fortress itself is blacked out, but my dwarves still show up, printed behind the menu. If you exit to the main menu, these dwarves persist, floating in the blackness of the title screen.