GLenum intFormat = internal_format(ctx, format, type);
pipeFormat = st_choose_format(st, intFormat, format, type,
- st->internal_target, 0,
+ st->internal_target, 0, 0,
PIPE_BIND_SAMPLER_VIEW, FALSE);
assert(pipeFormat != PIPE_FORMAT_NONE);
}
/* srcFormat is non-renderable. Find a compatible renderable format. */
if (type == GL_DEPTH) {
srcFormat = st_choose_format(st, GL_DEPTH_COMPONENT, GL_NONE,
- GL_NONE, st->internal_target, 0,
+ GL_NONE, st->internal_target, 0, 0,
srcBind, FALSE);
}
else {
if (util_format_is_float(srcFormat)) {
srcFormat = st_choose_format(st, GL_RGBA32F, GL_NONE,
- GL_NONE, st->internal_target, 0,
+ GL_NONE, st->internal_target, 0, 0,
srcBind, FALSE);
}
else if (util_format_is_pure_sint(srcFormat)) {
srcFormat = st_choose_format(st, GL_RGBA32I, GL_NONE,
- GL_NONE, st->internal_target, 0,
+ GL_NONE, st->internal_target, 0, 0,
srcBind, FALSE);
}
else if (util_format_is_pure_uint(srcFormat)) {
srcFormat = st_choose_format(st, GL_RGBA32UI, GL_NONE,
- GL_NONE, st->internal_target, 0,
+ GL_NONE, st->internal_target, 0, 0,
srcBind, FALSE);
}
else if (util_format_is_snorm(srcFormat)) {
srcFormat = st_choose_format(st, GL_RGBA16_SNORM, GL_NONE,
- GL_NONE, st->internal_target, 0,
+ GL_NONE, st->internal_target, 0, 0,
srcBind, FALSE);
}
else {
srcFormat = st_choose_format(st, GL_RGBA, GL_NONE,
- GL_NONE, st->internal_target, 0,
+ GL_NONE, st->internal_target, 0, 0,
srcBind, FALSE);
}
}
format = PIPE_FORMAT_R16G16B16A16_SNORM;
}
else {
- format = st_choose_renderbuffer_format(st, internalFormat, 0);
+ format = st_choose_renderbuffer_format(st, internalFormat, 0, 0);
/* Not setting gl_renderbuffer::Format here will cause
* FRAMEBUFFER_UNSUPPORTED and ValidateFramebuffer will not be called.
}
for (i = start; i <= ctx->Const.MaxSamples; i++) {
- format = st_choose_renderbuffer_format(st, internalFormat, i);
+ format = st_choose_renderbuffer_format(st, internalFormat, i, i);
if (format != PIPE_FORMAT_NONE) {
rb->NumSamples = i;
}
}
} else {
- format = st_choose_renderbuffer_format(st, internalFormat, 0);
+ format = st_choose_renderbuffer_format(st, internalFormat, 0, 0);
}
/* Not setting gl_renderbuffer::Format here will cause
}
dst_format = st_choose_format(st, dst_glformat, format, type,
- pipe_target, 0, bind, FALSE);
+ pipe_target, 0, 0, bind, FALSE);
if (dst_format == PIPE_FORMAT_NONE) {
/* unable to get an rgba format!?! */
const enum pipe_format formats[],
enum pipe_texture_target target,
unsigned sample_count,
+ unsigned storage_sample_count,
unsigned bindings,
boolean allow_dxt)
{
uint i;
for (i = 0; formats[i]; i++) {
if (screen->is_format_supported(screen, formats[i], target,
- sample_count, sample_count, bindings)) {
+ sample_count, storage_sample_count,
+ bindings)) {
if (!allow_dxt && util_format_is_s3tc(formats[i])) {
/* we can't return a dxt format, continue searching */
continue;
st_choose_format(struct st_context *st, GLenum internalFormat,
GLenum format, GLenum type,
enum pipe_texture_target target, unsigned sample_count,
+ unsigned storage_sample_count,
unsigned bindings, boolean allow_dxt)
{
struct pipe_screen *screen = st->pipe->screen;
pf = find_exact_format(internalFormat, format, type);
if (pf != PIPE_FORMAT_NONE &&
screen->is_format_supported(screen, pf, target, sample_count,
- sample_count, bindings)) {
+ storage_sample_count, bindings)) {
goto success;
}
* which is supported by the driver.
*/
pf = find_supported_format(screen, mapping->pipeFormats,
- target, sample_count, bindings,
+ target, sample_count,
+ storage_sample_count, bindings,
allow_dxt);
goto success;
}
*/
enum pipe_format
st_choose_renderbuffer_format(struct st_context *st,
- GLenum internalFormat, unsigned sample_count)
+ GLenum internalFormat, unsigned sample_count,
+ unsigned storage_sample_count)
{
unsigned bindings;
if (_mesa_is_depth_or_stencil_format(internalFormat))
else
bindings = PIPE_BIND_RENDER_TARGET;
return st_choose_format(st, internalFormat, GL_NONE, GL_NONE,
- PIPE_TEXTURE_2D, sample_count, bindings, FALSE);
+ PIPE_TEXTURE_2D, sample_count,
+ storage_sample_count, bindings, FALSE);
}
}
pFormat = st_choose_format(st, internalFormat, format, type,
- pTarget, 0, bindings, GL_TRUE);
+ pTarget, 0, 0, bindings, GL_TRUE);
if (pFormat == PIPE_FORMAT_NONE && !is_renderbuffer) {
/* try choosing format again, this time without render target bindings */
pFormat = st_choose_format(st, internalFormat, format, type,
- pTarget, 0, PIPE_BIND_SAMPLER_VIEW,
+ pTarget, 0, 0, PIPE_BIND_SAMPLER_VIEW,
GL_TRUE);
}
/* Set sample counts in descending order. */
for (i = 16; i > 1; i--) {
format = st_choose_format(st, internalFormat, GL_NONE, GL_NONE,
- PIPE_TEXTURE_2D, i, bind, FALSE);
+ PIPE_TEXTURE_2D, i, i, bind, FALSE);
if (format != PIPE_FORMAT_NONE) {
samples[num_sample_counts++] = i;
internalFormat,
GL_NONE,
GL_NONE,
- PIPE_TEXTURE_2D, 1,
+ PIPE_TEXTURE_2D, 0, 0,
bindings, FALSE);
if (pformat)
params[0] = internalFormat;
st_choose_format(struct st_context *st, GLenum internalFormat,
GLenum format, GLenum type,
enum pipe_texture_target target, unsigned sample_count,
+ unsigned storage_sample_count,
unsigned bindings, boolean allow_dxt);
extern enum pipe_format
st_choose_renderbuffer_format(struct st_context *st,
- GLenum internalFormat, unsigned sample_count);
+ GLenum internalFormat, unsigned sample_count,
+ unsigned storage_sample_count);
extern enum pipe_format
st_choose_matching_format(struct st_context *st, unsigned bind,
/* find an RGBA texture format */
format = st_choose_format(st, GL_RGBA, GL_NONE, GL_NONE,
- PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW,
+ PIPE_TEXTURE_2D, 0, 0, PIPE_BIND_SAMPLER_VIEW,
FALSE);
/* create texture for color map/table */