mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
Merge branch 'mesa_7_5_branch'
This commit is contained in:
commit
877061141a
7 changed files with 33 additions and 31 deletions
|
|
@ -549,12 +549,22 @@ pf_get_2d_size(const struct pipe_format_block *block, size_t stride, unsigned he
|
|||
}
|
||||
|
||||
static INLINE boolean
|
||||
pf_is_depth_stencil( enum pipe_format format )
|
||||
pf_is_depth_or_stencil( enum pipe_format format )
|
||||
{
|
||||
return (pf_get_component_bits( format, PIPE_FORMAT_COMP_Z ) +
|
||||
pf_get_component_bits( format, PIPE_FORMAT_COMP_S )) != 0;
|
||||
}
|
||||
|
||||
static INLINE boolean
|
||||
pf_is_depth_and_stencil( enum pipe_format format )
|
||||
{
|
||||
return (pf_get_component_bits( format, PIPE_FORMAT_COMP_Z ) != 0 &&
|
||||
pf_get_component_bits( format, PIPE_FORMAT_COMP_S ) != 0);
|
||||
}
|
||||
|
||||
/** DEPRECATED: For backwards compatibility */
|
||||
#define pf_is_depth_stencil pf_is_depth_or_stencil
|
||||
|
||||
static INLINE boolean
|
||||
pf_is_compressed( enum pipe_format format )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -237,8 +237,8 @@ find_translated_vp(struct st_context *st,
|
|||
}
|
||||
if (emitBFC1) {
|
||||
xvp->output_to_slot[VERT_RESULT_BFC1] = numVpOuts++;
|
||||
xvp->output_to_semantic_name[VERT_RESULT_BFC0] = TGSI_SEMANTIC_COLOR;
|
||||
xvp->output_to_semantic_index[VERT_RESULT_BFC0] = 1;
|
||||
xvp->output_to_semantic_name[VERT_RESULT_BFC1] = TGSI_SEMANTIC_COLOR;
|
||||
xvp->output_to_semantic_index[VERT_RESULT_BFC1] = 1;
|
||||
}
|
||||
|
||||
/* Unneeded vertex program outputs will go to this slot.
|
||||
|
|
|
|||
|
|
@ -103,20 +103,6 @@ st_destroy_clear(struct st_context *st)
|
|||
}
|
||||
|
||||
|
||||
static GLboolean
|
||||
is_depth_stencil_format(enum pipe_format pipeFormat)
|
||||
{
|
||||
switch (pipeFormat) {
|
||||
case PIPE_FORMAT_S8Z24_UNORM:
|
||||
case PIPE_FORMAT_Z24S8_UNORM:
|
||||
return GL_TRUE;
|
||||
default:
|
||||
return GL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Draw a screen-aligned quadrilateral.
|
||||
* Coords are window coords with y=0=bottom. These will be passed
|
||||
|
|
@ -331,7 +317,7 @@ static INLINE GLboolean
|
|||
check_clear_depth_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
|
||||
{
|
||||
const struct st_renderbuffer *strb = st_renderbuffer(rb);
|
||||
const GLboolean isDS = is_depth_stencil_format(strb->surface->format);
|
||||
const GLboolean isDS = pf_is_depth_and_stencil(strb->surface->format);
|
||||
|
||||
if (ctx->Scissor.Enabled)
|
||||
return TRUE;
|
||||
|
|
@ -351,7 +337,7 @@ static INLINE GLboolean
|
|||
check_clear_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb)
|
||||
{
|
||||
const struct st_renderbuffer *strb = st_renderbuffer(rb);
|
||||
const GLboolean isDS = is_depth_stencil_format(strb->surface->format);
|
||||
const GLboolean isDS = pf_is_depth_and_stencil(strb->surface->format);
|
||||
const GLuint stencilMax = (1 << rb->StencilBits) - 1;
|
||||
const GLboolean maskStencil
|
||||
= (ctx->Stencil.WriteMask[0] & stencilMax) != stencilMax;
|
||||
|
|
|
|||
|
|
@ -769,7 +769,6 @@ st_DrawPixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
|
|||
struct st_vertex_program *stvp;
|
||||
struct st_context *st = ctx->st;
|
||||
struct pipe_surface *ps;
|
||||
GLuint bufferFormat;
|
||||
const GLfloat *color;
|
||||
|
||||
if (format == GL_STENCIL_INDEX ||
|
||||
|
|
@ -797,8 +796,6 @@ st_DrawPixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
|
|||
color = NULL;
|
||||
}
|
||||
|
||||
bufferFormat = ps->format;
|
||||
|
||||
/* draw with textured quad */
|
||||
{
|
||||
struct pipe_texture *pt
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ default_depth_format(struct pipe_screen *screen,
|
|||
* or PIPE_TEXTURE_USAGE_SAMPLER
|
||||
*/
|
||||
enum pipe_format
|
||||
st_choose_format(struct pipe_context *pipe, GLint internalFormat,
|
||||
st_choose_format(struct pipe_context *pipe, GLenum internalFormat,
|
||||
enum pipe_texture_target target, unsigned tex_usage)
|
||||
{
|
||||
struct pipe_screen *screen = pipe->screen;
|
||||
|
|
@ -594,9 +594,13 @@ st_choose_format(struct pipe_context *pipe, GLint internalFormat,
|
|||
|
||||
|
||||
static GLboolean
|
||||
is_stencil_format(GLenum format)
|
||||
is_depth_or_stencil_format(GLenum internalFormat)
|
||||
{
|
||||
switch (format) {
|
||||
switch (internalFormat) {
|
||||
case GL_DEPTH_COMPONENT:
|
||||
case GL_DEPTH_COMPONENT16:
|
||||
case GL_DEPTH_COMPONENT24:
|
||||
case GL_DEPTH_COMPONENT32:
|
||||
case GL_STENCIL_INDEX:
|
||||
case GL_STENCIL_INDEX1_EXT:
|
||||
case GL_STENCIL_INDEX4_EXT:
|
||||
|
|
@ -614,10 +618,10 @@ is_stencil_format(GLenum format)
|
|||
* Called by FBO code to choose a PIPE_FORMAT_ for drawing surfaces.
|
||||
*/
|
||||
enum pipe_format
|
||||
st_choose_renderbuffer_format(struct pipe_context *pipe, GLint internalFormat)
|
||||
st_choose_renderbuffer_format(struct pipe_context *pipe, GLenum internalFormat)
|
||||
{
|
||||
uint usage;
|
||||
if (is_stencil_format(internalFormat))
|
||||
if (is_depth_or_stencil_format(internalFormat))
|
||||
usage = PIPE_TEXTURE_USAGE_DEPTH_STENCIL;
|
||||
else
|
||||
usage = PIPE_TEXTURE_USAGE_RENDER_TARGET;
|
||||
|
|
|
|||
|
|
@ -64,11 +64,11 @@ st_mesa_format_to_pipe_format(GLuint mesaFormat);
|
|||
|
||||
|
||||
extern enum pipe_format
|
||||
st_choose_format(struct pipe_context *pipe, GLint internalFormat,
|
||||
st_choose_format(struct pipe_context *pipe, GLenum internalFormat,
|
||||
enum pipe_texture_target target, unsigned tex_usage);
|
||||
|
||||
extern enum pipe_format
|
||||
st_choose_renderbuffer_format(struct pipe_context *pipe, GLint internalFormat);
|
||||
st_choose_renderbuffer_format(struct pipe_context *pipe, GLenum internalFormat);
|
||||
|
||||
|
||||
extern const struct gl_texture_format *
|
||||
|
|
|
|||
|
|
@ -51,6 +51,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#endif
|
||||
|
||||
|
||||
/** ID/name for immediate-mode VBO */
|
||||
#define IMM_BUFFER_NAME 0xaabbccdd
|
||||
|
||||
|
||||
static void reset_attrfv( struct vbo_exec_context *exec );
|
||||
|
||||
|
||||
|
|
@ -665,7 +669,7 @@ void vbo_use_buffer_objects(GLcontext *ctx)
|
|||
/* Any buffer name but 0 can be used here since this bufferobj won't
|
||||
* go into the bufferobj hashtable.
|
||||
*/
|
||||
GLuint bufName = 0xaabbccdd;
|
||||
GLuint bufName = IMM_BUFFER_NAME;
|
||||
GLenum target = GL_ARRAY_BUFFER_ARB;
|
||||
GLenum usage = GL_STREAM_DRAW_ARB;
|
||||
GLsizei size = VBO_VERT_BUFFER_SIZE;
|
||||
|
|
@ -734,7 +738,8 @@ void vbo_exec_vtx_destroy( struct vbo_exec_context *exec )
|
|||
/* True VBOs should already be unmapped
|
||||
*/
|
||||
if (exec->vtx.buffer_map) {
|
||||
assert (exec->vtx.bufferobj->Name == 0);
|
||||
ASSERT(exec->vtx.bufferobj->Name == 0 ||
|
||||
exec->vtx.bufferobj->Name == IMM_BUFFER_NAME);
|
||||
if (exec->vtx.bufferobj->Name == 0) {
|
||||
ALIGN_FREE(exec->vtx.buffer_map);
|
||||
exec->vtx.buffer_map = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue