-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add metric for 3D texture cache line size (#4421)
Summary: Pull Request resolved: #4421 Differential Revision: https://internalfb.com/D60246121
- Loading branch information
1 parent
eb02f6b
commit f5683a6
Showing
3 changed files
with
165 additions
and
1 deletion.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
backends/vulkan/tools/gpuinfo/glsl/tex_cacheline_size.glsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#version 450 core | ||
|
||
#define PRECISION ${PRECISION} | ||
#define VEC4_T ${texel_type(DTYPE)} | ||
|
||
layout(std430) buffer; | ||
|
||
${layout_declare_sampler(0, "r", "in_tex", DTYPE)} | ||
${layout_declare_buffer(1, "w", "out_buf", DTYPE, "PRECISION", False)} | ||
|
||
layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in; | ||
|
||
layout(constant_id = 3) const int niter = 1; | ||
|
||
void main() { | ||
vec4 sum = vec4(0); | ||
int i = 0; | ||
for (; i < niter; ++i){ | ||
$if DIM == 0: | ||
sum += texelFetch(in_tex, ivec3(gl_GlobalInvocationID[0], 0, 0), 0); | ||
$elif DIM == 1: | ||
sum += texelFetch(in_tex, ivec3(0, gl_GlobalInvocationID[0], 0), 0); | ||
$elif DIM == 2: | ||
sum += texelFetch(in_tex, ivec3(0, 0, gl_GlobalInvocationID[0]), 0); | ||
} | ||
|
||
// This is to ensure no compiler optimizations occur | ||
vec4 zero = vec4(i>>31); | ||
|
||
out_buf[0] = sum + zero; | ||
} |
14 changes: 14 additions & 0 deletions
14
backends/vulkan/tools/gpuinfo/glsl/tex_cacheline_size.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
tex_cacheline_size: | ||
parameter_names_with_default_values: | ||
DTYPE: float | ||
generate_variant_forall: | ||
DIM: | ||
- RANGE: [0, 2] | ||
shader_variants: | ||
- NAME: tex_cacheline_size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters