#include "vblank.h"
#include "utils.h"
-#include "xmlpool.h" /* for symbolic values of enum-type options */
+#include "xmlpool.h" /* for symbolic values of enum-type options */\r
+\r
+//#define R600_ENABLE_GLSL_TEST 1
#define need_GL_VERSION_2_0
#define need_GL_ARB_occlusion_query
* The GL 2.0 functions are needed to make display lists work with
* functions added by GL_ATI_separate_stencil.
*/
-static const struct dri_extension gl_20_extension[] = {
- {"GL_VERSION_2_0", GL_VERSION_2_0_functions },
+static const struct dri_extension gl_20_extension[] = {\r
+#ifdef R600_ENABLE_GLSL_TEST\r
+ {"GL_ARB_shading_language_100", GL_VERSION_2_0_functions },\r
+#else
+ {"GL_VERSION_2_0", GL_VERSION_2_0_functions },\r
+#endif /* R600_ENABLE_GLSL_TEST */
};
static const struct tnl_pipeline_stage *r600_pipeline[] = {
driInitExtensions(ctx, card_extensions, GL_TRUE);
if (r600->radeon.radeonScreen->kernel_mm)
- driInitExtensions(ctx, mm_extensions, GL_FALSE);
+ driInitExtensions(ctx, mm_extensions, GL_FALSE);\r
+\r
+#ifdef R600_ENABLE_GLSL_TEST\r
+ driInitExtensions(ctx, gl_20_extension, GL_TRUE);\r
+ //_mesa_enable_2_0_extensions(ctx);\r
+ //1.5\r
+ ctx->Extensions.ARB_occlusion_query = GL_TRUE;\r
+ ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE;\r
+ ctx->Extensions.EXT_shadow_funcs = GL_TRUE;\r
+ //2.0\r
+ ctx->Extensions.ARB_draw_buffers = GL_TRUE;\r
+ ctx->Extensions.ARB_point_sprite = GL_TRUE;\r
+ ctx->Extensions.ARB_shader_objects = GL_TRUE;\r
+ ctx->Extensions.ARB_vertex_shader = GL_TRUE;\r
+ ctx->Extensions.ARB_fragment_shader = GL_TRUE;\r
+ ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE;\r
+ ctx->Extensions.EXT_blend_equation_separate = GL_TRUE;\r
+ ctx->Extensions.ATI_separate_stencil = GL_TRUE;\r
+\r
+ /* glsl compiler has problem if this is not GL_TRUE */\r
+ ctx->Shader.EmitCondCodes = GL_TRUE;\r
+#endif /* R600_ENABLE_GLSL_TEST */
if (driQueryOptionb
(&r600->radeon.optionCache, "disable_stencil_two_side"))
assert(glVisual);
assert(driContextPriv);
- assert(screen);
+ assert(screen);\r
+\r
+ //richard test\r
+ FILE *pFile = NULL;\r
+ unsigned long ulByteToWrite = 0;\r
+ char szStr[1024];\r
+\r
+ pFile = fopen("//home//richard//rtp-log//func_call.log", "a+");\r
+ if(NULL != pFile)\r
+ {\r
+ sprintf(szStr, "r600CreateContext \r\n");\r
+ ulByteToWrite = strlen(szStr);\r
+ fwrite(szStr, 1, ulByteToWrite, pFile);\r
+\r
+ fclose(pFile);\r
+ pFile = NULL;\r
+ }\r
+ //-------------
/* Allocate the R600 context */
r600 = (context_t*) CALLOC(sizeof(*r600));
inline void checkStackDepth(r700_AssemblerBase *pAsm, GLuint uReason)
{
- switch (uReason)
- {
- case FC_PUSH_VPM:
- break;
- case FC_PUSH_WQM:
- break;
- case FC_LOOP:
- break;
- case FC_REP:
- break;
- };
+ switch (uReason)\r
+ {\r
+ case FC_PUSH_VPM:\r
+ pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs++;\r
+ pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.current++;\r
+ break;\r
+ case FC_PUSH_WQM:\r
+ pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs++;\r
+ pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.current += 4;\r
+ break;\r
+ case FC_LOOP:\r
+ pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs += 4;\r
+ break;\r
+ case FC_REP:\r
+ /* TODO : for 16 vp asic, should += 2; */\r
+ pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs += 1;\r
+ break;\r
+ };\r
+\r
+ if(pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs\r
+ > pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.max)\r
+ {\r
+ pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.max =\r
+ pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs;\r
+ }
}
GLboolean jumpToOffest(r700_AssemblerBase *pAsm, GLuint pops, GLint offset)
GLboolean assemble_ELSE(r700_AssemblerBase *pAsm)
{
-#ifdef USE_CF_FOR_POP_AFTER
- pops(pAsm, 1);
-#endif /* USE_CF_FOR_POP_AFTER */
-
if(GL_FALSE == add_cf_instruction(pAsm) )
{
return GL_FALSE;
{
return GL_FALSE;
}
-#endif
+#endif\r
+\r
+ checkStackDepth(pAsm, FC_PUSH_VPM);
return GL_TRUE;
}