Compare commits
12 Commits
texman_0_1
...
texman_0_1
Author | SHA1 | Date | |
---|---|---|---|
|
f248927f47 | ||
|
6396b8e5c4 | ||
|
0f2144cd0c | ||
|
bcc4804410 | ||
|
a03b239041 | ||
|
4890c7ed87 | ||
|
17c33d6f04 | ||
|
5ab599600e | ||
|
db4b6fd759 | ||
|
dbb2f30ad3 | ||
|
9c84dfe156 | ||
|
8d86325516 |
@@ -11,6 +11,7 @@ LIB_DEP = $(LIB_DIR)/$(GL_LIB_NAME) $(LIB_DIR)/$(GLU_LIB_NAME)
|
||||
PROGS = glthreads \
|
||||
glxdemo \
|
||||
glxgears \
|
||||
fgl_glxgears \
|
||||
glxgears_fbconfig \
|
||||
glxcontexts \
|
||||
glxheads \
|
||||
|
@@ -395,7 +395,8 @@ static void i915CullFaceFrontFace(GLcontext *ctx, GLenum unused)
|
||||
GLuint mode;
|
||||
|
||||
if (INTEL_DEBUG&DEBUG_DRI)
|
||||
fprintf(stderr, "%s\n", __FUNCTION__);
|
||||
fprintf(stderr, "%s %d\n", __FUNCTION__,
|
||||
ctx->DrawBuffer ? ctx->DrawBuffer->Name : 0);
|
||||
|
||||
if (!ctx->Polygon.CullFlag) {
|
||||
mode = S4_CULLMODE_NONE;
|
||||
@@ -403,6 +404,8 @@ static void i915CullFaceFrontFace(GLcontext *ctx, GLenum unused)
|
||||
else if (ctx->Polygon.CullFaceMode != GL_FRONT_AND_BACK) {
|
||||
mode = S4_CULLMODE_CW;
|
||||
|
||||
if (ctx->DrawBuffer && ctx->DrawBuffer->Name != 0)
|
||||
mode ^= (S4_CULLMODE_CW ^ S4_CULLMODE_CCW);
|
||||
if (ctx->Polygon.CullFaceMode == GL_FRONT)
|
||||
mode ^= (S4_CULLMODE_CW ^ S4_CULLMODE_CCW);
|
||||
if (ctx->Polygon.FrontFace != GL_CCW)
|
||||
|
@@ -138,7 +138,7 @@ static void i915_emit_invarient_state( struct intel_context *intel )
|
||||
{
|
||||
BATCH_LOCALS;
|
||||
|
||||
BEGIN_BATCH( 200, 0 );
|
||||
BEGIN_BATCH( 20, 0 );
|
||||
|
||||
OUT_BATCH(_3DSTATE_AA_CMD |
|
||||
AA_LINE_ECAAR_WIDTH_ENABLE |
|
||||
@@ -183,14 +183,6 @@ static void i915_emit_invarient_state( struct intel_context *intel )
|
||||
(1));
|
||||
OUT_BATCH(0);
|
||||
|
||||
/* XXX: Use this */
|
||||
OUT_BATCH(_3DSTATE_SCISSOR_ENABLE_CMD |
|
||||
DISABLE_SCISSOR_RECT);
|
||||
|
||||
OUT_BATCH(_3DSTATE_SCISSOR_RECT_0_CMD);
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
|
||||
OUT_BATCH(_3DSTATE_DEPTH_SUBRECT_DISABLE);
|
||||
|
||||
OUT_BATCH(_3DSTATE_LOAD_INDIRECT | 0); /* disable indirect state */
|
||||
|
@@ -323,6 +323,18 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield mask, GLboolean all,
|
||||
drm_clip_rect_t clear;
|
||||
int i;
|
||||
|
||||
/* Refresh the cx/y/w/h values as they may have been invalidated
|
||||
* by a new window position or size picked up when we did
|
||||
* LOCK_HARDWARE above. The values passed by mesa are not
|
||||
* reliable.
|
||||
*/
|
||||
{
|
||||
cx = ctx->DrawBuffer->_Xmin;
|
||||
cy = ctx->DrawBuffer->_Ymin;
|
||||
ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
|
||||
cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
|
||||
}
|
||||
|
||||
if (intel->ctx.DrawBuffer->Name == 0) {
|
||||
/* clearing a window */
|
||||
|
||||
|
@@ -282,7 +282,20 @@ static void intelClearWithTris(struct intel_context *intel,
|
||||
|
||||
intel->vtbl.install_meta_state(intel);
|
||||
|
||||
/* note: regardless of 'all', cx, cy, cw, ch are correct */
|
||||
|
||||
/* Refresh the cx/y/w/h values as they may have been invalidated
|
||||
* by a new window position or size picked up when we did
|
||||
* LOCK_HARDWARE above. The values passed by mesa are not
|
||||
* reliable.
|
||||
*/
|
||||
{
|
||||
cx = ctx->DrawBuffer->_Xmin;
|
||||
cy = ctx->DrawBuffer->_Ymin;
|
||||
ch = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
|
||||
cw = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
|
||||
}
|
||||
|
||||
/* note: regardless of 'all', cx, cy, cw, ch are now correct */
|
||||
clear.x1 = cx;
|
||||
clear.y1 = cy;
|
||||
clear.x2 = cx + cw;
|
||||
@@ -558,7 +571,7 @@ intel_draw_buffer(GLcontext *ctx, struct gl_framebuffer *fb)
|
||||
/* this may occur when we're called by glBindFrameBuffer() during
|
||||
* the process of someone setting up renderbuffers, etc.
|
||||
*/
|
||||
_mesa_debug(ctx, "DrawBuffer: incomplete user FBO\n");
|
||||
/*_mesa_debug(ctx, "DrawBuffer: incomplete user FBO\n");*/
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -615,6 +628,14 @@ intel_draw_buffer(GLcontext *ctx, struct gl_framebuffer *fb)
|
||||
colorRegion = (irb && irb->region) ? irb->region : NULL;
|
||||
}
|
||||
|
||||
/* Update culling direction which changes depending on the
|
||||
* orientation of the buffer:
|
||||
*/
|
||||
if (ctx->Driver.FrontFace)
|
||||
ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace);
|
||||
else
|
||||
ctx->NewState |= _NEW_POLYGON;
|
||||
|
||||
if (!colorRegion) {
|
||||
FALLBACK( intel, INTEL_FALLBACK_DRAW_BUFFER, GL_TRUE );
|
||||
}
|
||||
|
@@ -492,17 +492,14 @@ intel_wrap_texture(GLcontext *ctx, struct gl_texture_image *texImage)
|
||||
if (texImage->TexFormat == &_mesa_texformat_argb8888) {
|
||||
irb->Base._ActualFormat = GL_RGBA8;
|
||||
irb->Base._BaseFormat = GL_RGBA;
|
||||
_mesa_debug(ctx, "Render to RGBA8 texture OK\n");
|
||||
}
|
||||
else if (texImage->TexFormat == &_mesa_texformat_rgb565) {
|
||||
irb->Base._ActualFormat = GL_RGB5;
|
||||
irb->Base._BaseFormat = GL_RGB;
|
||||
_mesa_debug(ctx, "Render to RGB5 texture OK\n");
|
||||
}
|
||||
else if (texImage->TexFormat == &_mesa_texformat_depth_component16) {
|
||||
irb->Base._ActualFormat = GL_DEPTH_COMPONENT16;
|
||||
irb->Base._BaseFormat = GL_DEPTH_COMPONENT;
|
||||
_mesa_debug(ctx, "Render to DEPTH16 texture OK\n");
|
||||
}
|
||||
else {
|
||||
_mesa_debug(ctx, "Render to texture BAD FORMAT %d\n", texImage->TexFormat->MesaFormat);
|
||||
|
@@ -99,23 +99,24 @@ static GLboolean do_texture_copypixels( GLcontext *ctx,
|
||||
*
|
||||
* XXX: do a copy to a temporary.
|
||||
*/
|
||||
if (src->buffer == dst->buffer)
|
||||
{
|
||||
drm_clip_rect_t src;
|
||||
drm_clip_rect_t dst;
|
||||
drm_clip_rect_t srcbox;
|
||||
drm_clip_rect_t dstbox;
|
||||
drm_clip_rect_t tmp;
|
||||
|
||||
src.x1 = srcx;
|
||||
src.y1 = srcy;
|
||||
src.x2 = srcx + width;
|
||||
src.y2 = srcy + height;
|
||||
srcbox.x1 = srcx;
|
||||
srcbox.y1 = srcy;
|
||||
srcbox.x2 = srcx + width;
|
||||
srcbox.y2 = srcy + height;
|
||||
|
||||
dst.x1 = dstx;
|
||||
dst.y1 = dsty;
|
||||
dst.x1 = dstx + width * ctx->Pixel.ZoomX;
|
||||
dst.y2 = dsty + height * ctx->Pixel.ZoomY;
|
||||
dstbox.x1 = dstx;
|
||||
dstbox.y1 = dsty;
|
||||
dstbox.x1 = dstx + width * ctx->Pixel.ZoomX;
|
||||
dstbox.y2 = dsty + height * ctx->Pixel.ZoomY;
|
||||
|
||||
|
||||
if (intel_intersect_cliprects(&tmp, &src, &dst)) {
|
||||
if (intel_intersect_cliprects(&tmp, &srcbox, &dstbox)) {
|
||||
if (INTEL_DEBUG & DEBUG_PIXEL)
|
||||
_mesa_printf("%s: regions overlap\n", __FUNCTION__);
|
||||
return GL_FALSE;
|
||||
|
@@ -848,8 +848,36 @@ _mesa_PopAttrib(void)
|
||||
(GLboolean) (color->ColorMask[1] != 0),
|
||||
(GLboolean) (color->ColorMask[2] != 0),
|
||||
(GLboolean) (color->ColorMask[3] != 0));
|
||||
_mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers,
|
||||
color->DrawBuffer, NULL);
|
||||
{
|
||||
/* Need to determine if more than one color output is
|
||||
* specified. If so, call glDrawBuffersARB, else call
|
||||
* glDrawBuffer(). This is a subtle, but essential point
|
||||
* since GL_FRONT (for example) is illegal for the former
|
||||
* function, but legal for the later.
|
||||
*/
|
||||
GLboolean multipleBuffers = GL_FALSE;
|
||||
if (ctx->Extensions.ARB_draw_buffers) {
|
||||
GLuint i;
|
||||
for (i = 1; i < ctx->Const.MaxDrawBuffers; i++) {
|
||||
if (color->DrawBuffer[i] != GL_NONE) {
|
||||
multipleBuffers = GL_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Call the API_level functions, not _mesa_drawbuffers()
|
||||
* since we need to do error checking on the pop'd
|
||||
* GL_DRAW_BUFFER.
|
||||
* Ex: if GL_FRONT were pushed, but we're popping with a
|
||||
* user FBO bound, GL_FRONT will be illegal and we'll need
|
||||
* to record that error. Per OpenGL ARB decision.
|
||||
*/
|
||||
if (multipleBuffers)
|
||||
_mesa_DrawBuffersARB(ctx->Const.MaxDrawBuffers,
|
||||
color->DrawBuffer);
|
||||
else
|
||||
_mesa_DrawBuffer(color->DrawBuffer[0]);
|
||||
}
|
||||
_mesa_set_enable(ctx, GL_ALPHA_TEST, color->AlphaEnabled);
|
||||
_mesa_AlphaFunc(color->AlphaFunc, color->AlphaRef);
|
||||
_mesa_set_enable(ctx, GL_BLEND, color->BlendEnabled);
|
||||
|
@@ -459,16 +459,14 @@ set_color_output(GLcontext *ctx, GLuint output, GLenum buffer,
|
||||
|
||||
ASSERT(output < ctx->Const.MaxDrawBuffers);
|
||||
|
||||
/* Set per-FBO state */
|
||||
fb->ColorDrawBuffer[output] = buffer;
|
||||
fb->_ColorDrawBufferMask[output] = destMask;
|
||||
|
||||
if (fb->Name == 0) {
|
||||
/* Set traditional state var */
|
||||
ctx->Color.DrawBuffer[output] = buffer;
|
||||
}
|
||||
|
||||
/* not really needed, will be set later */
|
||||
fb->_NumColorDrawBuffers[output] = 0;
|
||||
|
||||
/* Set traditional state var */
|
||||
ctx->Color.DrawBuffer[output] = buffer;
|
||||
}
|
||||
|
||||
|
||||
@@ -592,11 +590,9 @@ _mesa_ReadBuffer(GLenum buffer)
|
||||
* \note This function should only be called through the GL API, not
|
||||
* from device drivers (as was done in the past).
|
||||
*/
|
||||
void GLAPIENTRY
|
||||
_mesa_ResizeBuffersMESA( void )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
void _mesa_resizebuffers( GLcontext *ctx )
|
||||
{
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx );
|
||||
|
||||
if (MESA_VERBOSE & VERBOSE_API)
|
||||
@@ -638,6 +634,14 @@ _mesa_ResizeBuffersMESA( void )
|
||||
ctx->NewState |= _NEW_BUFFERS; /* to update scissor / window bounds */
|
||||
}
|
||||
|
||||
void GLAPIENTRY
|
||||
_mesa_ResizeBuffersMESA( void )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
_mesa_resizebuffers( ctx );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* XXX move somewhere else someday?
|
||||
|
@@ -78,4 +78,6 @@ extern void _mesa_set_scissor( GLcontext *ctx,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height );
|
||||
|
||||
|
||||
extern void _mesa_resizebuffers( GLcontext *ctx );
|
||||
|
||||
#endif
|
||||
|
@@ -1635,6 +1635,8 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
|
||||
if (readBuffer != drawBuffer && !readBuffer->Initialized) {
|
||||
initialize_framebuffer_size(newCtx, readBuffer);
|
||||
}
|
||||
|
||||
_mesa_resizebuffers(newCtx);
|
||||
#endif
|
||||
if (newCtx->FirstTimeCurrent) {
|
||||
/* set initial viewport and scissor size now */
|
||||
|
@@ -587,6 +587,11 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer)
|
||||
}
|
||||
|
||||
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
|
||||
/* The above doesn't fully flush the drivers in the way that a
|
||||
* glFlush does, but that is required here:
|
||||
*/
|
||||
ctx->Driver.Flush(ctx);
|
||||
|
||||
|
||||
if (renderbuffer) {
|
||||
newRb = _mesa_lookup_renderbuffer(ctx, renderbuffer);
|
||||
@@ -995,6 +1000,11 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
|
||||
|
||||
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
|
||||
|
||||
/* The above doesn't fully flush the drivers in the way that a
|
||||
* glFlush does, but that is required here:
|
||||
*/
|
||||
ctx->Driver.Flush(ctx);
|
||||
|
||||
if (framebuffer) {
|
||||
/* Binding a user-created framebuffer object */
|
||||
newFb = _mesa_lookup_framebuffer(ctx, framebuffer);
|
||||
@@ -1079,6 +1089,10 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers)
|
||||
|
||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
|
||||
/* The above doesn't fully flush the drivers in the way that a
|
||||
* glFlush does, but that is required here:
|
||||
*/
|
||||
ctx->Driver.Flush(ctx);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (framebuffers[i] > 0) {
|
||||
@@ -1299,6 +1313,10 @@ framebuffer_texture(GLuint dims, GLenum target, GLenum attachment,
|
||||
}
|
||||
|
||||
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
|
||||
/* The above doesn't fully flush the drivers in the way that a
|
||||
* glFlush does, but that is required here:
|
||||
*/
|
||||
ctx->Driver.Flush(ctx);
|
||||
|
||||
_glthread_LOCK_MUTEX(fb->Mutex);
|
||||
if (texObj) {
|
||||
@@ -1417,6 +1435,10 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment,
|
||||
}
|
||||
|
||||
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
|
||||
/* The above doesn't fully flush the drivers in the way that a
|
||||
* glFlush does, but that is required here:
|
||||
*/
|
||||
ctx->Driver.Flush(ctx);
|
||||
|
||||
assert(ctx->Driver.FramebufferRenderbuffer);
|
||||
ctx->Driver.FramebufferRenderbuffer(ctx, fb, attachment, rb);
|
||||
@@ -1480,6 +1502,10 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
|
||||
}
|
||||
|
||||
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
|
||||
/* The above doesn't fully flush the drivers in the way that a
|
||||
* glFlush does, but that is required here:
|
||||
*/
|
||||
ctx->Driver.Flush(ctx);
|
||||
|
||||
switch (pname) {
|
||||
case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT:
|
||||
|
@@ -1448,11 +1448,13 @@ texture_error_check( GLcontext *ctx, GLenum target,
|
||||
|
||||
/* additional checks for depth textures */
|
||||
if (_mesa_base_tex_format(ctx, internalFormat) == GL_DEPTH_COMPONENT) {
|
||||
/* Only 1D and 2D textures supported */
|
||||
/* Only 1D, 2D and rectangular textures supported, not 3D or cubes */
|
||||
if (target != GL_TEXTURE_1D &&
|
||||
target != GL_PROXY_TEXTURE_1D &&
|
||||
target != GL_TEXTURE_2D &&
|
||||
target != GL_PROXY_TEXTURE_2D) {
|
||||
target != GL_PROXY_TEXTURE_2D &&
|
||||
target != GL_TEXTURE_RECTANGLE_ARB &&
|
||||
target != GL_PROXY_TEXTURE_RECTANGLE_ARB) {
|
||||
if (!isProxy)
|
||||
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||
"glTexImage(target/internalFormat)");
|
||||
|
Reference in New Issue
Block a user