#include "radeon_common.h"
#include "main/mtypes.h"
+#include "shader/prog_instruction.h"
struct r300_context;
typedef struct r300_context r300ContextRec;
}
#include "r300_vertprog.h"
-#include "r500_fragprog.h"
-
/* The blit width for texture uploads
GLboolean error;
struct r300_fragment_program_external_state state;
- union {
+ union rX00_fragment_program_code {
struct r300_fragment_program_code r300;
struct r500_fragment_program_code r500;
} code;
GLuint optimization;
};
+struct r300_fragment_program_compiler {
+ r300ContextPtr r300;
+ struct r300_fragment_program *fp;
+ union rX00_fragment_program_code *code;
+ struct gl_program *program;
+};
+
#define R300_MAX_AOS_ARRAYS 16
compiler.r300 = r300;
compiler.fp = r300_fp;
- compiler.code = &r300_fp->code.r300;
+ compiler.code = &r300_fp->code;
compiler.program = _mesa_clone_program(ctx, &fp->Base);
if (RADEON_DEBUG & DEBUG_PIXEL) {
#endif
-struct r300_fragment_program;
-
extern void r300TranslateFragmentShader(GLcontext *ctx, struct gl_fragment_program *fp);
/**
* Used internally by the r300 fragment program code to store compile-time
* only data.
*/
-struct r300_fragment_program_compiler {
- r300ContextPtr r300;
- struct r300_fragment_program *fp;
- struct r300_fragment_program_code *code;
- struct gl_program *program;
-};
extern GLboolean r300FragmentProgramEmit(struct r300_fragment_program_compiler *compiler);
#define PROG_CODE \
struct r300_fragment_program_compiler *c = (struct r300_fragment_program_compiler*)data; \
- struct r300_fragment_program_code *code = c->code
+ struct r300_fragment_program_code *code = &c->code->r300
#define error(fmt, args...) do { \
fprintf(stderr, "%s::%s(): " fmt "\n", \
*/
static GLboolean finish_node(struct r300_fragment_program_compiler *c)
{
- struct r300_fragment_program_code *code = c->code;
+ struct r300_fragment_program_code *code = &c->code->r300;
struct r300_fragment_program_node *node = &code->node[code->cur_node];
if (node->alu_end < 0) {
*/
GLboolean r300FragmentProgramEmit(struct r300_fragment_program_compiler *compiler)
{
- struct r300_fragment_program_code *code = compiler->code;
+ struct r300_fragment_program_code *code = &compiler->code->r300;
_mesa_bzero(code, sizeof(struct r300_fragment_program_code));
code->node[0].alu_end = -1;
#include "r300_emit.h"
#include "r300_fragprog.h"
#include "r300_tex.h"
+#include "r500_fragprog.h"
#include "drirenderbuffer.h"
#include "tnl/tnl.h"
#include "tnl/t_pipeline.h"
+#include "r300_state.h"
#include "r300_swtcl.h"
#include "r300_emit.h"
#include "r300_tex.h"
struct radeon_transform_context *t,
struct prog_instruction* orig_inst, void* data)
{
- struct r500_fragment_program_compiler *compiler =
- (struct r500_fragment_program_compiler*)data;
+ struct r300_fragment_program_compiler *compiler =
+ (struct r300_fragment_program_compiler*)data;
struct prog_instruction inst = *orig_inst;
struct prog_instruction* tgt;
GLboolean destredirect = GL_FALSE;
* \todo if/when r5xx supports the radeon_program architecture, this is a
* likely candidate for code sharing.
*/
-static void insert_WPOS_trailer(struct r500_fragment_program_compiler *compiler)
+static void insert_WPOS_trailer(struct r300_fragment_program_compiler *compiler)
{
GLuint InputsRead = compiler->fp->Base.Base.InputsRead;
}
if (!r300_fp->translated) {
- struct r500_fragment_program_compiler compiler;
+ struct r300_fragment_program_compiler compiler;
compiler.r300 = r300;
compiler.fp = r300_fp;
- compiler.code = &r300_fp->code.r500;
+ compiler.code = &r300_fp->code;
compiler.program = _mesa_clone_program(ctx, &fp->Base);
if (RADEON_DEBUG & DEBUG_PIXEL) {
#include "r300_state.h"
#include "radeon_program.h"
-struct r500_fragment_program;
-
extern void r500TranslateFragmentShader(GLcontext *ctx, struct gl_fragment_program *fp);
-struct r500_fragment_program_compiler {
- r300ContextPtr r300;
- struct r300_fragment_program *fp;
- struct r500_fragment_program_code *code;
- struct gl_program *program;
-};
-
-extern GLboolean r500FragmentProgramEmit(struct r500_fragment_program_compiler *compiler);
+extern GLboolean r500FragmentProgramEmit(struct r300_fragment_program_compiler *compiler);
#endif
#define PROG_CODE \
- struct r500_fragment_program_compiler *c = (struct r500_fragment_program_compiler*)data; \
- struct r500_fragment_program_code *code = c->code
+ struct r300_fragment_program_compiler *c = (struct r300_fragment_program_compiler*)data; \
+ struct r500_fragment_program_code *code = &c->code->r500
#define error(fmt, args...) do { \
fprintf(stderr, "%s::%s(): " fmt "\n", \
.MaxHwTemps = 128
};
-GLboolean r500FragmentProgramEmit(struct r500_fragment_program_compiler *compiler)
+GLboolean r500FragmentProgramEmit(struct r300_fragment_program_compiler *compiler)
{
- struct r500_fragment_program_code *code = compiler->code;
+ struct r500_fragment_program_code *code = &compiler->code->r500;
_mesa_bzero(code, sizeof(*code));
code->max_temp_idx = 1;