diff options
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.c | 22 | ||||
-rw-r--r-- | src/mesa/main/config.h | 22 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_extensions.c | 9 |
3 files changed, 26 insertions, 27 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 59871ed84e2..6ba64e4e06d 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -421,10 +421,10 @@ brw_initialize_context_constants(struct brw_context *brw) ctx->Const.MaxComputeWorkGroupSize[0] >= 128), }; - unsigned num_gfx_stages = 0; - for (int i = 0; i < MESA_SHADER_COMPUTE; i++) { + unsigned num_stages = 0; + for (int i = 0; i < MESA_SHADER_STAGES; i++) { if (stage_exists[i]) - num_gfx_stages++; + num_stages++; } unsigned max_samplers = @@ -505,14 +505,14 @@ brw_initialize_context_constants(struct brw_context *brw) MIN2(ctx->Const.MaxTextureCoordUnits, ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits); - ctx->Const.MaxUniformBufferBindings = num_gfx_stages * BRW_MAX_UBO; - ctx->Const.MaxCombinedUniformBlocks = num_gfx_stages * BRW_MAX_UBO; - ctx->Const.MaxCombinedAtomicBuffers = num_gfx_stages * BRW_MAX_ABO; - ctx->Const.MaxCombinedShaderStorageBlocks = num_gfx_stages * BRW_MAX_SSBO; - ctx->Const.MaxCombinedTextureImageUnits = num_gfx_stages * max_samplers; - ctx->Const.MaxCombinedImageUniforms = num_gfx_stages * BRW_MAX_IMAGES; - ctx->Const.MaxShaderStorageBufferBindings = - (num_gfx_stages + stage_exists[MESA_SHADER_COMPUTE]) * BRW_MAX_SSBO; + ctx->Const.MaxUniformBufferBindings = num_stages * BRW_MAX_UBO; + ctx->Const.MaxCombinedUniformBlocks = num_stages * BRW_MAX_UBO; + ctx->Const.MaxCombinedAtomicBuffers = num_stages * BRW_MAX_ABO; + ctx->Const.MaxCombinedShaderStorageBlocks = num_stages * BRW_MAX_SSBO; + ctx->Const.MaxShaderStorageBufferBindings = num_stages * BRW_MAX_SSBO; + ctx->Const.MaxCombinedTextureImageUnits = num_stages * max_samplers; + ctx->Const.MaxCombinedImageUniforms = num_stages * BRW_MAX_IMAGES; + /* Hardware only supports a limited number of transform feedback buffers. * So we need to override the Mesa default (which is based only on software diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index 19bc6b2457e..6f514650009 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -173,19 +173,17 @@ #define MAX_UNIFORMS 4096 #define MAX_UNIFORM_BUFFERS 15 /* + 1 default uniform buffer */ #define MAX_SHADER_STORAGE_BUFFERS 16 -/* 5 is for vertex, hull, domain, geometry, and fragment shader. Don't - * include compute. - */ -#define MAX_COMBINED_UNIFORM_BUFFERS (MAX_UNIFORM_BUFFERS * 5) -#define MAX_COMBINED_SHADER_STORAGE_BUFFERS (MAX_SHADER_STORAGE_BUFFERS * 5) +/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */ +#define MAX_COMBINED_UNIFORM_BUFFERS (MAX_UNIFORM_BUFFERS * 6) +#define MAX_COMBINED_SHADER_STORAGE_BUFFERS (MAX_SHADER_STORAGE_BUFFERS * 6) #define MAX_ATOMIC_COUNTERS 4096 -/* 5 is for vertex, hull, domain, geometry, and fragment shader. */ -#define MAX_COMBINED_ATOMIC_BUFFERS (MAX_UNIFORM_BUFFERS * 5) +/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */ +#define MAX_COMBINED_ATOMIC_BUFFERS (MAX_UNIFORM_BUFFERS * 6) /* Size of an atomic counter in bytes according to ARB_shader_atomic_counters */ #define ATOMIC_COUNTER_SIZE 4 #define MAX_IMAGE_UNIFORMS 32 -/* 5 is for vertex, hull, domain, geometry, and fragment shader. */ -#define MAX_IMAGE_UNITS (MAX_IMAGE_UNIFORMS * 5) +/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */ +#define MAX_IMAGE_UNITS (MAX_IMAGE_UNIFORMS * 6) /*@}*/ /** @@ -224,10 +222,8 @@ /** For GL_ARB_vertex_shader */ /*@{*/ #define MAX_VERTEX_GENERIC_ATTRIBS 16 -/* 5 is the number of shader stages that can be used at the same time. - * compute can't be used at the same time as other shaders. - */ -#define MAX_COMBINED_TEXTURE_IMAGE_UNITS (MAX_TEXTURE_IMAGE_UNITS * 5) +/* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */ +#define MAX_COMBINED_TEXTURE_IMAGE_UNITS (MAX_TEXTURE_IMAGE_UNITS * 6) /*@}*/ diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 2a1b2931d5a..a63c58c8acb 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -337,7 +337,8 @@ void st_init_limits(struct pipe_screen *screen, c->Program[MESA_SHADER_TESS_CTRL].MaxTextureImageUnits + c->Program[MESA_SHADER_TESS_EVAL].MaxTextureImageUnits + c->Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits + - c->Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits, + c->Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits + + c->Program[MESA_SHADER_COMPUTE].MaxTextureImageUnits, MAX_COMBINED_TEXTURE_IMAGE_UNITS); /* This depends on program constants. */ @@ -412,7 +413,8 @@ void st_init_limits(struct pipe_screen *screen, c->Program[MESA_SHADER_TESS_CTRL].MaxUniformBlocks + c->Program[MESA_SHADER_TESS_EVAL].MaxUniformBlocks + c->Program[MESA_SHADER_GEOMETRY].MaxUniformBlocks + - c->Program[MESA_SHADER_FRAGMENT].MaxUniformBlocks, + c->Program[MESA_SHADER_FRAGMENT].MaxUniformBlocks + + c->Program[MESA_SHADER_COMPUTE].MaxUniformBlocks; assert(c->MaxCombinedUniformBlocks <= MAX_COMBINED_UNIFORM_BUFFERS); } @@ -478,7 +480,8 @@ void st_init_limits(struct pipe_screen *screen, c->Program[MESA_SHADER_TESS_CTRL].MaxImageUniforms + c->Program[MESA_SHADER_TESS_EVAL].MaxImageUniforms + c->Program[MESA_SHADER_GEOMETRY].MaxImageUniforms + - c->Program[MESA_SHADER_FRAGMENT].MaxImageUniforms; + c->Program[MESA_SHADER_FRAGMENT].MaxImageUniforms + + c->Program[MESA_SHADER_COMPUTE].MaxImageUniforms; c->MaxCombinedShaderOutputResources += c->MaxCombinedImageUniforms; c->MaxImageUnits = MAX_IMAGE_UNITS; if (c->MaxCombinedImageUniforms) { |