This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 110 | |
vec4 R0,R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11; | |
#define R12 oPos /* R12 is a mirror of oPos */ | |
int A0; | |
attribute vec4 v0; | |
attribute vec4 v1; | |
attribute vec4 v2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void debugger_export_vertex_shader(const char* file, KelvinState* kelvin, bool standalone) { | |
int i; | |
GLint prog; | |
glGetIntegerv(GL_CURRENT_PROGRAM,&prog); | |
FILE* f = fopen(file,"wb"); | |
if (standalone) { | |
fprintf(f,"#version 110\n" | |
"\n" | |
// Writeable registers | |
"#define attribute\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* I can think of 3 ways to handle the launchable transform programs: | |
* - A CPU based interpreter and duplicate all behaviour from the vshader | |
* - Use the existing GPU code | |
* - Read back values using transform feedback (will require GL3, no mesa EXT) | |
* - Do one pass per constant and render the result into a float tex (GL2+EXT) | |
*/ | |
#define GLSL_LOG_LENGTH 8192 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* rm -f *.trace && reset && clear && clang cubemap-flip.c -lGL -lglut -lGLU -lGLEW && apitrace trace ./a.out */ | |
#if 0 | |
#define FLIP | |
#endif | |
/* This was written for XQEMU so we can see what to do about cubemaps in the | |
upside-down cache/FBO results. | |
FLIP and un-FLIP-ed should behave exactly the same. Also both should match | |
the reference (r key to switch). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Module by infogulch and someone who "just stole it", just stolen again | |
#include "Chan.h" | |
#include "Modules.h" | |
#include "User.h" | |
class CQuitDetach : public CModule { | |
public: | |
MODCONSTRUCTOR(CQuitDetach) {} | |
virtual ~CQuitDetach() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define LIT(dest, src) dest = _out(dest,_LIT(_in(src))) | |
vec4 _LIT(vec4 src) | |
{ | |
vec4 s = src; | |
float epsilon=1.0/256.0; | |
s.w = clamp(s.w,-(128.0-epsilon),128.0-epsilon); | |
s.x = max(s.x,0.0); | |
s.y = max(s.y,0.0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GLSL | |
uvec4 texUint8(vec4 tex) { | |
return uivec4(tex * 255.0); | |
} | |
uint texUint32(vec4 tex) { | |
uvec4 utex = texUint8(tex); | |
return utex.a << 24 | utex.r << 16 | utex.g << 8 | utex.b; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// reset && clear && clang test-depth-fp.c && ./a.out 123 | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
/* Found these by checking values represented by 0xFFFF and 0xFEFFFF */ | |
#define F16_MAX 511.9375f | |
#define F24_MAX 340279770772509196049560342183603601408.0f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ran with MESA_GLSL=dump, "Mesa 11.0.0-devel (git-1bba29e) is supported" | |
#version 130 | |
uniform vec4 ua; | |
uniform vec4 ub; | |
float add(float a, float b) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GLSL IR for linked vertex program 172: | |
( | |
(declare (location=0 shader_out ) vec4 gl_Position) | |
(declare (uniform ) vec4 ua) | |
(declare (uniform ) vec4 ub) | |
( function main | |
(signature void | |
(parameters | |
) | |
( |
OlderNewer