st/mesa: fix DrawPixels(GL_STENCIL_INDEX)
This is a bug which was probably uncovered recently by Jason's commits and broke this. The problem is _mesa_base_tex_format(GL_STENCIL_INDEX) returns -1. Tested-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
@@ -494,22 +494,19 @@ make_texture(struct st_context *st,
|
|||||||
pipeFormat = st_choose_matching_format(pipe->screen, PIPE_BIND_SAMPLER_VIEW,
|
pipeFormat = st_choose_matching_format(pipe->screen, PIPE_BIND_SAMPLER_VIEW,
|
||||||
format, type, unpack->SwapBytes);
|
format, type, unpack->SwapBytes);
|
||||||
|
|
||||||
if (pipeFormat != PIPE_FORMAT_NONE) {
|
if (pipeFormat == PIPE_FORMAT_NONE) {
|
||||||
mformat = st_pipe_format_to_mesa_format(pipeFormat);
|
|
||||||
baseInternalFormat = _mesa_get_format_base_format(mformat);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
/* Use the generic approach. */
|
/* Use the generic approach. */
|
||||||
GLenum intFormat = internal_format(ctx, format, type);
|
GLenum intFormat = internal_format(ctx, format, type);
|
||||||
|
|
||||||
baseInternalFormat = _mesa_base_tex_format(ctx, intFormat);
|
|
||||||
pipeFormat = st_choose_format(st, intFormat, format, type,
|
pipeFormat = st_choose_format(st, intFormat, format, type,
|
||||||
PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW,
|
PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW,
|
||||||
FALSE);
|
FALSE);
|
||||||
assert(pipeFormat != PIPE_FORMAT_NONE);
|
assert(pipeFormat != PIPE_FORMAT_NONE);
|
||||||
mformat = st_pipe_format_to_mesa_format(pipeFormat);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mformat = st_pipe_format_to_mesa_format(pipeFormat);
|
||||||
|
baseInternalFormat = _mesa_get_format_base_format(mformat);
|
||||||
|
|
||||||
pixels = _mesa_map_pbo_source(ctx, unpack, pixels);
|
pixels = _mesa_map_pbo_source(ctx, unpack, pixels);
|
||||||
if (!pixels)
|
if (!pixels)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Reference in New Issue
Block a user