summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/r300_context.c
diff options
context:
space:
mode:
authorMichal Krol <michal@vmware.com>2009-12-12 16:48:32 +0100
committerMichal Krol <michal@vmware.com>2009-12-12 16:48:32 +0100
commita3eb0f718e19653a2ad8e49396c904183be456f3 (patch)
tree0092574c469ea586a6cab8b8ebb7ac62b8221a2a /src/mesa/drivers/dri/r300/r300_context.c
parent491f384c3958067e6c4c994041f5d8d413b806bc (diff)
parent784cca9fa527de771754d76545970f78094b9adf (diff)
Merge branch 'master' into glsl-pp-rework-2
Conflicts: progs/perf/drawoverhead.c progs/perf/teximage.c progs/perf/vbo.c progs/perf/vertexrate.c src/mesa/shader/slang/library/slang_common_builtin_gc.h
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_context.c')
-rw-r--r--src/mesa/drivers/dri/r300/r300_context.c47
1 files changed, 34 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c
index 6fcf209af6..05005f61c3 100644
--- a/src/mesa/drivers/dri/r300/r300_context.c
+++ b/src/mesa/drivers/dri/r300/r300_context.c
@@ -55,13 +55,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "tnl/t_vp_build.h"
#include "drivers/common/driverfuncs.h"
+#include "drivers/common/meta.h"
#include "r300_context.h"
#include "radeon_context.h"
#include "radeon_span.h"
+#include "r300_blit.h"
#include "r300_cmdbuf.h"
#include "r300_state.h"
-#include "r300_ioctl.h"
#include "r300_tex.h"
#include "r300_emit.h"
#include "r300_swtcl.h"
@@ -90,10 +91,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define need_GL_ATI_separate_stencil
#define need_GL_NV_vertex_program
-#include "extension_helper.h"
+#include "main/remap_helper.h"
+void r300_init_texcopy_functions(struct dd_function_table *table);
-const struct dri_extension card_extensions[] = {
+static const struct dri_extension card_extensions[] = {
/* *INDENT-OFF* */
{"GL_ARB_depth_texture", NULL},
{"GL_ARB_fragment_program", NULL},
@@ -145,7 +147,7 @@ const struct dri_extension card_extensions[] = {
};
-const struct dri_extension mm_extensions[] = {
+static const struct dri_extension mm_extensions[] = {
{ "GL_EXT_framebuffer_blit", GL_EXT_framebuffer_blit_functions },
{ "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions },
{ NULL, NULL }
@@ -155,7 +157,7 @@ const struct dri_extension mm_extensions[] = {
* The GL 2.0 functions are needed to make display lists work with
* functions added by GL_ATI_separate_stencil.
*/
-const struct dri_extension gl_20_extension[] = {
+static const struct dri_extension gl_20_extension[] = {
{"GL_VERSION_2_0", GL_VERSION_2_0_functions },
};
@@ -376,11 +378,21 @@ static void r300InitConstValues(GLcontext *ctx, radeonScreenPtr screen)
if (screen->chip_family >= CHIP_FAMILY_RV515) {
ctx->Const.FragmentProgram.MaxNativeTemps = R500_PFS_NUM_TEMP_REGS;
ctx->Const.FragmentProgram.MaxNativeAttribs = 11; /* copy i915... */
- ctx->Const.FragmentProgram.MaxNativeParameters = R500_PFS_NUM_CONST_REGS;
- ctx->Const.FragmentProgram.MaxNativeAluInstructions = R500_PFS_MAX_INST;
- ctx->Const.FragmentProgram.MaxNativeTexInstructions = R500_PFS_MAX_INST;
- ctx->Const.FragmentProgram.MaxNativeInstructions = R500_PFS_MAX_INST;
- ctx->Const.FragmentProgram.MaxNativeTexIndirections = R500_PFS_MAX_INST;
+
+ /* The hardware limits are higher than this,
+ * but the non-KMS DRM interface artificially limits us
+ * to this many instructions.
+ *
+ * We could of course work around it in the KMS path,
+ * but it would be a mess, so it seems wiser
+ * to leave it as is. Going forward, the Gallium driver
+ * will not be subject to these limitations.
+ */
+ ctx->Const.FragmentProgram.MaxNativeParameters = 255;
+ ctx->Const.FragmentProgram.MaxNativeAluInstructions = 255;
+ ctx->Const.FragmentProgram.MaxNativeTexInstructions = 255;
+ ctx->Const.FragmentProgram.MaxNativeInstructions = 255;
+ ctx->Const.FragmentProgram.MaxNativeTexIndirections = 255;
ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0;
} else {
ctx->Const.FragmentProgram.MaxNativeTemps = R300_PFS_NUM_TEMP_REGS;
@@ -429,11 +441,11 @@ static void r300InitGLExtensions(GLcontext *ctx)
if (r300->options.stencil_two_side_disabled)
_mesa_disable_extension(ctx, "GL_EXT_stencil_two_side");
- if (r300->options.s3tc_force_enabled) {
+ if (r300->options.s3tc_force_disabled) {
+ _mesa_disable_extension(ctx, "GL_EXT_texture_compression_s3tc");
+ } else if (ctx->Mesa_DXTn || r300->options.s3tc_force_enabled) {
_mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc");
_mesa_enable_extension(ctx, "GL_S3_s3tc");
- } else if (r300->options.s3tc_force_disabled) {
- _mesa_disable_extension(ctx, "GL_EXT_texture_compression_s3tc");
}
if (!r300->radeon.radeonScreen->drmSupportsOcclusionQueries) {
@@ -441,6 +453,13 @@ static void r300InitGLExtensions(GLcontext *ctx)
}
}
+static void r300InitIoctlFuncs(struct dd_function_table *functions)
+{
+ functions->Clear = _mesa_meta_Clear;
+ functions->Finish = radeonFinish;
+ functions->Flush = radeonFlush;
+}
+
/* Create the device specific rendering context.
*/
GLboolean r300CreateContext(const __GLcontextModes * glVisual,
@@ -467,6 +486,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
r300_init_vtbl(&r300->radeon);
_mesa_init_driver_functions(&functions);
+ r300_init_texcopy_functions(&functions);
r300InitIoctlFuncs(&functions);
r300InitStateFuncs(&functions);
r300InitTextureFuncs(&functions);
@@ -520,6 +540,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
r300InitSwtcl(ctx);
}
+ r300_blit_init(r300);
radeon_fbo_init(&r300->radeon);
radeonInitSpanFuncs( ctx );
r300InitCmdBuf(r300);