Commit a4678311 authored by Brian Paul's avatar Brian Paul

st/mesa: 78-column wrapping in st_extensions.c

Reviewed-by: Eduardo Lima Mitev's avatarEduardo Lima Mitev <elima@igalia.com>
parent 9e6a6bd5
...@@ -109,23 +109,20 @@ void st_init_limits(struct pipe_screen *screen, ...@@ -109,23 +109,20 @@ void st_init_limits(struct pipe_screen *screen,
_clamp(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS), _clamp(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS),
1, MAX_DRAW_BUFFERS); 1, MAX_DRAW_BUFFERS);
c->MaxDualSourceDrawBuffers c->MaxDualSourceDrawBuffers =
= _clamp(screen->get_param(screen, PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS), _clamp(screen->get_param(screen,
0, MAX_DRAW_BUFFERS); PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS),
0, MAX_DRAW_BUFFERS);
c->MaxLineWidth
= _maxf(1.0f, screen->get_paramf(screen, c->MaxLineWidth =
PIPE_CAPF_MAX_LINE_WIDTH)); _maxf(1.0f, screen->get_paramf(screen, PIPE_CAPF_MAX_LINE_WIDTH));
c->MaxLineWidthAA c->MaxLineWidthAA =
= _maxf(1.0f, screen->get_paramf(screen, _maxf(1.0f, screen->get_paramf(screen, PIPE_CAPF_MAX_LINE_WIDTH_AA));
PIPE_CAPF_MAX_LINE_WIDTH_AA));
c->MaxPointSize =
c->MaxPointSize _maxf(1.0f, screen->get_paramf(screen, PIPE_CAPF_MAX_POINT_WIDTH));
= _maxf(1.0f, screen->get_paramf(screen, c->MaxPointSizeAA =
PIPE_CAPF_MAX_POINT_WIDTH)); _maxf(1.0f, screen->get_paramf(screen, PIPE_CAPF_MAX_POINT_WIDTH_AA));
c->MaxPointSizeAA
= _maxf(1.0f, screen->get_paramf(screen,
PIPE_CAPF_MAX_POINT_WIDTH_AA));
/* these are not queryable. Note that GL basically mandates a 1.0 minimum /* these are not queryable. Note that GL basically mandates a 1.0 minimum
* for non-aa sizes, but we can go down to 0.0 for aa points. * for non-aa sizes, but we can go down to 0.0 for aa points.
...@@ -133,15 +130,16 @@ void st_init_limits(struct pipe_screen *screen, ...@@ -133,15 +130,16 @@ void st_init_limits(struct pipe_screen *screen,
c->MinPointSize = 1.0f; c->MinPointSize = 1.0f;
c->MinPointSizeAA = 0.0f; c->MinPointSizeAA = 0.0f;
c->MaxTextureMaxAnisotropy c->MaxTextureMaxAnisotropy =
= _maxf(2.0f, screen->get_paramf(screen, _maxf(2.0f,
PIPE_CAPF_MAX_TEXTURE_ANISOTROPY)); screen->get_paramf(screen, PIPE_CAPF_MAX_TEXTURE_ANISOTROPY));
c->MaxTextureLodBias c->MaxTextureLodBias =
= screen->get_paramf(screen, PIPE_CAPF_MAX_TEXTURE_LOD_BIAS); screen->get_paramf(screen, PIPE_CAPF_MAX_TEXTURE_LOD_BIAS);
c->QuadsFollowProvokingVertexConvention = screen->get_param( c->QuadsFollowProvokingVertexConvention =
screen, PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION); screen->get_param(screen,
PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION);
c->MaxUniformBlockSize = c->MaxUniformBlockSize =
screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT, screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT,
...@@ -195,21 +193,31 @@ void st_init_limits(struct pipe_screen *screen, ...@@ -195,21 +193,31 @@ void st_init_limits(struct pipe_screen *screen,
PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS), PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS),
MAX_TEXTURE_IMAGE_UNITS); MAX_TEXTURE_IMAGE_UNITS);
pc->MaxInstructions = pc->MaxNativeInstructions = pc->MaxInstructions =
pc->MaxNativeInstructions =
screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INSTRUCTIONS); screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INSTRUCTIONS);
pc->MaxAluInstructions = pc->MaxNativeAluInstructions = pc->MaxAluInstructions =
screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS); pc->MaxNativeAluInstructions =
pc->MaxTexInstructions = pc->MaxNativeTexInstructions = screen->get_shader_param(screen, sh,
screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS); PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS);
pc->MaxTexIndirections = pc->MaxNativeTexIndirections = pc->MaxTexInstructions =
screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS); pc->MaxNativeTexInstructions =
pc->MaxAttribs = pc->MaxNativeAttribs = screen->get_shader_param(screen, sh,
PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS);
pc->MaxTexIndirections =
pc->MaxNativeTexIndirections =
screen->get_shader_param(screen, sh,
PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS);
pc->MaxAttribs =
pc->MaxNativeAttribs =
screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INPUTS); screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INPUTS);
pc->MaxTemps = pc->MaxNativeTemps = pc->MaxTemps =
pc->MaxNativeTemps =
screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEMPS); screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEMPS);
pc->MaxAddressRegs = pc->MaxNativeAddressRegs = pc->MaxAddressRegs =
sh == PIPE_SHADER_VERTEX ? 1 : 0; pc->MaxNativeAddressRegs = sh == PIPE_SHADER_VERTEX ? 1 : 0;
pc->MaxParameters = pc->MaxNativeParameters = pc->MaxParameters =
pc->MaxNativeParameters =
screen->get_shader_param(screen, sh, screen->get_shader_param(screen, sh,
PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE) / sizeof(float[4]); PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE) / sizeof(float[4]);
pc->MaxInputComponents = pc->MaxInputComponents =
...@@ -217,10 +225,12 @@ void st_init_limits(struct pipe_screen *screen, ...@@ -217,10 +225,12 @@ void st_init_limits(struct pipe_screen *screen,
pc->MaxOutputComponents = pc->MaxOutputComponents =
screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_OUTPUTS) * 4; screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_OUTPUTS) * 4;
pc->MaxUniformComponents = 4 * MIN2(pc->MaxNativeParameters, MAX_UNIFORMS); pc->MaxUniformComponents =
4 * MIN2(pc->MaxNativeParameters, MAX_UNIFORMS);
pc->MaxUniformBlocks = pc->MaxUniformBlocks =
screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONST_BUFFERS); screen->get_shader_param(screen, sh,
PIPE_SHADER_CAP_MAX_CONST_BUFFERS);
if (pc->MaxUniformBlocks) if (pc->MaxUniformBlocks)
pc->MaxUniformBlocks -= 1; /* The first one is for ordinary uniforms. */ pc->MaxUniformBlocks -= 1; /* The first one is for ordinary uniforms. */
pc->MaxUniformBlocks = _min(pc->MaxUniformBlocks, MAX_UNIFORM_BUFFERS); pc->MaxUniformBlocks = _min(pc->MaxUniformBlocks, MAX_UNIFORM_BUFFERS);
...@@ -246,21 +256,33 @@ void st_init_limits(struct pipe_screen *screen, ...@@ -246,21 +256,33 @@ void st_init_limits(struct pipe_screen *screen,
options->EmitNoNoise = TRUE; options->EmitNoNoise = TRUE;
/* TODO: make these more fine-grained if anyone needs it */ /* TODO: make these more fine-grained if anyone needs it */
options->MaxIfDepth = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH); options->MaxIfDepth =
options->EmitNoLoops = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH); screen->get_shader_param(screen, sh,
options->EmitNoFunctions = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_SUBROUTINES); PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH);
options->EmitNoMainReturn = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_SUBROUTINES); options->EmitNoLoops =
!screen->get_shader_param(screen, sh,
options->EmitNoCont = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED); PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH);
options->EmitNoFunctions =
options->EmitNoIndirectInput = !screen->get_shader_param(screen, sh, !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_SUBROUTINES);
PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR); options->EmitNoMainReturn =
options->EmitNoIndirectOutput = !screen->get_shader_param(screen, sh, !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_SUBROUTINES);
PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR);
options->EmitNoIndirectTemp = !screen->get_shader_param(screen, sh, options->EmitNoCont =
PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR); !screen->get_shader_param(screen, sh,
options->EmitNoIndirectUniform = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED);
PIPE_SHADER_CAP_INDIRECT_CONST_ADDR);
options->EmitNoIndirectInput =
!screen->get_shader_param(screen, sh,
PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR);
options->EmitNoIndirectOutput =
!screen->get_shader_param(screen, sh,
PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR);
options->EmitNoIndirectTemp =
!screen->get_shader_param(screen, sh,
PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR);
options->EmitNoIndirectUniform =
!screen->get_shader_param(screen, sh,
PIPE_SHADER_CAP_INDIRECT_CONST_ADDR);
if (pc->MaxNativeInstructions && if (pc->MaxNativeInstructions &&
(options->EmitNoIndirectUniform || pc->MaxUniformBlocks < 12)) { (options->EmitNoIndirectUniform || pc->MaxUniformBlocks < 12)) {
...@@ -268,10 +290,14 @@ void st_init_limits(struct pipe_screen *screen, ...@@ -268,10 +290,14 @@ void st_init_limits(struct pipe_screen *screen,
} }
if (options->EmitNoLoops) if (options->EmitNoLoops)
options->MaxUnrollIterations = MIN2(screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INSTRUCTIONS), 65536); options->MaxUnrollIterations =
MIN2(screen->get_shader_param(screen, sh,
PIPE_SHADER_CAP_MAX_INSTRUCTIONS),
65536);
else else
options->MaxUnrollIterations = screen->get_shader_param(screen, sh, options->MaxUnrollIterations =
PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT); screen->get_shader_param(screen, sh,
PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT);
options->LowerClipDistance = true; options->LowerClipDistance = true;
options->LowerBufferInterfaceBlocks = true; options->LowerBufferInterfaceBlocks = true;
...@@ -293,37 +319,50 @@ void st_init_limits(struct pipe_screen *screen, ...@@ -293,37 +319,50 @@ void st_init_limits(struct pipe_screen *screen,
/* This depends on program constants. */ /* This depends on program constants. */
c->MaxTextureCoordUnits c->MaxTextureCoordUnits
= _min(c->Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits, MAX_TEXTURE_COORD_UNITS); = _min(c->Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits,
MAX_TEXTURE_COORD_UNITS);
c->MaxTextureUnits = _min(c->Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits, c->MaxTextureCoordUnits); c->MaxTextureUnits =
_min(c->Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits,
c->MaxTextureCoordUnits);
c->Program[MESA_SHADER_VERTEX].MaxAttribs = MIN2(c->Program[MESA_SHADER_VERTEX].MaxAttribs, 16); c->Program[MESA_SHADER_VERTEX].MaxAttribs =
MIN2(c->Program[MESA_SHADER_VERTEX].MaxAttribs, 16);
/* PIPE_SHADER_CAP_MAX_INPUTS for the FS specifies the maximum number /* PIPE_SHADER_CAP_MAX_INPUTS for the FS specifies the maximum number
* of inputs. It's always 2 colors + N generic inputs. */ * of inputs. It's always 2 colors + N generic inputs. */
c->MaxVarying = screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT, c->MaxVarying = screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT,
PIPE_SHADER_CAP_MAX_INPUTS); PIPE_SHADER_CAP_MAX_INPUTS);
c->MaxVarying = MIN2(c->MaxVarying, MAX_VARYING); c->MaxVarying = MIN2(c->MaxVarying, MAX_VARYING);
c->MaxGeometryOutputVertices = screen->get_param(screen, PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES); c->MaxGeometryOutputVertices =
c->MaxGeometryTotalOutputComponents = screen->get_param(screen, PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS); screen->get_param(screen, PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES);
c->MaxGeometryTotalOutputComponents =
screen->get_param(screen, PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS);
c->MaxTessPatchComponents = c->MaxTessPatchComponents =
MAX2(screen->get_param(screen, PIPE_CAP_MAX_SHADER_PATCH_VARYINGS), MAX2(screen->get_param(screen, PIPE_CAP_MAX_SHADER_PATCH_VARYINGS),
MAX_VARYING) * 4; MAX_VARYING) * 4;
c->MinProgramTexelOffset = screen->get_param(screen, PIPE_CAP_MIN_TEXEL_OFFSET); c->MinProgramTexelOffset =
c->MaxProgramTexelOffset = screen->get_param(screen, PIPE_CAP_MAX_TEXEL_OFFSET); screen->get_param(screen, PIPE_CAP_MIN_TEXEL_OFFSET);
c->MaxProgramTexelOffset =
screen->get_param(screen, PIPE_CAP_MAX_TEXEL_OFFSET);
c->MaxProgramTextureGatherComponents = screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS); c->MaxProgramTextureGatherComponents =
c->MinProgramTextureGatherOffset = screen->get_param(screen, PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET); screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS);
c->MaxProgramTextureGatherOffset = screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET); c->MinProgramTextureGatherOffset =
screen->get_param(screen, PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET);
c->MaxProgramTextureGatherOffset =
screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET);
c->MaxTransformFeedbackBuffers = c->MaxTransformFeedbackBuffers =
screen->get_param(screen, PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS); screen->get_param(screen, PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS);
c->MaxTransformFeedbackBuffers = MIN2(c->MaxTransformFeedbackBuffers, MAX_FEEDBACK_BUFFERS); c->MaxTransformFeedbackBuffers = MIN2(c->MaxTransformFeedbackBuffers,
MAX_FEEDBACK_BUFFERS);
c->MaxTransformFeedbackSeparateComponents = c->MaxTransformFeedbackSeparateComponents =
screen->get_param(screen, PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS); screen->get_param(screen, PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS);
c->MaxTransformFeedbackInterleavedComponents = c->MaxTransformFeedbackInterleavedComponents =
screen->get_param(screen, PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS); screen->get_param(screen,
PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS);
c->MaxVertexStreams = c->MaxVertexStreams =
MAX2(1, screen->get_param(screen, PIPE_CAP_MAX_VERTEX_STREAMS)); MAX2(1, screen->get_param(screen, PIPE_CAP_MAX_VERTEX_STREAMS));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment