diff options
author | mano-wii <germano.costa@ig.com.br> | 2019-09-18 18:33:00 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2019-09-18 18:33:23 +0300 |
commit | 77f1f13663d3dc2207803e08482fef92d92f44c2 (patch) | |
tree | e37d0e4153853ad1c8f361bf0dd9b9625090b118 /source/blender/gpu/intern/gpu_batch.c | |
parent | f9beb1bef1787166aafd35d326244f3e3f83487e (diff) |
GPU: AMD: Remove workaround that doesn't work
Diffstat (limited to 'source/blender/gpu/intern/gpu_batch.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_batch.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/source/blender/gpu/intern/gpu_batch.c b/source/blender/gpu/intern/gpu_batch.c index 9c0c001b979..76459d7ad45 100644 --- a/source/blender/gpu/intern/gpu_batch.c +++ b/source/blender/gpu/intern/gpu_batch.c @@ -447,34 +447,6 @@ static void create_bindings(GPUVertBuf *verts, } } -static void instance_id_workaround(GPUBatch *batch) -{ - /** - * A driver bug make it so that when using an attribute with GL_INT_2_10_10_10_REV as format, - * the gl_InstanceID is incremented by the 2 bit component of the attrib. To workaround this, - * we create a new vertex attrib containing the expected value of gl_InstanceID. - **/ - const GPUShaderInput *input = GPU_shaderinterface_attr(batch->interface, "_instanceId"); - if (input) { -#define DRW_RESOURCE_CHUNK_LEN 512 /* Keep in sync. */ - static GLint vbo_id = 0; - if (vbo_id == 0) { - short data[DRW_RESOURCE_CHUNK_LEN]; - for (int i = 0; i < DRW_RESOURCE_CHUNK_LEN; i++) { - data[i] = i; - } - /* GPU_context takes care of deleting `vbo_id` at the end. */ - vbo_id = GPU_buf_alloc(); - glBindBuffer(GL_ARRAY_BUFFER, vbo_id); - glBufferData(GL_ARRAY_BUFFER, sizeof(data), data, GL_STATIC_DRAW); - } - glBindBuffer(GL_ARRAY_BUFFER, vbo_id); - glEnableVertexAttribArray(input->location); - glVertexAttribIPointer(input->location, 1, GL_SHORT, 0, NULL); - glVertexAttribDivisor(input->location, 1); - } -} - static void batch_update_program_bindings(GPUBatch *batch, uint i_first) { /* Reverse order so first vbos have more prevalence (in term of attrib override). */ @@ -489,9 +461,6 @@ static void batch_update_program_bindings(GPUBatch *batch, uint i_first) if (batch->elem) { GPU_indexbuf_use(batch->elem); } - if (GPU_crappy_amd_driver()) { - instance_id_workaround(batch); - } } void GPU_batch_program_use_begin(GPUBatch *batch) |